Configuring correctly cookieDomain

Hi,

To add some context to the story: I was not part of the team setting up Snowplow.

So we have a website with 3 different subdomains. I pushed to have the the same cookieDomain in order to track cross-subdomain events as part of unique session / unique id.

We have just done that last week, but still doesn’t seem to work as expected…
I realised that our tracker names were not the same from one subdomain to another… Could it be the source of the problem ? Which parameters need to be consistent across all subdomains ?
Thank you so much for your help !

Best,
Mathieu

@mpeychet, if say, you have the following subdomains a.mydomain.com and b.mydomain.com then depending on the tracker version you could set the cookie domain manually or let tracker figure it out:

The goal here is to have your cookie set on the domain .mydomain.com.

Do note the initial disruption to analytics due to change of the cookie domain

WARNING : Changing the cookie domain will reset all existing cookies. As a result, it might be a major one-time disruption to data analytics because all visitors to the website will receive a new domain_userid .

Here’s the tutorial on how to handle this beforehand: Javascript tracker: How to keep track of users when changing the cookie domain? [tutorial]

So we have 3 subdomains:

www.gitlab.com : our app
about.gitlab.com: our landing page
customers.gitlab.com: our customers portal

At the moment, they have the cookieDomain set to “.gitlab.com” though sessions don’t seem to be persistent across subdomains. I QAed it with poplin extension and querying some data…

So I am wondering what the problem could be. The most obvious for me is that we don’t have the same tracker name (one is cf, the other is gitlab the 3rd one is cust) for all of these apps. I am wondering if this would affect the cross subdomain tracking…

The rest of the settings between the subdomains looks fairly similar, we use same collector endpoint…

@mpeychet, I couldn’t locate Snowplow cookie on those sites. It doesn’t look like you store Snowplow domain cookie which would explain the session do not persist. Did you happen to change the default name cookie name from sp to something else or control the cookie creation somehow?

Hey @ihor,

Sorry for the delay!
So, it seems that we are using localStorage as a stateStorageStrategy, would that explain the fact you can’t see cookie and also why we have struggle persisting sessions across subdomains ?

Best,
Mathieu

Hi @mpeychet,

Indeed, the localStorage option at present doesn’t support cross-domain/subdomain retention of values. Is switching to cookies a viable option?

Best,