My Google Analytics doesn’t work

Asked

Viewed 247 times

0

I have a site on the air and wanted to have the information of how many people have accessed per day and week, so I created a login on google Analytics and registered my site.

Google Analytics generated a code with my ID to put in the head of my site, I put, but I checked and it appears that there is no login on my site.

This is the code:

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

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

I put it on the front page of my website.

But when I check, the google charts look like this: inserir a descrição da imagem aqui

  • How long (days) have you put this code on the site? Google usually needs some time before you start tracking the data

  • 1

    Try placing at the bottom of the page before closing the body, along with the other scripts. That’s the only way it works with me. If it works, I search sources for a more complete answer.

  • 1

    Another detail, in its first script tag, where is GA_TRACKING_ID should be your ID in case, UA-114428382-1

1 answer

1

There may be a number of factors that cause the data not to arrive, for example not reporting the correct id in the googleTagManager API tag script statement, as I see is the case with the code you put here:

<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>

But I’m going to ignore that and assume that this is just an example and that you hid the codes for security reasons.

I could notice that you are pushing information incorrectly, try this format:

window.dataLayer = window.dataLayer || [];

[...]

window.dataLayer.push({
    'info1' : 'xxxx',
    'info2' : 'xxxx'
});

In addition I recommend that you use a tool to analyze data push like the dataSlayer
These tools will help you capture push information even if your registration is still under google approval (as stated by hugocsl in the comments), ensuring that you see this data even if you still can’t pass it to the GTM.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.