Understanding Network_userid and Domain_userid in Snowplow: A Technical Deep Dive
Q: What are Network_userid and Domain_userid in Snowplow?
In Snowplow, network_userid and domain_userid are key identifiers that play a crucial role in tracking user interactions across sessions and touchpoints.
- Network_userid is usually a third-party cookie–based identifier set by the collector. It can remain consistent for a single user across domains only when the browser allows third-party cookies. In setups where a custom collector domain or the cookie extension service is used, the network_userid can also be stored as a first-party cookie.
- Domain_userid is a first-party cookie-based identifier set by the tracker on the user's browser. It is domain-specific and helps in identifying unique users within a single domain or subdomain.
Q: Why do network_userid and domain_userid differ for the same user?
While network_userid is consistent across domains, domain_userid can vary due to the nature of first-party cookies. This discrepancy can occur due to several reasons:
- Different browsers or devices: Each browser or device keeps its own cookies, so both domain_userid and network_userid will be different if a user switches browsers or moves from web to mobile apps.
- Cookie Expiry and Deletion: If the domain_userid cookie expires or is deleted, a new domain_userid is generated while the network_userid remains the same.
- Cross-Domain Tracking Limitations: If a user interacts with multiple domains without proper cross-domain linking, the domain_userid will differ, but the network_userid will remain unchanged.
Q: How can network_userid have multiple domain_userid values?
A single network_userid — in contexts where it’s preserved — can map to multiple domain_userid values in scenarios such as:
- The user has cleared cookies, resulting in new domain_userid values being generated for the same network_userid.
- The user accessed multiple domains or subdomains without proper cross-domain tracking configuration.
- The user interacts with the website across multiple sessions, each generating a new domain_userid due to cookie expiry or browser settings.
Q: How can Snowplow help in managing these discrepancies?
Snowplow provides robust tracking capabilities that help data teams accurately identify and link user interactions across multiple domains and sessions. By configuring the tracker to handle cross-domain tracking effectively and ensuring that cookie lifetimes are aligned, data engineers can minimize these discrepancies.
Additionally, leveraging Snowplow’s enriched events and advanced data modeling capabilities can help in resolving multiple domain_userid values to a single network_userid, allowing for more accurate user attribution and multi-touch analysis.
Q: Best Practices for Managing network_userid and domain_userid
- Use a custom collector domain or the cookie extension service if you want network_userid to behave as a first-party cookie and persist more reliably.
- Implement Cross-Domain Tracking: Ensure that cross-domain tracking is properly configured to maintain consistent domain_userid values.
- Align Cookie Expiry Settings: Adjust cookie expiration policies to minimize the creation of multiple domain_userid values for the same network_userid.
- Data Modeling: Use data models that link network_userid to domain_userid values, enabling comprehensive user journey analysis.
- Monitor Data Quality: Regularly audit data to identify and address discrepancies between network_userid and domain_userid mappings.
For further insights and practical implementation examples, refer to the Snowplow documentation.