JS Tracker - Set Domain User ID

Hi All,

I can’t see a way to set the domain user ID in the Javascript tracker?

Currently we generate an HTTP cookie that we use to override the default client ID in Google Analytics and would like to have the same ability in Snowplow. This gets around ITP deleting JS cookies.

Also, we would prefer to use our own anonymous user ID as standard across different tooling.

Are there any thought on how this can be achieved?


There’s no way to override the Domain User ID in the JS Tracker. Additionally, the Snowplow Collector will return a first party (ITP resiliant) cookie too, which sets the Network User ID.

I think you probably have two options here:

  1. Set the User ID with setUserId function in the JS Tracker. This works if you have access to the cookie value in JS. It’ll set the userId column on each event.
  2. Use the cookie extractor enrichment to read your cookie in the pipeline - Cookie extractor enrichment | Snowplow Documentation
1 Like

It’s kind of a philosophical difference with some other tools. Tools like GA and Tealium have a One ID To Rule Them All approach which smooshes all behaviour together once you’ve merged IDs.

Snowplow is more a Pokemon approach: gotta catch 'em all. We keep them all and on the data consumption side you can determine how to resolve them, which ones take priority. You may end up using different ones in different circumstances.

If you don’t care about the domain_userid you can just ignore it and use your own ID sent in as @PaulBoocock described, or in a custom context of your own creation if you like. It’ll still be there and maybe some day it’ll be useful for some use case, even just validating the ITP resilience of your chosen ID.

Thanks Paul, We opted for using the User ID to store a customer key.

I did manage to find a reference to tnuid in the tracker protocol reference that overrides the network ID. It doesn’t appear this override is supported with the Javascript trackers though. What is the best way to get this added as a request?

Hi @Rob_Ellison, the best way to do this would be to raise a feature request on the tracker repo itself Issues · snowplow/snowplow-javascript-tracker · GitHub