Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • ClickDimensions and Google Universal Analytics Tracking Scripts Conflict

    • 0
    • 6
    • 3
    • 1
    • 0
    • 0
    • 0
    • 0
    • 657
    Comment on it

    These days many people use both Google Analytics tracking code as well as ClickDimensions tracking code. We use it too.

    If you are using latest version of google analytics i.e. "universal analytics tracking code" and "clickdimensions tracking code", In this particular case your Google Analytics will not work. That is happen due to a conflict in clickdimensions tracking code.


    The Google states in their article that their ga variable might conflict with other objects, and we have found that it does. They suggested workaround, described below, that is very simple to implement to prevent this conflict.


    The quickest way to diagnose the issue is to open the JavaScript console of web browser, and type ga into it then press Enter. If you see:

    function ga(c, ga, la)

    It means that ClickDimensions Tracking Script has won the race, and Universal Analytics Tracking Script might not function.

    If you see:

    function N(ar, g, Yd, d)

    It means that Google Universal Analytics governs the global function, and ClickDimensions might not work.

    It seems like there are only two workarounds: remove ClickDimensions or rename the global function name that Universal Analytics uses:

    https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#renaming

    Googles recommendation is as follows:

    There are three instances of ga in this Google Universal Analytics JavaScript code, if you change that variable to something else like '_gaFindNerd' it will work.

    <!-- Google Analytics -->
    <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-XXXX-Y', 'auto');
    ga('send', 'pageview');
    
    </script>
    <!-- End Google Analytics -->
    

    TO

    <!-- Google Analytics -->
    <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','_gaFindNerd');
    
    _gaFindNerd('create', 'UA-XXXX-Y', 'auto');
    _gaFindNerd('send', 'pageview');
    
    </script>
    <!-- End Google Analytics -->
    

    If you use ClickDimensions, be aware that it also uses the ga global name for its operation

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: