When collecting data from multiple websites using the same tracking code, you can use cross-domain tracking to recognize visitors across different domains. This means that when a visitor moves from one website to another, they will be identified as the same visitor. Sessions that would otherwise be considered separate for each website will now be treated as a single session.
To turn on cross-domain visitor recognition, follow these steps:
- Go to Menu > Administration.
- Navigate to Sites & apps.
- Click Add a site or app.
- Name the site or app.
- In Site or app address, type addresses. Example:
- Install the container (with the tracking code) on both websites by following this guide.
- Go to Menu > Tag Manager.
- On the left, click Piwik PRO. This is the tag with the tracking code.
- In Data collection, turn on Recognize a visitor across domains.
Note: We add the pk_vid parameter to the page URL to pass the visitor ID between domains.
- When you’re done, click Save.
- Click Publish.
To see if your setup works properly, follow these steps:
- Open your first domain.
- Move to the second domain.
- Check the URL of the second domain. It should have the parameter
?pk_vid=added. If so, it means that Piwik PRO is passing the visitor ID from the first domain to the second domain.
- All done!