I have been trying to set up Google Analytics and it doesnt seem to be working. I have copied the Google Analytic tracking ID and also the code into the footer and header section in the SEO settings but still not luck, I have even tried to create new Google Analytic accounts and deteled the old ones, but nothing seems to be working?
Can anyone help?
I think you might be using the wrong code for analytics, @hangryblog. Make sure you use code that looks like the code shown in our guide here:
I have been facing the same issue. It's been two weeks, can't get Google Analytics working.
I copied the code as stated in Google Analytics Admin panel under Tracking Info -> Tracking code:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=hereIsMyTrackingCode"></script>
window.dataLayer = window.dataLayer || ;
gtag('js', new Date());
Hi @daria2b. That doesn't look like the proper code. If you check out this article it will give you exact instructions on which code to use. The code should look like this:
The code started to work after I used a program to remove white space (from another post I found on the forum, don't have the link now).
The other code is actually from Google Tag Manager which is a different thing. After all, I copied exactly the code that Google provides in the Google Analytics console that's why I was confused about why it doesn't work.
Glad to hear it's working for you. I had something similar happen once in the past with some scripting code I copied from somewhere. It took me a while to figure out that one of the new lines had some white space with it.