Hi @Shing_Poon, welcome to Discourse!
When using your own domain as a CNAME for the collector, you are correct that the cookie which represents network_userid
will be set against this domain. network_userid
is designed to give you first party cookies on a specific domain, and is not really designed to enable cross site user tracking in a first party manner (which is pretty much going to become impossible given the direction browsers are moving).
There are a couple of options for you here:
-
The simple option, is to run your collector on a third party domain and understand that you’ll have third party cookies so exact user counts from some browsers (Safari mainly) will be unreliable. The cookie should be set to SameSite=None; Secure in the collector configuration, so when Chrome rolls out the SameSite changes then this continues to work for Chrome (and Edge).
-
Run your collector on multiple CNAMEs, as you are doing, to get accurate first party network_userid so you can do accurate user counts on those domains. Use other userid fields to build a identity stitching table as a data modelling step, that can help you build a more accurate picture of users across the domains based on the variety of userids Snowplow can track (even better if you have, and track, your own user information for authenticated users in custom entities). See here for more ideas on this concept: Identifying users (identity stitching)
-
My favourite option is to move to a model that is going to be more robust with the direction the browsers are moving, allow users to maintain their individual privacy and start thinking of users in Cohorts rather than trying to identify specific users. i.e. group users with the same IP address that have visited a particular page to show an interesting in a particular topic (i.e. visited the menswear section of a clothing website).