0

I have the following Google Analytics code installed on my website:

<script>
              (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
              (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
              m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
              })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

              ga('create', 'G-W4975LDMYY', 'auto');
              ga('send', 'pageview');
            </script>

The G-W4975LDMYY matches this in Google Analytics:

enter image description here

Maybe it's supposed to be matching something else?

2
  • Did you check if the code was installed properly?
    – Ray Price
    Dec 5, 2021 at 3:10
  • @RayPrice - seems to be - phpseclib.com
    – neubert
    Dec 5, 2021 at 4:23

1 Answer 1

3

If the <script> you posted is how you have it installed, that doesn't match the <script> in your screenshot that Google tells you to install. My guess is that you are taking the G-XXXXXXX id out of the page from Google and pasting it into a plugin that adds the code for you.

It looks like the way you have it installed is for Universal Analytics but you signed up for Google Analytics 4. You need to either:

  • Create a universal analytics property and get a UA-XXXXXX id.
  • Install the tracking snippet for GA4 like Google is suggesting.
  • Do both. (GA4 doesn't have all the features of UA, so many webmasters are running both simultaneously.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.