elgorditosalsero / react-gtm-hook

Easily manage the Google Tag Manager via Hook
https://elgorditosalsero-react-gtm-hook.netlify.app/
MIT License
220 stars 28 forks source link

How To Use Without Init'ing #30

Closed eligundry closed 1 year ago

eligundry commented 3 years ago

Hi all, love the hook. We are using it with Gatsby and from v2.0.3 backwards, we were able to use it with gatsby-plugin-google-tag-manager which inlines the GTM inclusion script into the compiled HTML. After v2.0.3, the API changed (for the better it seems) but now it is impossible to use without the provider doing some initing. Would it be possible to have the new provider have an option to not include the GTM script?

Also, release v2.0.5 should have been a major version release, bumping it to v3.0.0. The reason I am saying this is that npm will silently upgrade bugfix versions like this, but won't if it's a major version release. When an API changes in a major way (in this case, the default export was removed and the provider names changed), it usually wise to bump up the major so it doesn't break builds.

elgorditosalsero commented 3 years ago

Hi @eligundry

I don't use Gatsby but I'll look into it as soon as possible, but atm I don't have time to look at it.

Feel free to open a PR!

Regard the versioning, yes my fault :)

eligundry commented 3 years ago

I'll look into opening a PR this week.