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

Cross-domain Consent #79

Open
BKKNomad opened this issue May 6, 2024 · 6 comments
Open

Cross-domain Consent #79

BKKNomad opened this issue May 6, 2024 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@BKKNomad
Copy link

BKKNomad commented May 6, 2024

Hello, many thanks for this great solution which works really well. However, it seems that it's not possible to set up cross-domain consent to avoid having the Cookie Consent banner showing again when we switch from a domain to another, or a subdomain to another one.

Do you have any solution to set up cross-domain Cookie Consent with this solution?

Many thanks in advance for your support.

@tg666
Copy link
Contributor

tg666 commented May 10, 2024

Hi,
Cross-domain consent is unfortunately not possible. However, cross-subdomain is.

The "Cookie domain" field in the GTM template is used for this.
If the domain of your site is example.com, then set the cookie domain to .example.com (with a leading dot).

Consent will then be valid on all subdomains, for example www.example.com, foo.example.com.

@jelen07
Copy link
Contributor

jelen07 commented May 10, 2024

Hi, but be careful when setting up those domains. I don't recommend testing it in production mode.

The functionality around cookies itself is very outdated. If you set up two domains, for example .example.com and then www.example.com or example.com, and in the meantime the user clicks the bar, it will set two cc-settings cookies for two different domains. Unfortunately, due to how outdated cookie technology is, it is not possible to get the right cookie on a particular domain.
This can lead to a situation where the user will still click the bar, but it will still be displayed. Unfortunately the original plugin suffers from this as well and practically has no solution, at least as far as we know.

We can mention it in the readme (@tg666). It might be useful to have it mentioned in the original plugin as well. orestbida/cookieconsent#683

To support cross-domain across different domains (example.com, myexampleapp.com, ...) you would need some backend solution to store the consents, e.g. 68publishers/consent-management-platform.

For example, we currently use the bar from the web app in mobile apps, which allows us to sync across devices.

@jelen07
Copy link
Contributor

jelen07 commented Oct 2, 2024

Hi @BKKNomad,

was it resolved?

@ayushpatel2703
Copy link

so finally we can do cross domain tracking or not?

@jelen07
Copy link
Contributor

jelen07 commented Nov 19, 2024

As mentioned earlier:

  • cross-domain no
  • cross-subdomain yes

For supporting cross-domain you will need a back-end solution to store consents.

@BKKNomad
Copy link
Author

Yes many thanks for your great support @jelen07, we were able to set up cross-subdomain cookie consent.

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

No branches or pull requests

4 participants