Opt out via cookie notice plugin
-
We need to implement a plugin to allow users to opt-in to cookies before plugins such as GADWP applies any cookies. Looking at this plugin: https://www.ads-software.com/plugins/cookie-notice/
I can see from this support page that you have a way of allowing users to opt out by triggering the gaOptout() function when clicking a link/button.
Is there any way we can trigger that programmatically? The Cookie Notice plugin allows me in the Theme to detect whether the user has opted into cookies or not so I can run different scripts. I want to trigger the gaOptout() function using the Theme, e.g. :
if ( function_exists(‘cn_cookies_accepted’) && !cn_cookies_accepted() ) {
// trigger GADWP gaOptout() function as cookies not yet accepted
<script>gaOptout();</script>
}When I try the above I get a ReferenceError “Can’t find variable: gaOptout”. Not sure if it’s because the GADWP scripts are being included later in the <head> than my code is, or some other reason.
Any ideas of how to achieve the above requirement (opt-out of cookies/tracking based on settings in another plugin) would be gratefully received.
Thanks!
Any ideas on how to achieve this?
- The topic ‘Opt out via cookie notice plugin’ is closed to new replies.