Support » Plugin: Google Analytics » Which Code is the right one?

  • Hello,

    we experience problems with Google Analytics and the plugin.

    Google Support told us that the (UA?)Code is not there or not right.

    In our WebSite we can see

    <script>
    jQuery(document).ready(function () {
    jQuery.post(‘https://www.oursite.de?ga_action=googleanalytics_get_script’, {action: ‘googleanalytics_get_script’}, function(response) {
    var F = new Function ( response );
    return( F() );
    });
    });
    </script>

    This probably creates the following code:

    (function() { (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://google-analytics.com/analytics.js’, ‘ga’); ga(‘create’, ‘UA-12345678-1’, ‘auto’); ga(‘send’, ‘pageview’); })();

    …and this is almost the right code for Google Analytics.

    However, it is not as Google recommends it:

    <script>
    (function(i,s,o,g,r,a,m)

    </script>

    Could it be that this is somehow seen as “wrong” by Google?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @bratze49,

    Thanks for reaching out and providing us information.
    We haven’t heard of this and our code is inline with Google’s requirements.
    However, I’ll be sure to let our developer team know and have them look into this issue. Can you please provide us your domain name as well so we can troubleshoot on our end?

    If you have any other questions please let us know, otherwise I’ll be sure to get back to you on this!

    Hey,

    I have checked with “your” way of displaying the code and then changed to the default Google recommendation:
    <script>
    (function(i,s,o,g,r,a,m)

    </script>

    My colleague was talking to Google on the phone and he was told that the code is fine now (the way Google recommends it).

    So I decided to leave it like that. (Sorry for you and your plugin)

    Thanks a lot for the support!

    Hi @bratze49,

    Thanks for getting back to us and I’m glad that the code is all fine now.
    If you have any other questions please let us know 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Which Code is the right one?’ is closed to new replies.