Cross-Domain Tracking Overview
Lucky Orange enables visitor tracking across multiple domains and subdomains when properly configured. Understanding how Lucky Orange handles cross-domain scenarios helps you maintain continuous visitor sessions and accurate analytics across your entire web presence.
How Cross-Domain Tracking Works
Lucky Orange uses cookie-based tracking combined with same Site ID deployment to track visitors across domains. Sessions remain continuous when visitors navigate between properties using the same tracking code.
Key Concepts
- Site ID: Unique identifier for your Lucky Orange account
- Cookie Domain: Controls cookie scope across subdomains
- Session Continuity: Maintained through consistent visitor identification
- Recording Continuity: Sessions continue across domains with same Site ID
Subdomain Tracking
Automatic Subdomain Support
Lucky Orange automatically tracks across subdomains when using the same Site ID:
<!-- On www.example.com -->
<script async defer src="https://tools.luckyorange.com/core/lo.js?site-id=a1b2c3d4"></script>
<!-- On app.example.com - same Site ID -->
<script async defer src="https://tools.luckyorange.com/core/lo.js?site-id=a1b2c3d4"></script>
<!-- On shop.example.com - same Site ID -->
<script async defer src="https://tools.luckyorange.com/core/lo.js?site-id=a1b2c3d4"></script>
How It Works
- Same Root Domain: Cookies are set on the root domain (
.example.com) - Shared Visitor ID: Same visitor ID used across all subdomains
- Continuous Sessions: Visitor session continues when navigating between subdomains
- Unified Recordings: All subdomain activity appears in single recording
Example Scenario
Visitor Journey:
1. Lands on www.example.com → Recording starts
2. Clicks link to app.example.com → Recording continues
3. Navigates to shop.example.com → Same recording
4. Returns to www.example.com → Still same session
Different Domain Tracking
Limitations
For completely different domains (e.g., site1.com and site2.com):
- Separate Sessions: Each domain creates new session by default
- Different Cookies: Browsers don't share cookies across different domains
- Recording Breaks: New recording starts on different domain
- Visitor Identification: Must use custom visitor identification
Workaround Using Custom Identification
To link visitors across different domains:
// On site1.com - identify visitor
window._loq = window._loq || [];
_loq.push(['custom', {
user_id: 'customer_12345',
email: 'customer@example.com'
}]);
// On site2.com - use same user_id
window._loq = window._loq || [];
_loq.push(['custom', {
user_id: 'customer_12345',
email: 'customer@example.com'
}]);
This creates separate sessions but links them to the same visitor profile.
Implementation Strategies
Same Site ID Across All Properties
Basic Setup:
- Use identical Site ID on all domains and subdomains
- Install Lucky Orange tracking code on every property
- Ensure code is in
<head>section for full capture
<!-- Deploy on all properties -->
<script async defer src="https://tools.luckyorange.com/core/lo.js?site-id=YOUR_SITE_ID"></script>
Multi-Domain with Visitor Linking
For separate domains requiring visitor continuity:
// Central identification function
function identifyVisitor(user) {
if (window._loq && user) {
_loq.push(['custom', {
user_id: user.id,
email: user.email,
name: user.name,
domain: window.location.hostname
}]);
// Tag by domain
_loq.push(['tag', 'Domain: ' + window.location.hostname]);
}
}
// Call after user authentication
if (currentUser) {
identifyVisitor(currentUser);
}
Common Use Cases
Marketing Site + Application
Track users from marketing site through to app:
Setup:
1. Install same Site ID on both domains
2. Identify users after login
3. Tag sessions by domain/property
4. Filter recordings by tag in dashboard
Example:
- marketing.example.com: Public facing site
- app.example.com: User application
- Same Site ID on both
- Identify users on app after authentication
E-commerce with Subdomain Checkout
Scenario: Main site + checkout subdomain
- www.store.com: Product browsing
- checkout.store.com: Secure checkout
- Same Site ID automatically tracks across both
- Single session recording captures full purchase journey
Multi-Brand Properties
Different Brands with Shared Customers:
- brand1.com: Site ID A
- brand2.com: Site ID B
- Use custom identification with shared user_id
- View customer history across brands in dashboard
Configuration Examples
Standard Subdomain Setup
<!-- header.php or equivalent on all subdomains -->
<!DOCTYPE html>
<html>
<head>
<title>Site Title</title>
<!-- Lucky Orange - Same Site ID everywhere -->
<script async defer src="https://tools.luckyorange.com/core/lo.js?site-id=abc123"></script>
</head>
<body>
<!-- Content -->
</body>
</html>
With Custom Visitor Identification
<head>
<!-- Lucky Orange Installation -->
<script async defer src="https://tools.luckyorange.com/core/lo.js?site-id=abc123"></script>
<!-- Visitor Identification -->
<script>
window._loq = window._loq || [];
// Identify logged-in users
{% if user %}
_loq.push(['custom', {
user_id: '{{ user.id }}',
email: '{{ user.email }}',
name: '{{ user.name }}',
account_type: '{{ user.account_type }}'
}]);
_loq.push(['tag', 'Authenticated User']);
_loq.push(['tag', 'Plan: {{ user.plan }}']);
{% endif %}
</script>
</head>
Viewing Cross-Domain Data
In Lucky Orange Dashboard
Recordings:
- Go to Recordings section
- Filter by domain using URL filter
- View full visitor journey across properties
- Sessions on subdomains appear continuously
Visitor Profiles:
- Navigate to Visitors section
- Click on individual visitor
- View all sessions across all domains (if using same Site ID)
- See custom data and tags
Filtering:
- Filter recordings by URL to focus on specific domain
- Use tags to segment by property
- Search by custom fields (user_id, email)
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Session breaks between subdomains | Different Site IDs | Use same Site ID on all subdomains |
| No recordings from subdomain | Tracking not installed | Verify script on all subdomains |
| Visitor not identified across domains | No custom identification | Implement custom visitor ID |
| Cookies not persisting | Cookie settings | Check browser cookie settings |
| Different domain showing as new visitor | Expected behavior | Use custom ID to link visitors |
| Recording URL incorrect | Wrong base URL | Verify domain settings in Lucky Orange |
Best Practices
- Single Site ID: Use one Site ID across all related properties
- Consistent Installation: Install tracking code identically everywhere
- Custom Identification: Identify users with consistent ID across domains
- Tag by Property: Add domain-specific tags for filtering
- Test Thoroughly: Verify tracking across all domains before launching
- Document Setup: Maintain list of which Site ID is on which domain
- Monitor Coverage: Regularly check all domains still have tracking
- Privacy Compliance: Ensure GDPR/privacy compliance across all domains
Limitations
Technical Constraints
- Different Root Domains: Cannot share cookies across different root domains
- Browser Restrictions: Third-party cookie blocking affects cross-domain
- Session Continuity: New session created when moving to different root domain
- Recording Limits: Each session counts toward recording quota
Workarounds
For Different Domains:
- Use custom visitor identification
- Link sessions via visitor profiles
- Tag sessions for filtering
- Use API for unified reporting
For Privacy Restrictions:
- Implement first-party cookie where possible
- Use server-side identification
- Respect user privacy preferences
- Implement consent management
Verification Checklist
After implementing cross-domain tracking:
- Same Site ID deployed on all properties
- Tracking code in
<head>on all pages - Test navigation between domains
- Verify session continuity in recordings
- Custom identification working (if used)
- Tags applied correctly by domain
- Visitor profiles show combined data
- No console errors on any domain
- Privacy settings consistent across domains
- Documentation updated with tracking map