Any risks with adding a custom cookieName when tracking has been live for some time?

Hi,

I need to add a custom cookieName to my tracker. The tracker has been live for some time. I have tried to find information about any risks doing this. This does not seem to cause any problems when it comes to historic domain_user ids and similar?
Are there any other problems or risks with setting a custom cookieName in a live tracking setup?

Thanks,

Best regards
Ola

Hi @Olzi

Changing the cookieName will cause all your users to reset, this means everyone will get a new domain_userid and all their session information will reset too (domain_sessionid and domain_sessionidx).
To avoid this you’d need to write some custom logic to migrate the cookies over for your users (i.e. read them and rewrite them before the tracker initialises). There’s currently nothing in the tracker that can do this for you.
One other option you have is if you are tracking on a first party domain (i.e. the collector url is on the same parent domain as the website), then the network_userid should remain stable for a user, so you could potentially stitch the updating domain_userid values to their old ones, although session information will still reset.

Beyond the migration issues, theres no other issues that you should face when changing the cookieName.

@Olzi This is getting quite old now but it might give you some inspiration about how to implement the migration logic:

1 Like

Thank you for your answer. It turns out I could avoid renaming the cookieName.

Best regards,
Ola

1 Like