Using the Linker for cross-domain consent

The Linker feature in CookieHub allows user consent information to be shared across different top-level domains using query string parameters. This ensures that users do not have to provide consent again when navigating between related sites.


When to use the Linker feature

Use the Linker feature if:

  • Your website operates on different top-level domains (e.g., example.com and example.org ).
  • You want to maintain a consistent consent experience without asking the user multiple times.

Note:

The Linker feature is not needed for subdomains (e.g., shop.example.com and blog.example.com ) because CookieHub already shares consent within the same top-level domain.


How the Linker works

When a user clicks a link to a domain listed in the linker settings:

  • CookieHub reads the user’s consent information.
  • It appends the consent details as a query string parameter to the destination URL.
  • The receiving domain can then apply the user’s consent preferences without prompting again.

Important:

As of CookieHub 2.6.2, the Linker feature only forwards user consent if all categories have been allowed.


Wildcard support

Since CookieHub 2.8.11 you can use the wildcard (* ) character to match domains instead of listing each one individually. This is useful if you have multiple related domains or dynamic domain patterns.

Examples:

  • *cookiehub.com will match any domain ending with cookiehub.com (e.g., www.cookiehub.com , dash.cookiehub.com ).
  • *cookiehub* will match any domain containing cookiehub (e.g., cookiehub.net , mycookiehubdemo.org , dash.cookiehub.com ).

Ways to enable the Linker feature

1. Through Google Tag Manager

If you are using the CookieHub GTM community template:

  1. Open the CookieHub CMP tag in GTM.
  2. Find the Linker field in the tag configuration.
  3. Enter a comma-separated list of top-level domains for which consent should be shared.

2. By editing the CookieHub script

If you added CookieHub manually, update your script with the linker property in the cpm variable.

Example:

<script src="https://cdn.cookiehub.eu/c2/9f2842b1.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
    var cpm = {
        linker: ["dash.cookiehub.com"]
    };
    window.cookiehub.load(cpm);
});
</script>

In this example, consent information is forwarded to dash.cookiehub.com when users click links pointing to that domain.