Hi @darkmoonxarx,
His changes are already in effect. It will not delete the previously set cookies though. I will add this in a release this week, so whenever you save, even though you did not refresh the page, we are only keeping the allowed ones.
Awesome! Keep up the good work!
My problem is that I put the facebook pixel and GA in a function wrapper. If the user agrees to cookies, the function is never executed without a refresh meaning that this page visit is never tracked, because the script isn’t loaded yet. Do you see what I mean? For landing pages it is very important that the facebook pixel script becomes active the moment the user agrees to the cookie.
-
This reply was modified 8 years, 2 months ago by
darkmoonxarx.
Hmm… I see your point. I’ll look further into this. I don’t want to refresh the page unnecessarily. Maybe a filter after updating preferences so you can check if you got consent and run it?
Like an Ajax load? I have no idea how to do that. x) But that sounds good too. Would be awesome if your plugin could assist with that.
The new preferences are saved in an ajax load. If I add a filter at the end of that, you could do something like this on your functions.php
add_action( 'gdpr_preferences_updated, 'check_if_can_track' );
function check_if_can_track() {
if ( have_consent( 'tracking' ) && is_allowed_cookie( '_ga' ) ) {
// Manually trigger the tracking event. (there's probably a way).
}
}
Or even force a page refresh if really need to.
That’s just a concept by the way. I would have to build it out and test to see if it would actually work.
That sounds like a good concept.
But maybe just an optional page refresh option is the fastest way to get this feature in and do the fancy ajax script load later. It could even be unchecked by default… A normal blog doesn’t need the refresh, but marketers would like to have their tracking activ asap. I definitely have seen other pages refresh after cookie consent so it wouldn’t be totally unusual.
Looking at your other ticket about newsletters. I agree that even though not reloading feels good, in many cases, a reload is the best solution. Let’s say you hide a newsletter form because you don’t have consent, and instead of the form, you display a text with the button to change their preferences. After saving it would reload and the form would show up.
I’ll definitely make that change soon.
Hi @darkmoonxarx,
We’ve released version 1.1.0 today.
We merged the privacy preference options into one screen.
While I was making the change, I also made so it refreshes the page with an update.
Let me know if you find any bugs with this new version.