sn0ep
sn0ep

Reputation: 3943

google analytics data is not showing up - Tracking not installed

I have a problem with google analytics for web.

I installed the analytics as following just before the closing head tag.

        <script type="text/javascript">
        (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-xxxx23-1', 'auto');
        ga('create', 'UA-xxxx56-2', 'auto');
        ga('send', 'pageview');
    </script>

It is weird because on one UA code (the one that is uncommented) no data is coming through ans the status of the tracking code is "tracker is not installed". While the other property on another account the data is coming in correctly and the status is "Receiving data".

Any idea what this problem might be?

Upvotes: 2

Views: 5620

Answers (2)

Babbandeep Singh
Babbandeep Singh

Reputation: 95

If you are using multiple tracking ID then you have to pass the name field as the fourth argument in the create command.

 ga('create', 'UA-XXXXX-Y', 'auto', 'myTracker');

And then you have to prefix the command name with the tracker name, followed by a dot.

ga('myTracker.send', 'pageview');

finally your code will look like this with double tracker

 (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', 'UA-xxxxxxxx-1', 'auto');
ga('create', 'UA-xxxxxxxx-1', 'auto', 'clientTracker');

ga('send', 'pageview');
ga('clientTracker.send', 'pageview');

Upvotes: 0

sn0ep
sn0ep

Reputation: 3943

Turns out it was a time issue. The settings took around a day to kick in. The weird thing was that no realtime data was coming through. But now it works. If anyone has the same problem, just be patient.

Upvotes: 18

Related Questions