Viewing 6 replies - 1 through 6 (of 6 total)
  • tedmaster

    (@tedmaster)

    +1 Also, this options wasn’t even visible until I changed some options in the Tracking tab.

    Plugin Author chriscct7

    (@chriscct7)

    The analytics vs ga option doesn’t show unless you either are on ga.js or have enabled debug mode in the options panel. GA.js is deprecated and is no longer supported by MonsterInsights, so we don’t show the option unless you are currently on GA.js as we don’t want people moving from the new analytics.js to the old ga.js.

    If you’re not able to switch over (which should be as simple as clicking on the “click here”, please get in touch with us at monsterinsights.com/contact via the presale form and we’ll get you sorted out

    -Chris

    tedmaster

    (@tedmaster)

    I see. It seems I had the Debug checkbox ticked and that’s what was making that warning display and never go away.

    But now that I’ve got your attention… We’re trying to integrate Contact Form 7, Google Analytics, and MonsterInsights, but we’ve also got Yoast installed.

    Specifically, we’re trying to trigger an event (a goal) when a CF7 form is successfully submitted. The instructions for setting this up in CF7 are listed here:

    https://contactform7.com/tracking-form-submissions-with-google-analytics/

    We’ve got the goal set up in GA but when we load the page in question, we’re seeing a “ReferenceError: event is not defined” in frontend.min.js. A couple of days ago this was due to what appeared to be a syntax error in the non-minified version. That’s been fixed but we’re still seeing this error. The code we’re using to try and trigger the tracking of the event is:

    
    if (typeof(__gaTracker) !== 'undefined') {
        __gaTracker(function() {
            window.ga = __gaTracker;
        });
    }
    document.addEventListener('wpcf7mailsent', function(event) {
        __gaTracker('send', 'event', 'bankingsmart', 'signup', 'signup');
        window.location.href = 'http://bankingsmart.me/thank-you/';
    }, false);
    

    There are probably a few things wrong with the code above so feel free to make that clear… We suspect that part of the problem is that we ought to specify hitCallback as a parameter in the ga call, but we’re just not sure if __gaTracker is an exact clone of ga or not and if it is, can we trust the GA documentation on how to do this?

    Any input is greatly appreciated.

    tedmaster

    (@tedmaster)

    FWIW, I changed __gaTracker to just ‘ga’ and added the window.location.href redirect as a callback function on ‘ga’. This seems to have made things better (goals are registering now).

    Hardeep Asrani

    (@hardeepasrani)

    Hey @tedmaster,

    As per Forum guidelines, please start a new thread for your question instead of taking over someone’s thread, as it creates confusion and mixes up the things.

    You can start a new thread from here: https://wordpress.org/support/plugin/google-analytics-for-wordpress/

    All the best! 🙂

    Thread Starter Garrett Hyder

    (@garrett-eclipse)

    Thanks @chriscct7,

    It was the fact I had debug checked that the message stayed and the click here seemed to be broken. So that’s good disabling debug fixed it.

    I’d still like this reported as a bug in your system though as you’d expect functions to operate in debug as they do normally just providing further logging. As it stands the warning seems broken and there’s no indication that it’s stuck due to debug.

    Appreciated,
    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can’t get rid of warning ‘You’re currently using deprecated ga.js tracking.’’ is closed to new replies.