User Identity and Matching
Learn how Ours identifies and matches users across sessions and devices to provide a unified view of user behavior.
User Identity and Matching
Ours Privacy tracks users across sessions and devices using a combination of first-party and third-party cookies. This guide explains how user identity works, how users are matched across sessions and domains, and how you can manage identity properties to improve tracking accuracy.
Cookie-Based Tracking
Ours uses two types of cookies to track users:
- First-Party Cookie: Stored on your domain, this cookie helps track users within the same domain.
- Third-Party Cookie: Stored on our CDN domain, this cookie enables cross-domain tracking.
These cookies work together to maintain user identity across different sessions and domains.
Cross-Domain Tracking
The third-party cookie stored on our CDN enables tracking users across different domains. When a user visits any domain where Ours is implemented:
- The third-party cookie is read from our CDN
- If a matching user ID is found, the user is identified as the same person
- If no match is found, a new user ID is generated and stored in both cookies
This mechanism allows you to track the same user across multiple domains without requiring any additional configuration.
User Re-Identification
You can re-identify users by including their external_id
or email
in your tracking calls.
HTTP API
Include external_id
or email
in your API requests to our HTTP API.
Sources
Include external_id
or email
in your webhook payloads.
When these identifiers are provided, Ours will use them to look up and match the user in our database.
Passing User ID Between Domains
If you need to manually pass the Ours user ID between different domains, you can do so using query parameters:
// Example URL with user ID
https://example.com?ours_user_id=${localStorage.getItem('ours_device_id')}
This is useful when you need to maintain user identity across domains that don't share the same cookie domain.
Custom User ID Initialization
You can provide your own user ID during initialization of the Ours Privacy SDK. This is useful when you have your own user identification system:
JavaScript Implementation
ours('init', '<ours web api key>', {
user_id: '<your custom user id>'
});
GTM Implementation

Note: When using custom user IDs, ensure you have a reliable system to generate and persist unique IDs for each user across different visits.
Best Practices for Identity Management
- Use
external_id
for Consistency:
- Assign a unique
external_id
to users to ensure accurate cross-device and cross-session tracking.
- Send Persistent Identifiers Early:
- Include user properties like
email
during initial interactions to improve matching accuracy.
- Manually Pass
ours_user_id
When Needed:
- Use the
?ours_user_id
query parameter to maintain identity across domains.
Updated 12 days ago