Reputation: 6569
I am implementing google analytics for the first time. Here are the steps I took.
I went to analytics.google.com and created an account. Then I created a "property". After that I created a "Data Stream" for my website and got a "Measurement ID which starts with a G-XXXXXXX. Then I implemented the following code in the header (before any other css or js calls)
<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'G-XXXXXXX', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->
When I look at the network tab, I can see that the call was made:
Request URL: https://www.google-analytics.com/j/collect?v=1&_v=j96&a=316116739&t=pageview&_s=1&dl=https://mywebsite.com&ul=en-gb&de=UTF-8&dt=My Website Title&sd=24-bit&sr=1920x1080&vp=1920x577&je=0&_u=ABC~&jid=1234&gjid=1234&cid=1234.1234&tid=G-XXXXXXX&_gid=1234.1234&_r=1&_slc=1&z=1234 Method: Post Status Code: 200
However when I look at google analytics, it says "Data collection isn't active for your website".
I waited 24 hours to ensure it is not some delay problem but there is still no data and there have been visitors on the website, at the very least myself.
Is there a step I missed or maybe it could be a configuration issue? I haven't been able to find any clues as to why it might not be working. Any help is most appreciated.
Note: The values above in Request URL have been modified to remove any sensitive information. All the parameters are there, just values have been changed to ABC and 1234 as its not necessary to see those.
Upvotes: 0
Views: 840