Google Analytics Extension Error on Site Pages

Hi

On my site https://www.cloudstarttraining.co.uk/ and error is appearing at the top of page which is to do with the Google Analytics extension. Somehow, when I am trying to copy the code from Google Analytics (which is from my Google Analytics account) it seems to strip out the script tags. Not sure if the problem is to do with this though.

Strangely, when I temporarily switched to the normal X Theme (not Pro) the problem seemed to resolve itself. However my site is built with Pro (and is set-up to use Pro Child Theme) so I need to use that version of the theme. It seems to me that there are 2 different Google Analytics extensions which may be conflicting with each other (one which is activated by normal X Theme and another when using Pro)?

Hope fully you can assist with this.

Many thanks

R

I have attached screen grabs to show the issue.

Hey @russell3,

Your setup is incorrect. You inserted your analytics code inside the Meta Tag box.

Please remove your code in the Meta Tag box because that is for site verification using the HTML tag option. See https://support.google.com/webmasters/answer/35179?hl=en

Lastly, do not post sensitive information publicly. Using summary will not hide the information from bots. Please use the Secure Note

Thanks.

OK thanks. I will have a go to fix this.

You’re welcome :slight_smile:

Hi

I am still massively confused by this. I know I am probably just being stupid and missing something obvious. The problem I am having is that I have 7 X Theme licenses, some of which are using Pro and others using the original X Theme. The Google Analytics plugin seems rather different in each. However, the error (at top of page – see screen grabs as I have deactivated the analytics plugins) is appearing in both on my sites.

The Google Analytics plugin for the original X Theme is titled ‘X - Google Analytics’ and it appears to be called ‘Google Analytics’ in Pro. Then, when I click on each plugin the screen also looks different with different options. For example, in X Theme there is no box for the "Google Analytics ID’ yet there is in Pro? Also, the ‘ID’ number seems to appear within the code in X Theme but you are recommending to ‘not’ put that within the script tags (except that there is nowhere else to put it in X-Theme, whilst there is in Pro?).

I am hoping I can get this sorted out soon as I have several commercial and client sites that I am not tracking at the moment due to this misunderstanding of how to get Google Analytics to function correctly with X Theme and Pro.

Thanks for your help

P.S. I have attached screen shots with the information blurred out – hope this helps, thanks again

Hi There,

In the version 3.0.0 of Google Analytics plugin. We’ve changed the name from X - Google Analytics to Google Analytics.

Please update all the outdated X - Google Analytics plugins from your website to the latest version.

Regards!

OK I shall try this. It seems to be related to different versions and so on. I will see what I can do anyway. Thanks

Let us know how it goes.

Hi, thanks for your help and hopefully I will get this sorted out quickly now. I have deleted the previous Google Analytics extension/plugin. However, I am still confused as to how exactly the code from Google Analytics is supposed to be inserted. If you can simply send me a link to a tutorial that may help me to work this out.

Is it simply the ID that it now requires? Previously I pasted code from Google Analytics so I am unsure if it is sufficient to only insert the ID.

Hi There,

You just need to copy the Google Analytics ID. When you inspect the code provided by Google analytics, you will see an ID similar to the following format.
UA-xxxxxxxxx-1

You just need to add that code (UA-xxxxxxxxx-1) into your Google Analytics ID input.

Example:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxxxx-1');
</script>

Hope that’s clear.

1 Like

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