Google Analytics Problem and Issue

Hi there,
Last night, I just happened to notice that Google Analytics was not working on a client’s website.

I went to the settings in Pro and discovered that the script was gone. Google is telling me that it has not detected traffic for 48 hours, but I suspect it’s been longer than that.

Also, when I view the page source and search for the UA #, nothing comes up. It used to show the script I had entered, but now it does not.

How can this be resolved?

Credentials to follow. . .

Best,
Nancy

PS: I see what’s going on now. I enter the tracking code found below in the screenshot and the plugin strips it out.
So, when I copy/paste

I click save and the plugin shows this:

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-319XXXXX-1’);

Hi Nancy,

It seems that you’re using Google Tag Manager code. Google analytics code should looks like follows.

For google tag manager, could you please try following this post (https://theme.co/apex/forum/t/google-tag-manager-not-working/36341/2?u=mldarshana) and implement accordingly.

Hope that helps.

Hi There,
Thanks for your response.
Yes, if you look closely at my screen shot, it shows that I am taking the same path as you did in your screen shot.

Something has changed on Google’s end of things as before the Global Site Tag script in the screen shot, they say:

This is the Global Site Tag (gtag.js) tracking code for this property. Copy and paste this code as the first item into the of every webpage you want to track. If you already have a Global Site Tag on your page, simply add the config line from the snippet below to your existing Global Site Tag.

Also, the information found here: https://theme.co/apex/forum/t/extension-google-analytics/84 is out of date as the extension in Pro has changed and now looks like this:

Here is a link on setting up analytics. https://support.google.com/analytics/answer/1008080?hl=en&ref_topic=1008079 This pretty much confirms that they are now calling the code gtag.js.

How do I get this to work?

Thanks so much for your help!

Hey @NLeVasseur,

We’re sorry about the outdated resource. The person assigned for the rework of the Knowledge Base has not yet reached that article but rest assured, it will be updated.

For now, please remove your Tag Manager code in the Meta Tag box of the Google Analytics extension. The extension is only for Google Analytics now and the Meta Tag box is for the meta tag site verification method and not for the Tag Manager code.

Please follow the thread that @mldarshana linked to to add any code to the <head>. Alternatively, you can read https://kinsta.com/knowledgebase/add-code-wordpress-header-footer/. Once your Tag Manager code is outputted successfully in the head of your site, it should work.

Thanks.

Hi Christian,
I’ve removed the snippet from the Meta Tag box.

But I’m a little confused by your instructions above. Near as I can figure, there is the Global Site Tag, which is the tracking code for a property.

There is also the Google Tag Manager which “can help you add tags to your site if you have many analytics and tracking tags.” The way I read/understand this, I do not need the Google Tag Manager because I do not have many analytics and tracking tags.

The instructions in the tread that @mldarshana linked to are for adding the Google Tag Manager to a website.

I just want to add the Global Site Tag to the site.

How do I do this?

Thank you.

Hi Nancy,

Hope you’re doing fine today, as you already know with the new Google Analytics extension (version 3.0.0), it only ask for your Google Analytics ID and not the entire code.

I can confirm that your site is rendering the Global site tag (gtag.js) properly (see screenshot below)

The Global site tag will not be rendered if you’re login to avoid unnecessary hits. You need to log-out to see the Tag code.

Seems the issue is not on how you added the tag, Maybe something is conflicting it if it’s not tracking. Do you have other analytics on your site? Would you mind removing those?

Also, please do a testing for a plugin conflict. You can do this by deactivating all third-party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Also, its worth mentioning to review your Google Analytics configuration.

Cheers!

Hi Friech,
Thanks so much for sorting through this rather long support thread and then providing an explanation. I did not know that the UA # would NOT display if logged in as an admin. So good to know! Thank you. I checked the analytics this morning, and they look fine as of last night when I took out that script that was not needed.

Thanks again for sorting all this out! I sincerely appreciate it.

Best,
Nancy

You’re welcome, Nancy :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.