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 tracks users across sessions and devices, helping you build a unified view of user behavior. This guide explains how user identity works, how users are matched across sessions, and how you can manage identity properties to improve tracking accuracy.
How Identity Stitching Works
Every user to your website or app is assigned a unique user id by Ours. This user ID acts as a consistent identifier across multiple sessions and devices, enabling accurate tracking and analytics.
Ours automatically tracks the same user with the same user id across all domains and subdomains on your site. We set these cookies via the server-side whenever possible to ensure that they are kept longer by browsers.
If a user arrives on the site without a passed user ID, Ours uses non-invasive fingerprinting techniques (e.g., device type, browser version) to attempt to re-match users who may have cleared cookies, switched devices, or had their cookies cleared by a browser between visits.
Finally, Ours treats the external_id
and email
as unique identifiers for a user. If you include these in the request, they will be used to look up the user in our database for our HTTP API and Sources
Identity Assignment:
- For new users without an
external_id
oremail
, Ours generates a unique user ID based on a combination of browser and session data. - Returning users are recognized using cookies, local storage, or
external_id
andemail
if provided.
Passing The Ours User Id To Different Domains (advanced)
Ours automatically assigns and tracks a user ID for visitors when your script is loaded. This id follows the visitor across any property on the same domain.
If you have a property on a differing domain, you may want to pass the ours user ID to that other domain. You can do that with query params like this:
Example: https://example.com?ours_user_id=${localStorage.getItem('ours_device_id')}
.
Providing Your Own User Id (advanced)
If you wish to provide your own user ID for your visitors, you can do that via our Javascript library and/or GTM.
This is an advanced feature. Please ensure you have the property technology in place to have unique IDs for each user. And, persist the same ID for users across different visits.
Javascript Implementation
ours('init', '<ours web api key>', { user_id: '<user id value goes here>' });
GTM Implementation

Fingerprinting:
Ours uses non-invasive fingerprinting techniques (e.g., device type, browser version) to match users who may clear cookies or switch devices.
Matching Users Across Sessions
When a user returns to your site, Ours attempts to match them with an existing user record. The matching process is based on:
- Email and External ID:
- If the user has provided an
external_id
oremail
in the request, Ours will use it to look up the user in the database.
- If the user has provided an
- Server Set Cookies or Local Storage:
- Browser-stored data is used to reconnect with the original user ID.
- Fingerprinting:
- If other methods fail, fingerprinting techniques are used to approximate a match.
- New User ID:
- If all else fails, a new user ID is generated and stored in the browser.
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 2 months ago