MatteoGabriele / vue-gtag

Global Site Tag plugin for Vue (gtag.js)
https://matteo-gabriele.gitbook.io/vue-gtag/
MIT License
863 stars 66 forks source link

Chrome plugin Google Tag Assistant registering multiple tags #216

Closed TobiasGOhmy closed 3 years ago

TobiasGOhmy commented 3 years ago

Hello! I noticed that my site is adding multiple gtag-scripts when I check my website with the "Google Tag Assistant" chrome plugin. Is this intended? It keeps adding more and more scripts when I change routes (according to the plugin). I can see it registers page views in GA, but i'm afraid the numbers wont be accurate because of this.

My implementation looks like this:

Vue.use(VueGtag, { config: { id: GTAG_ID } }, router);

image

hhanckes commented 3 years ago

Same here. Any advice? Thanks.

MatteoGabriele commented 3 years ago

What do you mean for "gtag-scripts"?

hhanckes commented 3 years ago

If you use the "tag assistant" that's a chrome addon you'll see the following warning message: "Multiple installations of Global site tag (gtag.js) detected". Attached the screenshot:

Screen Shot 2020-11-05 at 1 37 32 PM
luke-hawk commented 3 years ago

+1

MatteoGabriele commented 3 years ago

I've been using the tag assistant but for me looks different and it doesn't really say nothing about multiple installation. I literally run their script once, so I am not sure what to do. Any suggestions?

Screenshot 2020-11-12 at 20 54 56
raminjafary commented 3 years ago

@MatteoGabriele This is a common issue of Google Tag Assistant (not vue-gtag) in SPA routing. It can't detect page transitions correctly so it loads the GTM (or GTAG) container for each URL. As far as you can see one request per page in your browser's Network requests, everything is working properly! I think we can add this somewhere in the docs!

MatteoGabriele commented 3 years ago

Thanks a lot for the update, I'm sure the ticket itself will be enough for people to look at. If i have time, i might add it to an article I'd like to write for the upcoming version 2