Skip to main content

Saving the Cookie on the Parent Domain

Store the tracking cookie on your parent domain to attribute conversions across subdomains.

By default, the tracking cookie is saved on the current domain where the click script is implemented.

If your user flow spans multiple subdomains (e.g., landing page → checkout), you need to store the cookie on the parent domain to ensure tracking works correctly across all subdomains.


​

When should you use this?

Use this setup if:

  • Your landing page and conversion page are on different subdomains

  • You want to track users across multiple subdomains

Example:

  • Landing page: promo.yourwebsite.com

  • Checkout: checkout.yourwebsite.com

Step 1: Update the click script

Add the cidDomain parameter to your click script. The script stays in the same place: as high as possible in the <head> of every page, including all landing pages:

<!-- Trackdesk tracker begin -->
<script async src="//TENANT_ID.trackdesk.com/main.js"></script>
<script>
(function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");

trackdesk("TENANT_ID", "click", { _meta: { cidDomain: ".yourparentdomain" } });
</script>
<!-- Trackdesk tracker end -->

Replace these values:

  • TENANT_ID: your Tenant ID

  • .yourparentdomain: your root domain

Example:

  • Use .yourwebsite.com for all subdomains of yourwebsite.com

Step 2: Update the conversion script

You must apply the same configuration when creating conversions. The conversion script stays on your thank-you page, right before the closing </body> tag:

<!-- Trackdesk tracker begin -->
<script async src="//TENANT_ID.trackdesk.com/main.js"></script>
<script>
(function(t,d,k){(t[k]=t[k]||[]).push(d);t[d]=t[d]||t[k].f||function(){(t[d].q=t[d].q||[]).push(arguments)}})(window,"trackdesk","TrackdeskObject");

trackdesk("TENANT_ID", "conversion", {
_meta: { cidDomain: ".yourparentdomain" },
"conversionType": "lead"
});
</script>
<!-- Trackdesk tracker end -->

Replace these values:

  • TENANT_ID: your Tenant ID

  • .yourparentdomain: the same root domain you used in Step 1

⚠️ Important:

  • The same cidDomain value must be used in both scripts

  • The value must include a leading dot (e.g., .yourwebsite.com)

  • If not configured correctly, conversions across subdomains may not be tracked

How it works

  • The cookie is stored on the parent domain

  • It becomes accessible across:

    • All subdomains

    • The root domain

The cookie name follows this format:
​ trakdesk_cid_{tenantId}

Summary

  • Default behavior stores cookies per domain

  • Use cidDomain to enable cross-subdomain tracking

  • This ensures conversions are correctly attributed across your entire domain structure

Did this answer your question?