Looks like the new GA Google Analytics no longer requires the code snippet from Google to be added as an input – it’s added automatically. As a result, the code snippet was being echoed at the top of the page as in:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-104299232-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-104299232-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-104299232-2');
</script>
gtag('js', new Date());
gtag('config', 'UA-104299232-2');
</script>
Removing the added code and checking “gtag (new)” resolved the issue.
Cheers!
Scott
Awesome Scott, glad you got it sorted and thank you for sharing the solution. Cheers!
Thank you so much Scott!
I followed your solution by removing the Custom GA Code and just have the GA tracking ID, it worked!
Cheers!
Luz
I am having this problem on the site http://www.pottymonkey.com, but I don’t have the know-how to find or change the code. I need help, please!
~Janet D.
Update: I have found the code for the plugin, but I don’t know what part to remove – what part is the “Custom GA Code” that should be deleted?
Thanks for any help!
~Janet D.
Not sure. The plugin doesn’t provide anything that you would be able to delete. So any code or whatever you are looking at is something that someone has added, and not something I have ever seen before.
@marketingatpottymd, yes delete the Custom GA code and thats it 🙂
-
This reply was modified 7 years, 2 months ago by
lauriita.
Well, I know enough to know that I don’t know enough to know what I don’t know. I don’t know where to go to delete the Custom GA code. Thanks, anyways. Hopefully I can find something else that won’t cause the problem for the site.
It’s just a plugin setting. Literally called “Custom GA Code”. Locate it on the plugin settings screen, clear the contents, save changes, done.