Support » Plugin: GA Google Analytics » User Opt-out

  • Resolved kernix


    A few Google Analytics questions. Note: I have the MonsterInsights plugin for GA but someone recently let me know about GA Google Analytics plugin. I have installed that plugin but not activated it.

    I viewed the page source on my last post to make sure my GA tracking code was in there. This is what I’m seeing: “var disableStr = ‘ga-disable-UA-…

    Then below that: “return document.cookie.indexOf(disableStr + ‘=true’) > -1;

    I did a search on “ga-disable” and found a page by Google titled “User Opt-Out” where it mentions setting the property to FALSE will have analytics work as usual. Mine is set to TRUE.

    1st question: Does anyone know how to change the True to False? Is it in the Admin section of Analytics?

    2nd question: Should I remove the MonsterInsights plugin before activating the GA Google Analytics plugin?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeff Starr


    It would help if you provided a link to the Google documentation you are talking about. Also would be useful to see the entire tracking code that you want to display (make sure to obfuscate your tracking ID). That would enable a closer look and hopefully answers to your questions.

    Here is the google doc. I disabled MonsterInsights and activated the GA plugin. So what part of the analytics code do you want? It was a different code that I saw in my posts. For some reason when I pasted in the code into my header.php file, the old code was slightly different. I don’t know if Monster did that or the when I recently updated to Gutenberg

    Here is the current code:

    <!– Global site tag (gtag.js) – Google Analytics –>
    <script async src=”″></script&gt;
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘UA-xxxxxxxxx-x’);

    By the way, I chose the gtag option in the plugin settings.And I just checked in the source code for “ga-disable” and it’s gone. I assume disabling MonsterInsights removed it and\or activating the GA Analytics plugin.

    Plugin Author Jeff Starr


    Thanks. So the code that you provide above is added automatically by GA Google Analytics plugin; just choose Global Site Tag as the tracking method and no other changes are required. The correct/default tracking code will be added to your web pages.

    Also just FYI:

    1) The link you provide for the user “Opt Out” is for Universal Analytics
    2) The tracking code you provide is for Global Site Tag

    So I am not sure which modifications need made to enable Opt Out for Global Site Tag tracking. If you can let me know the actual code that you want to display, I will be able to tell you if it is possible, and if so how to achieve it.

    Thanks for the response. Someone suggested the GA plugin after I posted the problem with the tracking. That tracking code that I reference at the beginning of this post is gone so it must have been the MonsterInsights plugin. Although, it may have been the GA plugin coupled with the MonsterInsights deactivation.

    1. I did choose Global Site tag as the tracking method after I saw the gtag in the code.
    2. it was the ga-disable thing that I was seeing in my source code but that is gone so no problem now.
    3. Thoughts on removing MonsterInsights? I think I should delete it – do you agree?

    Plugin Author Jeff Starr


    Awesome, glad to hear you got it all sorted.

    For the other plugin, I can’t really comment as I am not familiar with it. In general, you can remove any plugin that is not required. So maybe compare the features or whatever and see which or both plugin may be necessary.

    I’ll delete it. So should I start to see tracking for my pages & posts now in my Google Analytics dashboard? Is that the main purpose of the plugin?

    Plugin Author Jeff Starr


    Yes exactly. The main thing this plugin does is add the required GA tracking code to your web pages. Then once the code is added, it takes anywhere from 24-48 hours before actual data is collected and available in your GA account.

    Fantastic. I think the disable in the code has lost me a lot of data, hopefully, now I’ll see what is going on. Thanks again.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘User Opt-out’ is closed to new replies.