ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Events: cross-domain tracking

Cross-domain Tracking is a technique for measuring visitors who follow links between multiple websites on different top-level domains. 

When a user browsing website A clicks on a link pointing to website B, his user ID stored for Website A will be available for SDK deployed on Website B via a parameter in the URL, hence it can be tracked and stitched to user ID stored for website B. 

The SDK now supports this type of cross-domain tracking, but there's a requirement to whitelist the domains where you intend to pass user IDs within the SDK configuration.

To set up cross-domain tracking, follow the steps outlined in the article How to deploy Meiro Events on the website and ensure that you whitelist domains in MeiroEvents.init function.

Before: MeiroEvents.init(domain);

After: MeiroEvents.init({ domain: domain, cross_domain_whitelist: [“example.com”] });

The whitelist should contain domain names for every website to which you want to append a User ID. If you want to whitelistwebsite and all its subdomains, you can use the following syntax: "*.example.com".

Take a look at the following example:

Suppose you have three websites, site-one.com, site-two.com, and site-three.io, and you want to implement cross-domain tracking for these domains. 

  • On site-one, the `cross_domain_whitelist` array will be [“site-two.com”, “site_three.io”]
  • On site-two the `cross_domain_whitelist` array will be [“site-one.com”, “site-three.io]
  • On the latest website, the array will be [“site-one.com”, site-two.com”]

Each website needs to include other domains in the SDK configuration.

How to test if cross-domain tracking was correctly implemented

After implementing cross-domain tracking, verify that it is working correctly. You can test the implementation in two ways:

1. Inbound user ID in payload of page view events

Examine the payload of page view events to confirm that cross-domain tracking functions as expected. Follow these steps to check this:

  • Open the browser’s developer tools (usually with F12 or right-clicking and selecting "Inspect").
  • Ensure that you are on the website A and click on the website B. Both websites should have Meiro SDK implemented and be whitelisted for cross-domain tracking.
  • Trigger a page view event by loading a page or performing an action that sends a page view event.
  • In the developer tools, look for the network tab and find the request for the page view event. You should see user ID, e.g. meiro_inbound_user_ids in the request payload.
  • Repeat this process for each website in your cross-domain tracking setup to ensure that user IDs are consistently passed between them.

2. Checking Meiro user ID in application cookies

Another way to verify cross-domain tracking is to check the Meiro user ID stored in application cookies. Meiro Events may store user IDs in cookies, and they should be accessible across different websites in your setup. Follow these steps to check this:

  • Ensure that you are on the website A and click on the website B. Both websites should have Meiro SDK implemented and be whitelisted for cross-domain tracking.
  • Open the developer tools in your web browser.
  • Go to the "Application" tab in the developer tools.
  • Under the Cookies section, select the cookies for the domain you are currently on and search for a cookie related to Meiro, meiro_user_id.
  • Repeat this process for each website in your cross-domain tracking setup to ensure that the Meiro user ID is consistently accessible across domains.

By following these testing methods, you can ensure that your cross-domain tracking implementation is correctly passing and maintaining user IDs as visitors move between different windows of the websites.