• Resolved janvitos

    (@janvitos)


    Hi,

    First of all, thanks for this great plugin, it’s got nice features.

    I would like to know if it’s possible with a filter to disable the Google Analytics tracking code everywhere?

    I’m using this plugin to connect to Google Analytics and retrieve data, but I’m using my own custom tracking code and would prefer if it stayed that way.

    If it’s not possible, would it be possible to add the option in a future release?

    Maybe there are other people in the same boat as me 🙂

    Thank you!

    Janvitos

    • This topic was modified 9 years, 8 months ago by janvitos.
    • This topic was modified 9 years, 8 months ago by janvitos.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter janvitos

    (@janvitos)

    By the way, I looked through the plugins’s code and noticed debug mode is supposed to disable the tracking code, but when i enabled it, it had no effect and the tracking code was still being output.

    The only way I found to disable it for the time being was to comment out these lines in /google-analytics-for-wordpress/frontend/class-universal.php :

    // Include the tracking view
    // if ( ! $this->debug_mode() ) {
    // 	require( 'views/tracking-universal.php' );
    // }
    • This reply was modified 9 years, 8 months ago by janvitos.
    • This reply was modified 9 years, 8 months ago by janvitos.
    Plugin Author chriscct7

    (@chriscct7)

    Hi there,
    Debug isn’t actually supposed to stop output of the scripts. It’s something yoast added in the current version that isn’t fully implemented. We’ve got an upcoming release that fully implements it.

    In the current version, you’re best bet is to use the ‘yoast-ga-push-array-universal filter and return an empty array. Doing so will still load the analytics.js file but a hit won’t be recorded by MonsterInsights. In the next major release, you could just do remove_action( 'wp_head', 'monsterinsights_tracking_script' );

    -Chris

    Thread Starter janvitos

    (@janvitos)

    Excellent, thank you.

    Hi Janvitos,

    I stumbled upon this topic as I was searching for the best way to Remove/Disable – Google Analytics by MonsterInsights.

    I want to transition to Google Tag Manager.

    Have you got any inputs what is the best / cleanest way to achieve this?

    Or, I do exactly what you did

    Use the plugin to connect to Google Analytics and retrieve data, but I want to use GTM container code for tracking purposes.

    Your thoughts??

    -Rahul

    • This reply was modified 9 years, 5 months ago by rahulmehrotra.
    Plugin Author chriscct7

    (@chriscct7)

    We have a plugin now that we’ve found a way to remove just the outputting of tracking code of MonsterInsights, so you can continue to use just the dashboard if you want.

    Contact us at monsterinsights.com/contact and we can get you a copy of it

    -Chris

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Disable Google Analytics tracking code’ is closed to new replies.