Hi all, Wondering if anyone can help with the foll...
# support
b
Hi all, Wondering if anyone can help with the following issue. We have implemented Rudderstack across a website and webapp, with the website having a url like
www.example.com
and the app having a url like
app.example.com
. However when a user visits the website for the very first time they get assigned a certain anonymous_id, and when they click the link to go to the webapp, their anonymous_id changes. This is making it near impossible for us to measure the effectiveness of marketing sources and landing pages. Also interesting that when a user later goes back from the webapp to the website, the anonymous_id no longer changes, so doesn't seem to be any issue with the fact that it is across subdomains. Reading this from your documentation, this shouldn't happen
By default, the SDK stores all cookies in the top-level domain. It helps you to identify the users visiting websites hosted under a particular sub-domain. For example, if you include the JavaScript SDK in both
admin.samplewebsite.com
and
app.samplewebsite.com
, the SDK will store the cookie in
samplewebsite.com
.
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.
b
@lemon-balloon-16076 fyi
l
Thanks @big-art-65238 @shy-kite-21035 can you take a look?
h
Hello @big-art-65238! Yes, this is not the expected behavior of the SDK. Although, here are a few reasons why this could happen: •
setCookieDomain
load option in the web app's RS SDK instrumentation is set to a different domain name. By default, the SDK uses the website's TLD. •
reset
API of the SDK is called in your webapp when a user navigates from the website. • Query string API with a custom anonymous ID is used to trigger events on the webapp load. • Anonymous ID is overridden by calling the
setAnonymousId
API somewhere in your web app's instrumentation. Could you please confirm that you're not doing any of the above things in your instrumentation?
b
@helpful-daybreak-79835 checking on these! Just wanted to also double check, we have 2 different sources setup (1 for website & 1 webapp), with 2 different writeKeys, this shouldn't be a factor though right?
h
Yeah, different write keys will not be a problem
b
@helpful-daybreak-79835 I have checked and I can we are not doing any of the 4 you mentioned.
After looking into the cookies I found that it seems like we are having multiple rl_anonymous_id being created one at the www domain and one at the route
.
domain. See the screenshot below
We are using Osano as a cookie constent manager. Could that somehow be interfering and setting another cookie on the www. domian level?
h
Consent manager interfering with RS SDK cookies is unlikely. Can you share the website and web app URLs for me to investigate further? Also, what's the version of the SDK you are using and the installation type (CDN / NPM)?
b
@helpful-daybreak-79835 replied to these in a direct message šŸ‘
šŸ‘ 1
h
@big-art-65238, I've gone through both the sites you've shared but cannot reproduce the issue. Even tried on incognito mode in Chrome. Is the issue happening intermittently? Could you please share the exact steps for me to reproduce? Also, I've noticed you're running an older version (v2.36.0) of the SDK. Please upgrade to the latest version (v2.40.4).
b
@helpful-daybreak-79835 sent you a direct message with the steps to reproduce
@helpful-daybreak-79835 regarding the updating the SDK is the old version running on the www. or the app? On the website we have just pasted the javascript snippet that we get from the Rudderstack dashboard, and I don't see any SDK version in the code?
h
@big-art-65238 the app loads a self-hosted version of our SDK (DM'd the details) which is v2.36.0 (The version is a query parameter in the source config request the SDK makes)
b
Just following up here. @helpful-daybreak-79835 managed to crack the case šŸ•µļøā€ā™‚ļø
Hi Jan
Your hunch was correct. Osana consent manager meddles with
document.cookie
functionality on the browser and gates the cookies to be set on a domain.
I don't know how this is configured in Osana, but even if you set the cookie domain name in load options, the issue might still remain.
Can you please check Osana?
In case anyone else faces a similar issue using a cookie consent manager
šŸ™Œ 1