Tracker assinging different duid and sid everytime


I have observed very strange behavior. I am using javascript tracker 2.14. Issue is tracker is assigning different duid and different sid.

According to definition sid should remain same for half an hour and duid is dependent on cookie whose default lifetime is 2 years. So basically they should not change in minutes.

Could you let me know what could be the possible cause of this problem. I would like to mention that this doesn’t happen every time. It happens randomly.

Your help will be highly appreciated.

Amandeep Singh

Hi, I’ve got a couple of questions.

You are generally correct that the DUID and SID shouldn’t change but implementation details could cause them to change. For instance, are your always initialising the tracker with the same name (usually sp)?

Is this from a particular browser? Some browsers have more strict rules on third party cookies set in JavaScript (in particular Safari with ITP 2.3).

Are you testing tracking of yourself or is this production data that is coming in to your pipeline? If it’s production data, how are you identifying the different DUIDs are the same user?

Thanks for replying. Below are the answers to your questions

  1. Tracker is always initialised with the same name “datasleek_sp”.
  2. I have observed this behaviour in chrome as of now. I haven’t tested it in other browser.
  3. I am testing this in development environment as of now. Tracker has not been deployed in production.

One thing i would like to mention that the website where i have deployed the tracking script is running on non-secure protocol (i.e http) but I didn’t assign “cookieSecure” as false. I read the documentation and it is stated

Set the cookie secure attribute for the tracker instance using the cookieSecure field of the argmap. The default is “true”. Valid values are “true” or “false”.It is recommended to set this to “true”. This must be set to “false” if using the tracker on non-secure HTTP.

I have assigned false to cookieSecure. Now duid and sid values are not changing. Now my question is whether it was because of cookieSecure being set equal to true on non-secure http that i was getting different duid and sid values or i am making a wild guess here.

Thanks for your support
Amandeep Singh

Yeah, you’ll need to set cookieSecure to false if you want the JS set cookies to persist on http. Also worth noting that Chrome doesn’t allow cookies on file:// protocols so if you load a file locally, that won’t work as expected either.


Thanks for your support. As i stated it is working after i set cookieSecure to false.I will reply to this thread if i encounter this behaviour again.

Thanks and Regards
Amandeep Singh