Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1359428
    miribetancourt
    Participant

    Hi Themeco,

    in Germany, you have to give users the chance to opt out cookies. Therefore, I have to make some changes.

    To get everything working I have to add the following javascript just in front of the tracking code of GoogleAnalytics:

    <script>
    var gaProperty = ‘UA-XXXXXXX-X’;
    var disableStr = ‘ga-disable-‘ + gaProperty;
    if (document.cookie.indexOf(disableStr + ‘=true’) > -1) {
    window[disableStr] = true;
    }
    function gaOptout() {
    document.cookie = disableStr + ‘=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/’;
    window[disableStr] = true;
    }
    </script>

    Do I have to insert the code at the plugin (x-google-analytics)?
    If yes, in which folder?
    If no, where can I make the changes?

    And what is the correct position?

    I am fairly new at working with code so that I have very basic questions.

    Thanks for your help.

    Cheers, Miriam

    #1359446
    miribetancourt
    Participant

    Hi,

    and one additional question: In Germany, you have to make some anonymizing changes in the standard code of google analytics. Therefore, I have to add (‘set’, ‘anonymizeIp’, true); in the Google Analytics Code. Can I do that in the plug in oder somewhere else? In the child theme?

    Thanks for you help?

    Cheers, Miriam

    #1359451
    Christian
    Moderator

    Hey Miriam,

    You can put your code in the X Google Analytics extension. Please see https://community.theme.co/kb/extension-google-analytics/ for usage instructions.

    Regarding Google Analytics settings, you need to contact Google Analytics support as the extension basically accepts code and has no further setting except the code position.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1359428 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>