Question. We have two separate applications here -...
# support
c
Question. We have two separate applications here - one is a new launch (new tech stack). One is one x.domain.com and another domain.com. The applications use different user_id’s. I’ve put separate JS SDK’s on both domains. I’m noticing users coming from domain.com ---> x.domain.com are automatically getting the user_id from domain.com. I was hoping to keep these two instances separate and use separate tracking - especially separate user_ids. Any thoughts on how to do this?
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
c
I see this - but not sure how to configure for multiple domains
How can I exlcude x.domain.com but still use domain.com for the other websites
h
in your x. site specify the cookie domain as x.
c
@hundreds-lifeguard-65770 Can you confirm? So it looks like this then?
x.domain.com setCookieDomain: “x.” domain.com setCookieDomain: “domain.com”
h
setCookieDomain: “x.domain.com”
c
What about the other domain? I’m assuming that parent domain will set the cookie across all subdomains? Correct?
When a user goes to domain.com — they will get cookied across all subdomains is my assumption. Including x.domain.com even though I include setCookieDomain: “x.domain.com” on that other domain. Or maybe I’m misunderstood.
h
yes but because you load rudder on x. with setting the cookie domain it should ignore the *. cookie and create new
🙌 1
is the parent site naked or www.
you could use www. on the parent if you serve it as the www sub
c
The parent is naked.
“yes but because you load rudder on x. with setting the cookie domain it should ignore the *. cookie and create new” IF this is the case - then it should work.
fingers crossed
m
Hi Rick as Redsquare pointed out moving to the setCookieDomain should prevent such overlap of Ids between the parent domain and the subdomains
c
@thousands-morning-17197 I implemented this and it does not work. Just an FYI. Any other ideas?
h
hmm I guess they are both in play and the one created first takes precedent, you could rename the cookie first and check for this on the naked domain....will need some jiggery pokery
m
I have posted to the team for their inputs.
Hi Rick Nielsen, I shared this issue with the team and they have mentioned that they will take this up a bug and fix it.
Hi Rick this has been fixed in the latest SDK release. You can use this load option(sameDomainCookiesOnly) to solve this issue.More details here: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk/#loading-options