Analytics
5.3K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Multiple trackers not reporting the same number of pageviews

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Our page uses both a ga.js and and an analytics.js, but they do not report the same pageviews. At times, they have been drastically out of sync (200 in a day on ga.js vs 2000 in a day on analytics.js).

In the head of the page we load the analytics.js script and register it's page view:

<script>
        (function(e,t,n,r,i,s,o){e["GoogleAnalyticsObject"]=i;e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*new Date;s=t.createElement(n),o=t.getElementsByTagName(n)[0];s.async=1;s.src=r;o.parentNode.insertBefore(s,o)})(window,document,"script","//www.google-analytics.com/analytics.js","ga")
        ga('create', '', {'cookieDomain': 'auto', 'siteSpeedSampleRate': 100});
        ga('send', 'pageview');
    </script>

and we also setup the ga.js parameters and queue a page view:

var _gaq = _gaq || [];
                _gaq.push(['_setAccount', '{{ google_analytics_id }}']);
                _gaq.push(['_setCookiePath', '{{ home_page_url }}']);
                _gaq.push(['_setCustomVar', 1, 'User Agent', '{{ ua_profile }}', 3]);
                _gaq.push(['_setCustomVar', 2, 'SpecificId', '{{ specificId }}', 3]);
                _gaq.push(['_trackPageview']);

and then at the bottom of the body, we load the ga.js:

(function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src=('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();


Can anyone tell me why they might be out of sync?

Is the issue because we are mixing ga.js and analytics.js?
Or perhaps some type of traffic is only sending on the analytics.js tracker, but not the ga.js one?

Re: Multiple trackers not reporting the same number of pageviews

A T
Participant ✭ ✭ ✭
# 2
A T
Participant ✭ ✭ ✭
Hi,

Ideally, I would only keep the latest script analytics.js.
Comparison always leads to mismatched numbers. :-)

Best Regards,
GA Guru.

'Star' or 'Accept as Solution' if it helped.