How to set cookies on root domain instead of .www?

Hello,

I’ve noticed that several cookies are set on the .www rather than the root domain.

This is an issue on one use case where the user navigates through several subdomains before completing a purchase.

For example:

  • I’m losing the initial _fbp value.
  • The _sbp is only available on the first page and set to .www.example.com (the next pages are subdomain.example.com).

Is there a way to set the _sbp, _fbp, and any other cookies on .example rather than .www.example.com ?

Hello @andreib,

sGTM tags always set cookies on .domain so that they are available on subdomains. I assume you are setting cookies in some custom way (separate tag on sGTM or custom javascript on web). If so - in general this is usually not necessary as the tags themselves do it when triggered.

1 Like