Cross-domain cookie consent sharing

Nelson
Written by NelsonLast updated 11 days ago

Cross-domain cookie consent allows website owners to store cookie consent settings from a single user across multiple domains. If a website uses cross-domain cookie consent sharing and users do not block this option by their browser settings, users could be tracked across domains and subdomains.

CookieScript CMP allows cross-domain cookie consent sharing for top-level domains and subdomain cookie consent sharing.

You can share cross-domain cookie consent across multiple top-level domains. This functionality allows you to select which domains should share cookie consent.

If you don't want to show the cookie banner on all of your websites, add the websites to one group and activate cross-domain cookie consent sharing.

To activate cross-domain cookie consent sharing across multiple top-level domains, perform the following steps:

  1. Go to the CookieScript dashboard and press Cross-domain consent.

  2. Create one cross-domain group. Press Add group, add all websites to the group, and press Save.

  3. Press the Refresh All button to renew the cashed code.

Use Case Example: Hotel Reservation System

Let’s say you manage multiple hotel websites (Hotel A, Hotel B, Hotel C, etc.) and a common reservation website (Reservations).
You want users’ cookie consent decisions to be shared between the hotel websites and the reservation website.

Example behavior:

  • When a user visits Hotel A, they are presented with a cookie banner and accept or reject cookies.

  • When the same user visits Reservations, they should not see the banner again (cookie consent is shared).

  • However, if the user visits Hotel B, they should see the cookie banner again (since Hotel B is a separate consent context).

This can be achieved by enabling cross-domain consent sharing in CookieScript.

Option 1: Using the HTML Attribute

Use this method if you are implementing the CookieScript banner code directly in your website’s <head> section.

Steps:

  1. Go to the CookieScript Dashboard and click Cross-domain consent.

  2. Click Add group and create a cross-domain group.

  3. Add all relevant websites to this group — for example:

    • Hotel A

    • Hotel B

    • Hotel C

    • Reservations

  4. Click Save.

  5. Press Refresh All to renew the cached code.

  6. On all websites that should share consent (Hotel A, Hotel B, Hotel C), you need to:

    • Implement the CookieScript banner code directly in your website’s <head> section.

    • Add the following attribute to the script tag:

      data-cs-ignore-read-crossdomain="true"
      
    • Example full script implementation:

      <script type="text/javascript" charset="UTF-8" 
        src="//cdn.cookie-script.com/s/23f885a14f161dedfb75db3cbbdcff22.js" 
        data-cs-ignore-read-crossdomain="true">
      </script>
      

    ⚠️ Do not add this attribute to the Reservations website.


Option 2: Using the “Ignore” Checkbox in the Dashboard

Use this method if you prefer managing settings directly in the CookieScript dashboard.
This option also supports Google Tag Manager (GTM) implementation.

Steps:

  1. Go to the CookieScript Dashboard and click Cross-domain consent.

  2. Create a group and add all your websites (Hotel A, Hotel B, Hotel C, and Reservations).

  3. Inside the group, for each website, you will see a checkbox labeled “Ignore”.

  4. Check the Ignore box for all websites that should share cookie consent (Hotel A, Hotel B, Hotel C).

    ⚠️ Leave the Ignore box unchecked for the Reservations website.

  5. Click Save.

  6. Press Refresh All to apply the updated configuration.

Implementation note:

When using the Ignore checkbox, you can implement the CookieScript banner either:

  • Directly in the header, or

  • Via Google Tag Manager (GTM) — both methods will work correctly.

This option is easier to maintain and does not require manually modifying your website’s HTML code.

Note: This feature should be used only if you want to share cross-domain cookie consent as described in the above user case with hotels. Do not add the above-mentioned attribute in other cases. If there is no domains to be excluded, do not use the attribute.

This functionality is available only for paid pricing plans.

See also the guide on how to activate consent sharing for subdomains.

Did this article help you solve your issue?