Google Analytics does not show results in real time

The following script does not generate cross-validation activity in the Google Analytics section: Real-Time : Content -

 <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','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-475021xx-x', 'auto'); ga('send', 'pageview'); </script> 

where xx-x masks the real account code.

the script is placed immediately before </head>

We upgraded our account to Universal Analytics . Google tells us that this is a script to use; directly copied and pasted here (with masked account code).

On the Google Analytics page, the test page loads as ACTIVE PAGE . I click the links on the test page to call ga .

Is there a mistake in this script? For example, I see in other Stackoverflow posts that 'auto' is being replaced with the real domain . But I do not see Google instructions to make this replacement.

Am I doing something else wrong?

+6
source share
5 answers

You can check the performance of your tag using the Google Tag Helper, and also check with the developer tools if you can see the data sent to your GA account. Also see in your account under Property> Tracking Information> Tracking Code for the status of your tracking code. But if you do not see the data in real time, then something may be wrong.

The third parameter in the create method creates a cookie domain. It is optional and with "auto", it sets the cookie domain to the highest level of the domain. Without it, the cookie domain will be configured to the website domain without www. Console.

+3
source

Then I did the same as you.

Mine began to show data approximately 12-24 hours after entering the Google Analytics code.

I suggest waiting another day and then checking if the data appears.


Given that this answer can only be checked until we wait a certain amount of time, be sure to set it as the correct answer until then.

+4
source

For me, the question was the dunce movement. I have Google Analytics Departures for Chrome turned on.

I needed to go to chrome: // extensions /, scroll down to the extension โ€œReject Google Analytics add-on (from Google)โ€ and uncheck the box that says โ€œEnableโ€.

I hope this helps someone.

+4
source

Here is my problem. I am using google analytics with wordpress. I tried setting up Google Analytics for my site using a plugin called Google Analytics Dashboard for WP (GADWP). This plugin generated a piece of Google analytics that looks similar to the one described in the question:

 <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','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-475021xx-x', 'auto'); ga('send', 'pageview'); </script> 

However, in the Google Analytics console, the proposed snippet looked like this:

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

Gtag.js seems to be the new Google Analytics snippet format. So I disabled this wordpress plugin, and I manually added the script suggested by Google Analytics to the page.

+1
source

I recently fixed the same issue. Please log in to your admin panel and check the filters.

I made sure my correct hostname filter was correct.

If you copied a custom dashboard from another project or an error occurred in the filter, it is worth the time to check.

I put the value of "domain.com" in the included hostname filter.

Let me know if this solved the problem for you.

0
source

Source: https://habr.com/ru/post/974859/


All Articles