johannschopplich / nuxt-gtag

🔸 Google Analytics & Ads integration made easy
https://developers.google.com/tag-platform/gtagjs
MIT License
302 stars 9 forks source link

Rename gtag.js file to prevent adblock plugins affecting dev mode #85

Closed ptdev closed 3 months ago

ptdev commented 3 months ago

Describe the feature

Hi,

As was already reported on #84 (I also added a comment there), if we're using some sort of adblocking, when using this plugin in dev mode, the imports from './gtag.js' get blocked by the browser which sometimes can cause other issues with our app once that happens.

Now this can happen with many plugins (adblocks, vpns, etc) or privacy focused browsers that use the EasyPrivacy list.

A simple fix would be to simply rename this component's gtag.js file to something else, for example nuxt-gtag.js as that will bypass the rule and make this work on dev mode, even with adblock enabled.

I have made the change above on our project directly on the node_modules/nuxt-gtag folder and can confirm this works correctly. (I'm guessing on this repo's source, it would have to be the gtag.ts file to get renamed instead)

Thank you, cheers 👍

Additional information

Final checks

johannschopplich commented 3 months ago

Hi there! Thanks for the issue report. This will be fixed with the next release.