Overview
Pirsch takes a privacy-first approach to cross-domain tracking by treating each domain as a separate entity. Unlike traditional analytics platforms that link user sessions across domains, Pirsch intentionally isolates domains to protect user privacy and comply with GDPR requirements without requiring cookie consent banners.
This approach means you'll track pageviews and events independently for each domain, with aggregate statistics available through the Pirsch dashboard. While individual user journeys are not tracked across domains, you can still analyze traffic patterns and conversions across your web properties.
How Pirsch Handles Multiple Domains
Privacy-First Design
Pirsch's cross-domain architecture prioritizes user privacy:
- No cross-domain cookies: Pirsch doesn't set cookies that follow users between domains
- Isolated sessions: Each domain maintains its own session tracking
- No persistent identifiers: User behavior is not linked across domain boundaries
- Cookieless tracking: Uses privacy-friendly fingerprinting that respects user privacy
Domain Isolation Benefits
- GDPR Compliance: No need for cookie consent banners
- User Privacy: Visitors cannot be tracked across your domain portfolio
- Simplified Setup: Each domain operates independently
- Clean Data: No cross-contamination between properties
Configuration Steps
Step 1: Add Each Domain in Pirsch Dashboard
Log into your Pirsch account and add each domain as a separate website:
- Navigate to Settings > Websites
- Click Add Website
- Enter your domain details:
- Domain Name: example.com
- Timezone: Select appropriate timezone
- Public Access: Enable if you want public stats
- Repeat for each additional domain
Step 2: Install Tracking Code on Each Domain
Each domain requires its own unique tracking code with a domain-specific identification code:
Domain 1 (example.com):
<script defer src="https://api.pirsch.io/pirsch.js"
id="pirschjs"
data-code="CODE_FOR_DOMAIN_1"></script>
Domain 2 (shop.example.com):
<script defer src="https://api.pirsch.io/pirsch.js"
id="pirschjs"
data-code="CODE_FOR_DOMAIN_2"></script>
Domain 3 (blog.example.com):
<script defer src="https://api.pirsch.io/pirsch.js"
id="pirschjs"
data-code="CODE_FOR_DOMAIN_3"></script>
Step 3: Configure Referral Tracking
To understand traffic flow between your domains, configure proper referral settings:
<script defer src="https://api.pirsch.io/pirsch-extended.js"
id="pirschextendedjs"
data-code="YOUR_CODE"
data-dev="dev.example.com"></script>
Step 4: Track Domain-Specific Events
Use custom events to track cross-domain activities:
// Track when users click to another domain
document.querySelectorAll('a[href*="otherdomain.com"]').forEach(link => {
link.addEventListener('click', () => {
pirsch('Domain Navigation', {
meta: {
destination: 'otherdomain.com',
source_domain: window.location.hostname,
link_text: link.textContent
}
});
});
});
Analyzing Multi-Domain Traffic
Dashboard Views
Access each domain's statistics separately in the Pirsch dashboard:
- Use the domain selector dropdown to switch between properties
- View referrers to see traffic coming from your other domains
- Analyze entry and exit pages for each domain independently
Referrer Analysis
Check referrer reports to understand cross-domain traffic flow:
- Navigate to Referrers in your dashboard
- Look for your other domains in the referrer list
- This shows how much traffic moves between your properties
Custom Event Aggregation
Create a centralized view by exporting data from each domain:
# Use Pirsch API to export data
curl "https://api.pirsch.io/api/v1/statistics/page?from=2025-01-01&to=2025-12-31" \
-H "Authorization: Bearer YOUR_TOKEN"
Validation and Testing
Test Cross-Domain Navigation
Visit Domain 1 (example.com)
- Open developer console
- Check for Pirsch script load
- Verify no errors in console
Click Link to Domain 2 (shop.example.com)
- Should see new pageview in Domain 2's statistics
- Should see Domain 1 as referrer in Domain 2's dashboard
Check Dashboard Data
- Wait 5-10 minutes for data processing
- Verify pageviews appear in both dashboards
- Confirm referrer information is captured
Verify Privacy Compliance
- Confirm no cross-domain cookies are set
- Check that user fingerprints are domain-specific
- Verify no persistent identifiers exist across domains
Test Real-Time Data
// Monitor Pirsch requests in browser console
// Filter network tab by "pirsch.io"
// Should see separate requests for each domain
Implementation Patterns
Multi-Brand Setup
For separate brand domains:
<!-- brand1.com -->
<script defer src="https://api.pirsch.io/pirsch-extended.js"
data-code="BRAND1_CODE"></script>
<!-- brand2.com -->
<script defer src="https://api.pirsch.io/pirsch-extended.js"
data-code="BRAND2_CODE"></script>
Subdomain Architecture
For subdomain-based applications:
<!-- app.example.com -->
<script defer src="https://api.pirsch.io/pirsch-extended.js"
data-code="APP_CODE"></script>
<!-- docs.example.com -->
<script defer src="https://api.pirsch.io/pirsch-extended.js"
data-code="DOCS_CODE"></script>
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Pageviews not appearing | Wrong identification code used | Verify each domain uses its unique code from Pirsch dashboard |
| Referrer shows "(direct)" | Referrer not passed correctly | Check HTTPS on both domains; HTTP to HTTPS loses referrer |
| Duplicate tracking | Same code on multiple domains | Ensure each domain has its own unique identification code |
| Missing cross-domain events | Event not triggered | Add explicit event tracking on domain transition links |
| Data appears in wrong domain | Code mismatch | Double-check domain-to-code mapping in your deployment |
| Sessions seem linked | Browser caching issue | Clear browser cache and test in incognito mode |
| Real-time data delayed | Normal processing time | Wait 5-10 minutes for data to appear in dashboard |
| API calls failing | Invalid token or endpoint | Verify API credentials and endpoint URLs |
Best Practices
- Document Your Setup: Maintain a mapping of domains to identification codes
- Use Consistent Naming: Name domains clearly in Pirsch dashboard
- Monitor Referrers: Regularly check referrer reports to understand traffic flow
- Custom Events: Track important cross-domain actions with custom events
- Test Regularly: Verify tracking after any domain changes or deployments
- Export Data: Use API to create custom cross-domain reports
- Privacy First: Embrace the privacy-first design rather than trying to circumvent it