Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookies Banner checking for "previous version of saved cookies" #75

Open
horde45 opened this issue Mar 17, 2024 · 10 comments
Open

Cookies Banner checking for "previous version of saved cookies" #75

horde45 opened this issue Mar 17, 2024 · 10 comments

Comments

@horde45
Copy link

horde45 commented Mar 17, 2024

Hi,

your template works like a charm! I can not thank you enough! However I came across this issue:

Users visiting a website where they gave consent to previous cookies solution before March 2024 are not presented automatically with your cookies banner. I guess that is based on the longevity / lifespan of the cookies consents given to the previous version of the cookies bar. However this leads to a situation that new remarketing storages "ad_user_data" and "ad_personalization" are not gathered thus actions of these "previous" visitors can not be tracked unless they either clear manually the cookies in their browser or those consents from the previous banner expire. This is what ChatGPT called it.. is there some way how you could get around this by further updates of your ingenious template?

Dynamic Consent Management:

Implement a dynamic consent management system that checks the user's stored consent preferences when they revisit the website.
Display an updated cookie consent banner or pop-up that reflects any changes to cookie categories or purposes since the user's last visit.
Provide clear options for users to review and update their consent preferences based on the new cookie settings.

@tg666
Copy link
Contributor

tg666 commented Mar 17, 2024

Hi,
There is a "Revision" field in the template for this purpose. If you increase the revision number, all users will see the cookie bar again.
https://github.com/68publishers/cookie-consent?tab=readme-ov-file#how-to-manage-revisions

@horde45
Copy link
Author

horde45 commented Mar 17, 2024

Thanks for the tip - but somehow it doesnt work for me. I changed the revision number from 0 to 1, published the GTM container and browser did not display your cookie banner again. Is there something else that needs to be changed?

@horde45
Copy link
Author

horde45 commented Mar 19, 2024

now.. Im not a programmer. but I asked Chat GTP if I can somehow impose on the visitors the fact - hey, there is a new cookies bar that you have to agree with.. it came up with the script below.. Is it something that can be incorporated into your template that whoever gave the consent before I implemented your solution - would have to agree with your new cookie banner?

// Check if the consent cookie exists and if it has expired
function checkCookieConsent() {
var consentCookie = getCookie("cookie_consent");
if (consentCookie !== "") {
var expirationDate = new Date("2022-01-01"); // Example expiration date
var currentDate = new Date();
if (currentDate > expirationDate) {
// Consent has expired, show the new cookie consent banner
showNewCookieBanner();
}
} else {
// Cookie consent doesn't exist, show the new cookie consent banner
showNewCookieBanner();
}
}

// Function to get the value of a cookie by name
function getCookie(name) {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].trim();
if (cookie.startsWith(name + '=')) {
return cookie.substring(name.length + 1);
}
}
return "";
}

// Function to display the new cookie consent banner
function showNewCookieBanner() {
// Your code to display the new cookie consent banner goes here
console.log("Show new cookie consent banner");
}

// Call the checkCookieConsent function when the page loads
window.onload = function() {
checkCookieConsent();
};

@tg666
Copy link
Contributor

tg666 commented Mar 19, 2024

Thanks for the tip - but somehow it doesnt work for me. I changed the revision number from 0 to 1, published the GTM container and browser did not display your cookie banner again. Is there something else that needs to be changed?

Didn't you already accept the bar in Preview mode in the GTM?
The revisions really work, I just tried it.

You can check your cookie in the browser to see what revision it has. In Chrome DEV Console > Application > Cookies > [your domain] > cc-settings cookie (by default).
The cookie value should show the revision that was consented to.

Screenshot 2024-03-19 at 9 04 02

@jelen07
Copy link
Contributor

jelen07 commented Mar 19, 2024

Hi, @horde45

Users visiting a website where they gave consent to previous cookies solution before March 2024 are not presented automatically with your cookies banner. I guess that is based on the longevity / lifespan of the cookies consents given to the previous version of the cookies bar. However this leads to a situation that new remarketing storages "ad_user_data" and "ad_personalization" are not gathered thus actions of these "previous" visitors can not be tracked unless they either clear manually the cookies in their browser or those consents from the previous banner expire.

That's something you should answer on your side. There are different views on this from a legal perspective. It also depends what cookies/providers you use, as well as the type of your project (e-commerce, non-profit, etc.).
One such view, for example, is that if you don't have user consent, you shouldn't pretend like you do. If you've made some major changes, such as adding those two new categories you want to "measure", you should prompt the user for a new approval. This is what the revision parameter is for, as @tg666 wrote.
Theoretically, you should also use it if you change the text (in a deeper sense - e.g. new site/app owner) or cookie terms and so on.

However, for some edge cases, the bar allows you to "sync" categories with others. For example, you can set ad_user_data and ad_personalization to sync to agree with ad_storage. The moment you have user consent to ad_storage, you can measure these two as well (reps. will send the correct events to GTM).

@horde45
Copy link
Author

horde45 commented Mar 19, 2024

Thanks for the info above. but as I pointed out changing the revision number does not work for me - the cookies banner simply does not reappear.

@horde45
Copy link
Author

horde45 commented Mar 19, 2024

Thanks for the tip - but somehow it doesnt work for me. I changed the revision number from 0 to 1, published the GTM container and browser did not display your cookie banner again. Is there something else that needs to be changed?

Didn't you already accept the bar in Preview mode in the GTM? The revisions really work, I just tried it.

You can check your cookie in the browser to see what revision it has. In Chrome DEV Console > Application > Cookies > [your domain] > cc-settings cookie (by default). The cookie value should show the revision that was consented to.

Screenshot 2024-03-19 at 9 04 02

It works in GTM preview mode perfectly well - once I publish it the bar does not reappear on the web

@jelen07
Copy link
Contributor

jelen07 commented Mar 19, 2024

I'm afraid we're not able to help you without a link to the site or a sample implementation.

@tg666
Copy link
Contributor

tg666 commented Mar 19, 2024

It works in GTM preview mode perfectly well - once I publish it the bar does not reappear on the web

That's what I was talking about. If you've already given consent in preview mode, it won't show up for you on the site once it's published. Preview mode opens your site normally, so once you give a consent, a new consent with the current revision is stored in the cookie.

@horde45
Copy link
Author

horde45 commented Mar 19, 2024

It works in GTM preview mode perfectly well - once I publish it the bar does not reappear on the web

That's what I was talking about. If you've already given consent in preview mode, it won't show up for you on the site once it's published. Preview mode opens your site normally, so once you give a consent, a new consent with the current revision is stored in the cookie.

maybe im really dumb.. but in my GTM preview mode I put in revision field number 3 - the cookie bar reappeared. I then changed the revision number to 4 (did not try it again in GTM preview mode) and published it. And the bar did not reappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants