If you collect data from a few websites using the same tracking code, you can turn on recognizing a visitor across domains (aka cross-domain tracking). Then the visitor who goes from one website to the other will be recognized as the same visitor. Sessions that would be treated as separate for each website, will be treated as one session.
To turn on recognizing a visitor across domains, 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 check if your setup works correctly, follow these steps:
- Open your first domain.
- Move to the second domain.
- Check the URL for the second domain. It should have attached the ?pk_vid= parameter. If it does it means that Piwik PRO transfers the visitor ID from first to second domain.