Viewing 7 replies - 1 through 7 (of 7 total)
  • Same issue here. Regardless of preferences indicated on the banner, the cookies remain on page reload.

    This is a frequent question; the plugin does not control what cookies are or are not set, but merely gives the website user an interface to specify their preferences, and it gives developers a means to test if a cookie should or shouldn’t be set. It takes theme and plugin development to complete the needed functionality.

    On a related note, it certainly seems the plugin could be made to actually delete cookies that should not be allowed, and that would be a welcome enhancement.

    https://github.com/trewknowledge/GDPR/issues/206

    Plugin Author Fernando Claussen

    (@fclaussen)

    The plugin should be deleting them.

    Go here for testing: https://gdpr-wp.com/privacy-policy/

    Scroll down to the very bottom.

    If you allow everything you should see the _ga and _gid cookies.

    If you click on Privacy Preferences and remove them, they should disappear.

    > The plugin should be deleting them.

    Curious, from reading multiple support issues and also my own testing, I thought that was not the case.

    I tested at the gdpr-wp page you linked, and I do see 3 cookies (_ga, _gid and _gat) come and go correctly with the Privacy Preferences setting. (Fwiw, a 4th cookie _gat_gtag_UA_6405973_47 remains set.) I’m working to achieve similar/the same by adding code to my theme, starting with https://www.ads-software.com/support/topic/blocking-google-analytics-3/ – but you’re saying the plugin itself does this on your site, you didn’t have to add any code to your theme to make it work?

    FWIW, you’re using google tag manager, and I’m using google analytics directly, I don’t know if that makes a difference. Ie. maybe when setting ga-diable-UA-### with tag manager, it deletes those cookies itself?

    • This reply was modified 6 years, 4 months ago by jnorell.

    More on this topic, I see the code is there to delete some cookies in php (I’ve not seen the same in javascript, offhand).

    It’s worth noting that the removal is only for cookies explicitly defined in the gdpr settings, so the logic is, “loop through all configured (in gdpr settings) cookies and for all of those which the client has set, unset any which do not have consent” – it is not, “loop through all cookies the client has set and remove any which do not have consent.” The latter has more potential for self-inflicted damage, but is also more comprehensive/fail-safe – maybe throw in an option to change that behavior? Seems like it should be pretty simple.

    On another note, none of the cookie handling seems to work at all for me at the moment (see https://www.ads-software.com/support/topic/toggle-on-off-doesnt-work/), which results in a side-effect of this “no cookies are deleted” issue. Possibly (likely?) others have the same problem.

    casperlittlegosth17

    (@casperlittlegosth17)

    have you found solution ?
    i can’t blocked _ga cookies ?? this plugin don’t work

    Current status: no recent changes published, cookie deleting/handling is still not working for me (apparently it works for some, so probably depends on your environment), though turning off the ‘Refresh page after updating preferences’ setting improved the behavior.

    For _ga specifically see https://gdpr-wp.com/knowledge-base/enabling-or-disabling-functionality-based-on-consent-and-cookies/ That does work correctly because the cookie isn’t handled by the gdpr plugin, but it uses ga-disable-{UA} to disable it. This is what I have in use based on that; you may need to remove the namespace if you use it right in functions.php (though I haven’t tried offhand):

    /**
     * Disable Google Analytics Tracking if consent is not given (GDPR)
     */
    function gdpr_disable_google_analytics_tracking()
    {
        $ga_property = 'UA-123456789-1';
    
        ?>
            <script type="text/javascript">
                window['ga-disable-<?=$ga_property?>'] = true;
            </script>
        <?php
    }
    
    if ( function_exists( 'is_allowed_cookie' ) && ! is_allowed_cookie( '_ga' ) ):
        add_action( 'wp_footer', __NAMESPACE__ . '\\gdpr_disable_google_analytics_tracking', 100 );
    endif;
    
    • This reply was modified 6 years, 1 month ago by jnorell.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘how can I check if the plugin works properly?’ is closed to new replies.