Archived topic
Google Analytics Tag Duplication
7 replies · Started by Scott on September 19, 2019
Hi
I'm in the process of being set up with an advertising network and they have identified that I have duplicate Google Analytics tracking codes installed.
However, we're having trouble tracking down where these codes are located. The ad network suggested I clear server level caching which I have done but this didn't fix the issue.
Would you mind please taking a look?
Hi there,
Can you check Hooks Element first?
https://docs.generatepress.com/article/hooks-element-overview/
That's the only place you should be adding GA code in GP.
Let me know :)
Hi Leo
Thanks for your reply.
Neither of the Analytics tracking codes are located in the Hooks Element from what I can see. I'm aware this is the correct place for them to be added. I think they would have been added prior to the launch of GP Elements - would this make a difference?
I'm using the Google Tag Assistant Chrome plugin which confirms there are two instances of the Analytics code on the site.
Hi there,
in Appearance > Elements can you see Legacy Hooks button at the top of the screen?
If so check inside there.
If not - do you have a child theme functions.php or the Code Snippets plugin installed. This is where the codes could also be.
Hi David
I hadn't noticed the Legacy Hooks button so thanks for pointing that out. There was indeed a Google Analytics Global site tag (gtag.js) there.
After disabling this, Google Tag Assistant now reports only one occurrence of the analytics code, which is great. My remaining issues are:
- I don't know where the remaining analytics code is located
- Google Tag Assistant is reporting that the remaining code is a non-standard implementation, meaning they have detected Google Tag Manager web requests, but were not able to find the code snippet on the page.
Regarding your final point, I'm not using a child theme, I am using the Code Snippets plugin but there are no snippets containing analytics code.
Have you checked any Plugins?
Hi David
I've found the remaining code - in my Google Tag Manager setup I had implemented a Universal Analytics Tag.
Thanks again for your help.
Glad to hear you found the answer