<script>
var delete_cookie = function(name) {
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
};
delete_cookie('cookieDeclined');
</script>
- +49 561 9963 9601
- hello@eboosting.net
- Resources
Fachbeitrag: Split Testing Tipps
Fachbeitrag: Split Testing Tipps
This snippet will check for the presence of the ‚cookieDeclined‘ cookie, which defines if a user declined the cookie tracking.
As a result, the user will be asked every time he visits the page. Until he accepts the cookie tracking.
Be careful – this is a quick&dirty solution and it is not the polite way to treat your visitors.
<script>
var delete_cookie = function(name) {
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
};
delete_cookie('cookieDeclined');
</script>
WHERE TO PLACE THIS CODE?
Just put the snippet where you want to check for the cookie – most of the time, a business will use it only on a specific page, like their homepage.
You can also use Google Tag Manager (or any tag manager) to set a rule and fire it where you need it.
Please share your thumbsup, suggestions, edits, and questions within my comment section down there.
I love posting snippets for you, but with a bit of feedback, it gets even more fun. 😀
Jeder mag Cookies! Du kannst alle Cookies akzeptieren oder in den Cookie Settings auswählen, welche genutzt werden dürfen.
Name | Domain | Zweck | Ablauf | Art |
---|---|---|---|---|
wpl_user_preference | eboosting.net | WP GDPR Cookie Consent Preferences | 1 year | HTTP |
Name | Domain | Zweck | Ablauf | Art |
---|---|---|---|---|
_ga | eboosting.net | Google Universal Analytics long-time unique user tracking identifier. | 2 years | HTTP |
_gid | eboosting.net | Google Universal Analytics short-time unique user tracking identifier. | 1 day | HTTP |
_gat_UA-60203069-1 | eboosting.net | Google Analytics tracking cookie. | Session | HTTP |
Analytics | eboosting.net | Analytics Tracking | 1 year | HTTP |