Cross-Domain Tracking Overview
Cross-domain tracking allows AdRoll to maintain user identity across multiple domains (e.g., marketing-site.com and shop.brand.com) or subdomains (e.g., www.example.com and blog.example.com). Without cross-domain tracking, AdRoll treats each domain as separate users, fragmenting audiences and losing attribution when users navigate between sites.
Use Cases
- Separate marketing and e-commerce sites:
brand.com→shop.brand.com - Blog on subdomain:
example.com→blog.example.com - Multi-brand portfolios:
brand-a.com+brand-b.comunder single advertiser - Third-party checkout:
yoursite.com→checkout.payment-provider.com - Localized domains:
example.com(US) +example.co.uk(UK) +example.de(Germany)
How Cross-Domain Tracking Works
- Same pixel across domains: Install identical AdRoll pixel (same advertiser + pixel IDs) on all domains
- Cookie sharing: AdRoll passes user ID via URL parameters when navigating between domains
- Domain approval: Add all domains to approved list in AdRoll dashboard
- Unified audiences: Users tracked across domains appear as single user in audiences
Prerequisites
- AdRoll pixel installed on primary domain
- Access to edit all domains you want to track
- Domain verification completed for all domains
- Same advertiser ID and pixel ID used across all domains
Setup Steps
1. Add Domains to Approved List
AdRoll Dashboard:
- Navigate to Settings → Pixels → Approved Domains
- Click Add Domain
- Enter each domain and subdomain:
example.comwww.example.comshop.example.comblog.example.com
- Click Save
Important:
- Add ALL variations (with and without
www) - Include both HTTP and HTTPS if site supports both (though HTTPS is recommended)
- Subdomains must be added separately (e.g.,
blog.example.comis separate fromexample.com)
2. Install Pixel on All Domains
Use the exact same pixel code (identical advertiser ID and pixel ID) on every domain:
<!-- SAME pixel code on all domains -->
<script type="text/javascript">
adroll_adv_id = "ABC123XYZ"; // SAME ID everywhere
adroll_pix_id = "DEF456GHI"; // SAME ID everywhere
adroll_version = "2.0";
(function(w, d, e, o, a) {
w.__adroll_loaded = true;
w.adroll = w.adroll || [];
w.adroll.f = [ 'setProperties', 'identify', 'track' ];
var roundtripUrl = "https://s.adroll.com/j/" + adroll_adv_id + "/roundtrip.js";
for (a = 0; a < w.adroll.f.length; a++) {
w.adroll[w.adroll.f[a]] = w.adroll[w.adroll.f[a]] || (function(n) {
return function() {
w.adroll.push([ n, arguments ])
}
})(w.adroll.f[a])
}
e = d.createElement('script');
o = d.getElementsByTagName('script')[0];
e.async = 1;
e.src = roundtripUrl;
o.parentNode.insertBefore(e, o);
})(window, document);
</script>
Deploy to:
- Main site:
example.com - E-commerce:
shop.example.com - Blog:
blog.example.com - Any other properties
3. Verify Cross-Domain Parameter Passing
AdRoll automatically appends tracking parameters when users navigate between domains:
Example navigation:
User on: example.com
Clicks link to: shop.example.com
Link becomes: shop.example.com?adroll_fpc=abc123...
↑ AdRoll user ID parameter
No code changes needed - AdRoll handles parameter passing automatically when:
- Pixel is installed on both domains
- Both domains are in approved list
- User clicks a link (not typing URL directly)
Subdomain Tracking
Automatic Subdomain Tracking
For subdomains under the same root domain (e.g., www.example.com and blog.example.com), AdRoll shares cookies automatically:
Setup:
- Install pixel on all subdomains
- Add each subdomain to approved domains list
- No additional configuration needed
Example:
Domains to track:
- www.example.com (main site)
- blog.example.com (blog)
- shop.example.com (store)
AdRoll approved domains:
✓ www.example.com
✓ blog.example.com
✓ shop.example.com
Cookie behavior:
- AdRoll sets cookies on
.example.com(root domain) - Cookies accessible from all subdomains automatically
- User ID persists across subdomain navigation
Multi-Domain Tracking (Different Root Domains)
Setup for Separate Domains
For completely different domains (e.g., brand-a.com and brand-b.com):
1. Install same pixel on both:
<!-- brand-a.com -->
<script>
adroll_adv_id = "ABC123XYZ"; // Same ID
adroll_pix_id = "DEF456GHI"; // Same ID
/* ... */
</script>
<!-- brand-b.com -->
<script>
adroll_adv_id = "ABC123XYZ"; // Same ID
adroll_pix_id = "DEF456GHI"; // Same ID
/* ... */
</script>
2. Add both domains to approved list:
brand-a.comwww.brand-a.combrand-b.comwww.brand-b.com
3. Link between domains:
When linking from one domain to another, ensure links allow AdRoll to pass user ID:
<!-- brand-a.com linking to brand-b.com -->
<a href="https://brand-b.com/products">Visit Brand B</a>
<!-- AdRoll automatically appends: ?adroll_fpc=... -->
No JavaScript needed - AdRoll intercepts link clicks and adds parameters automatically.
Cross-Domain Link Decoration
Manual Link Decoration (Advanced)
If automatic parameter passing doesn't work (e.g., JavaScript navigation), manually decorate links:
// Get AdRoll user ID
function getAdRollUserId() {
const cookies = document.cookie.split(';');
for (let cookie of cookies) {
const [name, value] = cookie.trim().split('=');
if (name === '__adroll_fpc') {
return value;
}
}
return null;
}
// Add AdRoll parameter to cross-domain links
function decorateCrossDomainLinks() {
const userId = getAdRollUserId();
if (!userId) return;
const crossDomainLinks = document.querySelectorAll('a[href*="shop.brand.com"]');
crossDomainLinks.forEach(link => {
const url = new URL(link.href);
url.searchParams.set('adroll_fpc', userId);
link.href = url.toString();
});
}
// Run on page load
decorateCrossDomainLinks();
JavaScript Navigation
For SPA or programmatic navigation:
// React example: navigate to different domain
function navigateToStore(productId) {
const userId = getAdRollUserId();
const url = `https://shop.brand.com/products/${productId}?adroll_fpc=${userId}`;
window.location.href = url;
}
// Or for window.open()
function openInNewTab(url) {
const userId = getAdRollUserId();
const decoratedUrl = `${url}?adroll_fpc=${userId}`;
window.open(decoratedUrl, '_blank');
}
Third-Party Checkout Integration
Payment Processor Checkout (e.g., Stripe, PayPal)
When redirecting to third-party checkout, maintain tracking:
Problem: User goes from yoursite.com → checkout.stripe.com → back to yoursite.com/confirmation
- AdRoll can't track on
checkout.stripe.com(third-party domain) - User ID may be lost during roundtrip
Solution: Pass user ID via return URL
1. Before redirecting to checkout:
// Capture AdRoll user ID
const adrollUserId = getAdRollUserId();
// Store in session or pass via checkout URL
sessionStorage.setItem('adroll_user_id', adrollUserId);
// Or append to return URL
const returnUrl = `https://yoursite.com/confirmation?order_id=123&adroll_fpc=${adrollUserId}`;
// Redirect to Stripe with custom return URL
redirectToStripe({
success_url: returnUrl,
cancel_url: 'https://yoursite.com/cart'
});
2. On return to confirmation page:
// confirmation.html
// Check URL for adroll_fpc parameter
const params = new URLSearchParams(window.location.search);
const adrollUserId = params.get('adroll_fpc') || sessionStorage.getItem('adroll_user_id');
// Re-establish AdRoll tracking
if (adrollUserId) {
document.cookie = `__adroll_fpc=${adrollUserId}; path=/; domain=.yoursite.com`;
}
// Fire conversion event
adroll.track("purchase", {
order_id: params.get('order_id'),
conversion_value: 99.99,
currency: "USD"
});
Multi-Brand / Multi-Advertiser Setup
Option 1: Single Advertiser (Shared Audiences)
Use when brands share audiences for cross-selling:
Setup:
- One advertiser ID for all brands
- Same pixel on
brand-a.com,brand-b.com,brand-c.com - All brands share audiences (user who visits Brand A can see Brand B ads)
Example:
// brand-a.com
adroll_adv_id = "ABC123XYZ";
adroll_pix_id = "DEF456GHI";
// brand-b.com (SAME IDs)
adroll_adv_id = "ABC123XYZ";
adroll_pix_id = "DEF456GHI";
// brand-c.com (SAME IDs)
adroll_adv_id = "ABC123XYZ";
adroll_pix_id = "DEF456GHI";
// Tag each brand's visitors differently
// brand-a.com
adroll.track("pageView", {
segment_name: "brand_a_visitors",
brand: "Brand A"
});
// brand-b.com
adroll.track("pageView", {
segment_name: "brand_b_visitors",
brand: "Brand B"
});
// Create campaigns:
// - Campaign 1: Show Brand B ads to "brand_a_visitors"
// - Campaign 2: Show Brand A ads to "brand_b_visitors"
Option 2: Separate Advertisers (Isolated Audiences)
Use when brands should NOT share audiences:
Setup:
- Different advertiser IDs for each brand
- Different pixels on each domain
- Audiences completely separate
Example:
// brand-a.com
adroll_adv_id = "ABC123AAA"; // Brand A advertiser
adroll_pix_id = "DEF456AAA";
// brand-b.com
adroll_adv_id = "ABC123BBB"; // Brand B advertiser (different)
adroll_pix_id = "DEF456BBB";
When to use:
- Brands target different customer segments
- Different marketing teams/budgets
- Privacy requirements prevent data sharing
Localized Domain Tracking
Multi-Country Domains
For international sites (e.g., example.com, example.co.uk, example.de):
Option 1: Unified global audience
// Same pixel on all country sites
// example.com, example.co.uk, example.de
adroll_adv_id = "ABC123XYZ"; // Same everywhere
adroll_pix_id = "DEF456GHI";
// Segment by country
adroll.track("pageView", {
segment_name: "visitors_uk",
country: "UK",
currency: "GBP"
});
Option 2: Region-specific advertisers
// example.com (US)
adroll_adv_id = "ABC123USA";
// example.co.uk (UK)
adroll_adv_id = "ABC123GBR";
// example.de (Germany)
adroll_adv_id = "ABC123DEU";
Benefits of unified:
- See global customer journey
- Retarget US visitors with UK site (if they travel)
- Consolidated reporting
Benefits of separate:
- Region-specific budgets and targeting
- Comply with local privacy laws (GDPR)
- Currency and language isolation
Testing Cross-Domain Tracking
Manual Testing
1. Test navigation between domains:
a. Visit example.com with AdRoll pixel installed
b. Open browser DevTools → Application → Cookies
c. Find __adroll_fpc cookie, copy value (e.g., abc123xyz456)
d. Click link to shop.example.com
e. Check cookies on shop.example.com
f. Verify __adroll_fpc value matches original (or URL has ?adroll_fpc=abc123xyz456)
2. Check URL parameters:
Navigate from domain A to domain B
Check URL of domain B:
✓ GOOD: shop.example.com/products?adroll_fpc=abc123xyz456
✗ BAD: shop.example.com/products (no parameter)
3. Test audience membership:
a. Visit both domains from same browser b. Wait 24-48 hours c. Check AdRoll → Audiences → All Visitors d. Audience size should reflect unique users, not pageviews across domains
Automated Testing
// test-cross-domain.js
// Run in browser console on first domain
(async function testCrossDomain() {
console.log('=== AdRoll Cross-Domain Test ===');
// 1. Check pixel loaded
if (typeof adroll === 'undefined') {
console.error('❌ AdRoll pixel not loaded');
return;
}
console.log('✓ AdRoll pixel loaded');
// 2. Check advertiser/pixel IDs
console.log('Advertiser ID:', adroll_adv_id);
console.log('Pixel ID:', adroll_pix_id);
// 3. Check cookie
const cookies = document.cookie.split(';');
let fpCookie = null;
for (let cookie of cookies) {
const [name, value] = cookie.trim().split('=');
if (name === '__adroll_fpc') {
fpCookie = value;
console.log('✓ AdRoll user ID cookie:', fpCookie);
}
}
if (!fpCookie) {
console.error('❌ AdRoll cookie not found');
return;
}
// 4. Test cross-domain link decoration
const crossDomainLinks = document.querySelectorAll('a[href*="shop.example.com"]');
console.log(`Found ${crossDomainLinks.length} cross-domain links`);
// Simulate click to see if parameter added
if (crossDomainLinks.length > 0) {
const testLink = crossDomainLinks[0];
console.log('Test link BEFORE:', testLink.href);
// Trigger AdRoll's link decoration
testLink.click(); // Or just inspect the href after AdRoll processes it
}
console.log('=== Test Complete ===');
})();
Troubleshooting
Cookies Not Persisting Across Domains
Symptoms:
- User ID different on each domain
- Audiences count same user multiple times
Causes & Fixes:
1. Different advertiser/pixel IDs:
// WRONG - Different IDs on each domain
// domain-a.com
adroll_adv_id = "ABC123";
// domain-b.com
adroll_adv_id = "XYZ789"; // DIFFERENT!
// FIX: Use same IDs on all domains
2. Domains not in approved list:
- Check Settings → Pixels → Approved Domains
- Add missing domains
3. Browser blocking third-party cookies:
- Safari ITP and Firefox Enhanced Tracking Protection limit cookie lifespan
- Consider first-party subdomain CNAME (contact AdRoll support)
4. Link navigation method:
// WRONG - Direct navigation loses parameter
window.location.replace('https://shop.brand.com');
// CORRECT - Use regular link click (AdRoll auto-decorates)
<a href="https://shop.brand.com">Shop</a>
// OR manually add parameter
window.location.href = 'https://shop.brand.com?adroll_fpc=' + getAdRollUserId();
Conversion Attribution Lost After Domain Hop
Symptoms:
- User clicks ad on
brand.com, converts onshop.brand.com - Conversion not attributed to campaign
Fix:
- Ensure same pixel on both domains
- Verify approved domains includes both
- Check conversion event fires on
shop.brand.comconfirmation page - Review attribution window (may need to extend from 30 to 60 days)
Audience Size Inflated
Symptoms:
- Audience size much larger than actual unique users
- Each domain visit counts as new user
Diagnosis:
// Check if user IDs are consistent across domains
// On domain-a.com
console.log('Domain A user ID:', document.cookie.match(/__adroll_fpc=([^;]+)/)?.[1]);
// On domain-b.com (after navigating from domain-a)
console.log('Domain B user ID:', document.cookie.match(/__adroll_fpc=([^;]+)/)?.[1]);
// IDs should MATCH
// If different, cross-domain tracking is broken
Fix:
- Verify URL parameter
?adroll_fpc=appears when navigating between domains - Check both domains have pixel installed
- Ensure link clicks (not typed URLs) for automatic parameter passing
Best Practices
Cookie Domain Configuration
For subdomains, AdRoll automatically sets cookies on root domain:
Site structure:
- www.example.com
- shop.example.com
- blog.example.com
AdRoll cookie domain: .example.com (note leading dot)
→ Accessible from all subdomains automatically
No configuration needed - AdRoll handles this automatically.
Privacy & Consent Management
When tracking across domains in EU:
// Only initialize AdRoll after consent
if (userConsentedToTracking) {
// Load AdRoll pixel
const script = document.createElement('script');
script.innerHTML = `
adroll_adv_id = "ABC123XYZ";
adroll_pix_id = "DEF456GHI";
// ... rest of pixel code
`;
document.head.appendChild(script);
}
// Track consent across domains
localStorage.setItem('adroll_consent', userConsentedToTracking);
// On other domain, check consent before loading pixel
if (localStorage.getItem('adroll_consent') === 'true') {
// Load pixel
}
Documentation
Document your cross-domain setup:
# AdRoll Cross-Domain Tracking
**Advertiser ID:** ABC123XYZ
**Pixel ID:** DEF456GHI
**Tracked Domains:**
- example.com (main site)
- www.example.com (www variant)
- shop.example.com (e-commerce)
- blog.example.com (content)
**Audience Strategy:**
- All domains share audiences
- Segment by domain via `segment_name` parameter
- Cross-sell: Retarget blog readers with shop products
**Updated:** 2025-01-15
Next Steps
- Event Tracking - Track conversions across domains
- Data Layer Setup - Product catalogs for multi-domain stores
- Troubleshooting & Debugging - Fix cross-domain issues
- Server-Side vs Client-Side - Alternative tracking methods