• Resolved Jay

    (@jayvickeryhill)


    How can you change __gaTracker to ga so it resembles the out-of-the-box GA script?

    <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’,’https://www.google-analytics.com/analytics.js&#8217;,’ga‘);

    ga(‘create’, ‘UA-xxxxxxxx-1’, ‘auto’);
    ga(‘send’, ‘pageview’);

    </script>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author chriscct7

    (@chriscct7)

    Hi there,
    This can’t be changed using any of the setting in MonsterInsights, though, I’m not sure why you’d want to do that. MonsterInsights uses Google Analytic’s built in support for global variable name changes to avoid conflicts. If you’re trying to get a sample Google Analytics include to work, for example, for the custom code box, simple use __gaTracker instead of ga in your code.

    In the upcoming MonsterInsights 6.0 release, Pro users will get a checkbox that aliases our custom variable back to ga (just uses a simple JavaScript alias) in case something you’re using hardcodes the output they have to ga.

    -Chris

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change __gaTracker to ga’ is closed to new replies.