• Resolved triplecomp

    (@triplecomp)


    Hi,

    How do we stop data from being tracked before the user even clicks accept?
    For example the moment they land on the page analytics start tracking them. Ads have already fired etc

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • @mic85b

    I’m sorry but that is not useful at all. The code itself is not useful at all, because it will not work on every website. I have tried a lot of times to adjust the code. Now after almost 2weeks i have the correct code. And its ok to have an example of GA, but other cookies are twice as hard to find the correct code to disable them.

    @triplecomp
    If you do not want the cookie to work before accepting the privacy bar you should try the following that i am using(i am using google analytics as example in this one:

    function my_google_opt_out() {
        if ( is_allowed_cookie( '_ga' ) ) {
        ?>
        <script>
    		window['ga-disable-UA-xxxx-xx'] = false;
    	</script>
    	
    	<?php
      }
    	else{
    ?>
    	<script>
    		window['ga-disable-UA-xxxx-x'] = true;
    	</script>
    <?php
    }
    }

    This means, if the cookie is allowed, the cookie GA disable is FALSE, so will be active.
    If the cookie is not allowed(else) and you have the category with the cookie you want standard on OFF, then the cookie is not allowed and it will activate the else. The GA disabled will be set to true and so, it will be disabled.

    p.s. dont forget to replace the XXXX by your GA ID, ofcourse for other cookie this is not needed. Also make sure that you search the cookies, and insert them inside the category like following: _ga,_gid,_PHPSESSID,_ss . So with comma’s between but no spaces.

    This worked for me, if it doesnt for you, you should adjust the code a bit to your website.
    Goodluck!

    • This reply was modified 6 years, 6 months ago by Willem Munts.
    • This reply was modified 6 years, 6 months ago by Willem Munts.
    Thread Starter triplecomp

    (@triplecomp)

    Thank you for that.

    Question: so would getting the names of all cookies fired on a website via the console (inspect element) and then putting those cookies into the plugin settings separated by a coma do anything?

    I mean does this plugin actually stop any cookies from firing without extra code at all?

    Many thanks

    Plugin Author Fernando Claussen

    (@fclaussen)

    Sadly I could not find a way to block them without extra code.

    Thread Starter triplecomp

    (@triplecomp)

    Ok, so for example we have things like google analytics, cloudflare, Facebook pixel, DFP ad tags etc

    What code would you use to help stop those from firing before consent was given?

    Plugin Author Fernando Claussen

    (@fclaussen)

    first you need to find the code that is creating the cookie.
    Example: Google analytics would be that snippet of code they provide.

    Then you wrap it with one of the provided helper functions.

    Example:

    if( is_allowed_cookie('_ga') ) {
      // cookie allowed, add code here
    }

    Same thing for others.

    This can be boring and hard to do. If you need assistance, I suggest you contact your developer or send us an email at [email protected] and one of our representatives will provide you with a quote.

    @triplecomp

    It would be almost impossible for the author to create an extra code for every cookie that exists and the new cookies to come. So indeed it is the easiest way for us to do research for every cookie we use and figure out how to enable/disable it.

    Also, the people do this GDPR stuff when it is almost the time to be ready, officially 25may 2018. But the most are still figuring out how to enable/disable cookies. It will be hard, because the forums are not yet full with answers.

    • This reply was modified 6 years, 5 months ago by Willem Munts.

    Can I ask: Do we really have to put the code, as in the example of the _GA cookie, in the Functions.php or could it be added in the Header or elsewhere? I ask this because everytime there is a Theme Update, the Functions.php is going to be over-written isn’t it?

    • This reply was modified 6 years, 2 months ago by Notfunny01.
    Plugin Author Fernando Claussen

    (@fclaussen)

    It is only going to overwritten if you are not using a child theme. Which you should.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to stop data being tracked before user has accpeted’ is closed to new replies.