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>