Small discrepancy in the reporting

Noticed that there is a difference between this plugins reporting and GA for WordPress by Joost de Valk wondering if anyone had any idea why this may be happening.

video demonstration of discrepancy:

https://creative.adobe.com/share/d4317039-e007-4554-8037-a83bc1588ec0

thanks!

  • ubernaut
    • Flash Drive

    you are probably just looking at the thumbnail there should be a download button anyway there is difference the multisite GA plug is reporting less visitors then the single site which shouldn’t be possible i wouldn’t think since it’s a sub site of the multisite traffic.

  • Hakan
    • The Incredible Smush

    Hi,

    The reason is quite simple. Both plugins use asynchronous method to send data to GA and 2 asynchronous javascript codes on the same page is not allowed, at least not like this. The results could even be much more different and you cannot trust any of the data there.

    In summary, you should not use such two plugins at the same time.

    Cheers,

    Hakan

  • ubernaut
    • Flash Drive

    if you could dumb it down for me a little bit. i have no way to confirm what you are asserting and the existing data looks correct. is there a better way? the problem is that we need some of the more sophisticated features from the other plugin and have already become accustomed to. Also if if all the data from both plugins is unreliable, then why is the difference so predictable (always about 2 or 3% lower for your plugin)? i now have 3 days of complete data:

    D1: 1103 GA4WP 1068 yours dif 3%

    D2: 1428 GA4WP 1396 yours dif 2%

    D3: 1219 GA4WP 1184 yours dif 3%

    thanks!

  • Hakan
    • The Incredible Smush

    Are you aware that the 2 plugins are doing nothing but simply inserting GA javascript codes on your pages?

    i have no way to confirm what you are asserting

    I made my explanation and I do not ask for your confirmation. This is technical reality.

    If you are so sceptical, don’t use neither of them but simply add GA codes directly on your pages. Why don’t you do that?

    If you don’t believe my explanation, there is nothing to talk here.

  • ubernaut
    • Flash Drive

    i am skeptical because the statistical evidence does not support what you are saying at least as far as i can see.

    also it seems contradictory when you say you say that all these plugins do is add code to the page but then suggest manually doing the exact same thing. if it’s the same thing why would hard coding it make any difference?

    i asked if you could dumb it down rather then causally dismiss my query i didn’t say i don’t believe you. Why is it that this (using 2 codes on the same page) is causing the problem we are seeing here? What explanation would account for such a consistent discrepancy between your plugins reporting and Joost’s? And if that’s the problem how would hard coding the codes make any difference if thats all the plugins are doing?

    Not trying to start an argument.

    Thanks!

  • Hakan
    • The Incredible Smush

    also it seems contradictory when you say you say that all these plugins do is add code to the page but then suggest manually doing the exact same thing. if it’s the same thing why would hard coding it make any difference.

    No contradiction here. When you add GA codes manually you add it just ONCE. When you activate 2 plugins of the same time you are adding GA codes TWICE.

    What explanation would account for such a consistent discrepancy between your plugins reporting and Joost’s?

    Consistent disperancy? With 3 days data? That is your claim. Change load order of the plugins using this plugin:

    http://reveloper.com/wordpress-plugins-order-plugin/

    You will probably get different results. Or some random results. Who knows?

    You are certainly NOT allowed to load js codes twice.

    I repeat: You cannot trust those data when 2 plugins using async js GA code are activated at the same time. You cannot use these 2 plugins at the same time.

  • ubernaut
    • Flash Drive

    when looking at the way the two plugins insert code i have noticed a few differences would any of these account for the difference?

    note the added variables in your code and the second script in the case of Joost’s plugin:

    Joost

    <script type="text/javascript">
    window.google_analytics_uacct = "UA-########-1";
    </script>

    <script type="text/javascript">//<![CDATA[
    // Google Analytics for WordPress by Yoast v4.2.8 | http://yoast.com/wordpress/google-analytics/
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-########-1']);
    _gaq.push(['_trackPageview']);
    (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);
    })();
    //]]></script>

    yours:

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-########-2']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_setAllowHash', false]);
    _gaq.push(['_trackPageview']);
    _gaq.push(['_trackPageLoadTime']);
    (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);
    })();
    </script>

    thanks!

  • ubernaut
    • Flash Drive

    manually embedding the code wouldn’t really help since it would not allow for the site owners to add their own code.

    sorry you seem to think i’m attacking your plug in but just saying “you can’t do that” doesn’t really explain what is a statistically significant data set (only getting more so by the day) here is a fourth data point for you:

    today so far: 739 GA4WP 714 yours dif 3%

    i understand that what we are doing is not officially supported by Google but it does seem to be working other then the difference. my hope was simply to report or get help with a possible bug with your plugin.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.