• Resolved the_lar

    (@the_lar)


    Hi,

    Just updated to the latest version of this plugin and my service tracker has stopped working on this page – https://www.geotechuk.com/service/service-centre/, I’m getting a ‘ReferenceError: __gaTracker is not defined’.

    What settings do I need to change or how do I update the code to make it work again please?

    Thanks
    Kevin

    The page I need help with: [log in to see the link]

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

    (@chriscct7)

    Hi there,
    Your code is still working the same way it was before. My guess is you are now looking at the console while being logged in as an administrator user.

    MonsterInsights does not track logged in site administrators by default. You should wrap your entire Javascript snippet in a

    if ( __gaTracker.hasOwnProperty( "loaded" ) && __gaTracker.loaded == true ) {

    -Chris

    Thread Starter the_lar

    (@the_lar)

    Hi Chris,

    Yes that seemed to do the trick, is that a recent change?

    On a side note, why is it that I have to use this:

    __gaTracker(‘send’,’event’,’hire me’,’click’,nme);

    rather than something like this:

    ga(‘send’, ‘event’, ‘hire me’, ‘click’, nme, ‘clicked’);

    Never quite understood that?

    Cheers
    Kevin

    Plugin Author chriscct7

    (@chriscct7)

    Hi there,
    No the plugin would have always have needed that. My guess is when you tested your code before you were simply testing it logged out or in an incognito mode, and therefore the GA tag would be loaded.

    __gaTracker is used for compatibility and abstraction purposes. __gaTracker is simply an alias of ga currently.

    -Chris

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘ReferenceError: __gaTracker is not defined’ is closed to new replies.