Archived topic
Google Analytics Not Tracking
3 replies · Started by Sandee on February 19, 2020
Hello,
I'm using Google Site Tag to add analytics to my website. I have added it to the wp_head section via the Elements module, and the website activity is not being tracked.
I tried to refer to this post https://generatepress.com/forums/topic/no-data-being-sent-to-google-analytics/, but there was no response to further action.
Here's the code I added. Can you advise on what I need to do to get the tracking to work?
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXX-X');
</script>
Hi there,
Can you make sure everything is done correctly according to the instructions here?
https://docs.generatepress.com/article/implement-google-tag-manager/#using-hooks-element
Let me know :)
Yes, I followed those steps and no sunshine. I'm not sure what the issue is, but I would love some help in getting this fixed.
Thank you!
Just to confirm, you've added both blocks of code?
If so it should work. Maybe give it some time.