Visitor Identity and Matching

Learn how Ours identifies and matches visitors across sessions and devices to provide a unified view of visitor behavior.

Visitor Identity and Matching

Ours Privacy tracks visitors across sessions and devices using a combination of first-party and third-party cookies. This guide explains how visitor identity works, how visitors 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 visitors:

  1. First-Party Cookie: Stored on your domain, this cookie helps track visitors within the same domain.
  2. Third-Party Cookie: Stored on our CDN domain, this cookie enables cross-domain tracking.

These cookies work together to maintain visitor identity across different sessions and domains.

Cross-Domain Tracking

The third-party cookie stored on our CDN enables tracking visitors across different domains. When a visitor visits any domain where Ours is implemented:

  1. The third-party cookie is read from our CDN
  2. If a matching visitor ID is found, the visitor is identified as the same person
  3. If no match is found, a new visitor ID is generated and stored in both cookies

This mechanism allows you to track the same visitor across multiple domains without requiring any additional configuration.

Visitor Re-Identification

You can re-identify visitors 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 visitor in our database.

Passing Visitor ID Between Domains

If you need to manually pass the Ours visitor ID between different domains, you can do so using query parameters:

// Example URL with visitor ID
https://example.com?ours_user_id=${localStorage.getItem('ours_device_id')}

This is useful when you need to maintain visitor identity across domains that don't share the same cookie domain.

Custom Visitor ID Initialization

You can provide your own visitor ID during initialization of the Ours Privacy SDK. This is useful when you have your own visitor identification system:

JavaScript Implementation

ours('init', '<ours web api key>', { 
  visitor_id: '<your custom visitor id>' 
});

GTM Implementation

Note: When using custom visitor IDs, ensure you have a reliable system to generate and persist unique IDs for each visitor across different visits.


Best Practices for Identity Management

  1. Useexternal_id for Consistency:
  • Assign a unique external_id to visitors to ensure accurate cross-device and cross-session tracking.
  1. Send Persistent Identifiers Early:
  • Include visitor properties like email during initial interactions to improve matching accuracy.
  1. Manually Passours_user_id When Needed:
  • Use the ?ours_user_id query parameter to maintain identity across domains.