Fathom Analytics Cross-Domain Tracking | OpsBlu Docs

Fathom Analytics Cross-Domain Tracking

Configure Fathom Analytics to track users across multiple domains and subdomains

Overview

Cross-domain tracking allows you to track user journeys across multiple domains or subdomains as a single, continuous session. This is essential for businesses that operate across multiple properties, such as:

  • Main website and checkout on different domains (e.g., yoursite.comcheckout.yoursite.com)
  • Product sites and documentation on separate domains (e.g., product.comdocs.product.com)
  • Marketing sites and application platforms (e.g., marketing.comapp.company.com)

Fathom Analytics handles cross-domain tracking differently than traditional analytics platforms due to its privacy-first, cookieless architecture.

How Fathom Handles Cross-Domain Tracking

Privacy-First Approach

Unlike Google Analytics, Fathom doesn't use cookies or persistent identifiers to track users across domains. Instead, Fathom offers two approaches:

1. Separate Site Tracking (Default)

  • Each domain tracked as separate site
  • Independent data and reports
  • No user session continuity across domains

2. Shared Site Tracking (Cross-Domain)

  • Use same Site ID across all domains
  • View aggregate data in single dashboard
  • No individual user tracking (privacy-preserved)

Important Limitations

Because Fathom is privacy-first and cookieless:

  • No user-level session continuity across domains
  • No cross-domain user attribution (by design)
  • Aggregate traffic only - you see total visits, not individual journeys
  • Referrer data preserved - you can see traffic flowing between domains

This is a feature, not a bug - it protects user privacy while still giving you valuable insights.

Implementation Approaches

Use the same Site ID across all domains to view aggregate traffic in one dashboard.

Example: Main site and subdomain

On yourdomain.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

On app.yourdomain.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

On checkout.yourdomain.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

Benefits:

  • Single dashboard for all domains
  • See combined traffic patterns
  • Track conversions across properties
  • Simple implementation

Limitations:

  • Cannot distinguish traffic by domain in reports
  • No subdomain filtering in dashboard
  • Aggregate data only

Approach 2: Separate Sites Per Domain

Create separate Fathom sites for each domain and view them independently.

Create Sites:

  1. Site 1: "Main Website" - yourdomain.com (Site ID: ABCDEFGH)
  2. Site 2: "App Platform" - app.yourdomain.com (Site ID: APPSITE1)
  3. Site 3: "Checkout" - checkout.yourdomain.com (Site ID: CHECKOUT)

Implementation:

On yourdomain.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

On app.yourdomain.com:

<script src="https://cdn.usefathom.com/script.js" data-site="APPSITE1" defer></script>

On checkout.yourdomain.com:

<script src="https://cdn.usefathom.com/script.js" data-site="CHECKOUT" defer></script>

Benefits:

  • Clear separation of domain analytics
  • Easier to analyze per-domain performance
  • Separate goal tracking per domain
  • Domain-specific insights

Limitations:

  • No aggregate cross-domain view
  • Must switch between dashboards
  • Costs more (if over plan limits)

Approach 3: Hybrid Strategy

Use shared Site ID for main tracking, plus domain-specific goals to distinguish traffic.

Implementation:

Same Site ID everywhere:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

Create domain-specific goals:

On main site (yourdomain.com):

// Track that user visited main site
fathom.trackGoal('MAINSITE', 0);

On app platform (app.yourdomain.com):

// Track that user visited app
fathom.trackGoal('APPVISIT', 0);

On checkout (checkout.yourdomain.com):

// Track checkout page visit
fathom.trackGoal('CHECKOUT', 0);

// Track purchase
fathom.trackGoal('PURCHASE', 9999); // with revenue

Benefits:

  • Single dashboard with domain insights
  • Track conversions across domains
  • Identify traffic patterns
  • Flexible reporting

Limitations:

  • Requires manual goal setup
  • More complex implementation
  • Still no user-level journey tracking

Subdomain Tracking

Same Root Domain (Automatic)

Subdomains of the same root domain work seamlessly with shared Site ID:

Example: blog.yourdomain.com, shop.yourdomain.com, docs.yourdomain.com

<!-- Same script on all subdomains -->
<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

Fathom automatically:

  • Tracks pageviews across subdomains
  • Preserves referrer information
  • Shows aggregate traffic

Viewing Subdomain Traffic:

In Fathom dashboard:

  1. Click on "Top Pages"
  2. Look at full URLs to see subdomain distribution
  3. Filter by URL patterns (manual analysis)

Different Root Domains

For completely different domains (e.g., siteA.com and siteB.com), use the shared Site ID approach.

Example:

On siteA.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

On siteB.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

Track cross-domain navigation:

When linking between domains, you can track the transition:

On siteA.com:

<a href="https://siteB.com/landing" 0)">
  Visit Site B
</a>

This creates a goal for "User navigated to Site B from Site A."

Referrer Tracking Across Domains

Fathom preserves referrer information when users navigate between domains.

How It Works

User journey:

  1. User visits yourdomain.com (referrer: Google)
  2. User clicks link to checkout.yourdomain.com
  3. Fathom tracks new pageview with referrer: yourdomain.com

Viewing Referrer Data

In Fathom dashboard:

  1. Go to "Top Referrers"
  2. See traffic sources including:
    • External sites (Google, Twitter, etc.)
    • Your own domains (cross-domain traffic)

Implementation Considerations

Ensure proper link structure:

<!-- Good - preserves referrer -->
<a href="https://checkout.yourdomain.com/cart">Checkout</a>

<!-- Bad - may lose referrer -->
<a href="https://checkout.yourdomain.com/cart" rel="noreferrer">Checkout</a>

Avoid rel="noreferrer" on cross-domain links if you want to track the flow.

Custom Domain Setup for Cross-Domain Tracking

Using a custom domain (e.g., stats.yourdomain.com) provides additional benefits for cross-domain scenarios:

Benefits

  1. Bypasses ad blockers more effectively
  2. First-party tracking on all your domains
  3. Consistent data quality across properties
  4. Professional appearance

Setup

1. Configure DNS:

Create CNAME record:

stats.yourdomain.com → cdn.usefathom.com

2. Add Custom Domain in Fathom:

  1. Go to Settings > Custom Domain
  2. Enter: stats.yourdomain.com
  3. Save and wait for verification

3. Update Script on All Domains:

On all domains:

<script src="https://stats.yourdomain.com/script.js" data-site="ABCDEFGH" defer></script>

Cross-Subdomain Custom Domain

For subdomains, use the same custom domain script:

On blog.yourdomain.com:

<script src="https://stats.yourdomain.com/script.js" data-site="ABCDEFGH" defer></script>

On app.yourdomain.com:

<script src="https://stats.yourdomain.com/script.js" data-site="ABCDEFGH" defer></script>

All properties use the same tracking domain for consistency.

Tracking Conversions Across Domains

Ecommerce Example

Scenario: Product browsing on shop.com, checkout on checkout.shop.com

On shop.com (product pages):

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

<!-- Track add to cart -->
<button 0)">Add to Cart</button>

On checkout.shop.com (checkout flow):

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

<script>
// Track checkout initiated
fathom.trackGoal('CHECKOUT', 0);
</script>

On checkout.shop.com/success (after purchase):

// Track purchase completion
const orderTotal = 149.99;
const cents = Math.round(orderTotal * 100);
fathom.trackGoal('PURCHASE', cents);

Dashboard view:

  • See total "Add to Cart" goals
  • See total "Checkout" goals
  • See total "Purchase" goals with revenue
  • Calculate conversion rates

Multi-Step Funnel

Track user flow across domains:

Goals to create:

  1. LANDPAGE - Landing page visit (domain1.com)
  2. SIGNUP - Signup form (signup.domain1.com)
  3. ONBOARD - Onboarding started (app.domain1.com)
  4. CONVERT - Trial to paid conversion (billing.domain1.com)

Implementation:

// On each domain/page, track the appropriate goal
fathom.trackGoal('LANDPAGE', 0);  // Landing
fathom.trackGoal('SIGNUP', 0);     // Signup
fathom.trackGoal('ONBOARD', 0);    // Onboarding
fathom.trackGoal('CONVERT', 4900); // Conversion with revenue

Analysis:

  • Compare goal counts to identify drop-offs
  • Calculate conversion rates at each stage
  • Optimize funnel based on aggregate data

Implementation Patterns

Pattern 1: Marketing Site + Application

Scenario: Marketing site and SaaS app on different domains

marketing.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

<!-- Track CTA clicks -->
<button 0); window.location.href='https://app.marketing.com/signup'">
  Start Free Trial
</button>

app.marketing.com:

<script src="https://cdn.usefathom.com/script.js" data-site="ABCDEFGH" defer></script>

<script>
// On signup page
fathom.trackGoal('SIGNUPVU', 0);

// After successful signup
function handleSignup() {
  fathom.trackGoal('SIGNUP', 0);
}
</script>

Pattern 2: Docs + Main Product

Scenario: Documentation site and main product site

Use separate sites for clearer analytics:

docs.product.com:

<script src="https://cdn.usefathom.com/script.js" data-site="DOCSSITE" defer></script>

product.com:

<script src="https://cdn.usefathom.com/script.js" data-site="PRODSITE" defer></script>

Track cross-links:

In docs:

<a href="https://product.com/signup" 0)">
  Sign Up
</a>

Pattern 3: Multi-Brand Portfolio

Scenario: Multiple brands under one company

Option A: Shared Site (Portfolio View)

<!-- Same Site ID on all brands -->
<script src="https://cdn.usefathom.com/script.js" data-site="PORTFOLIO" defer></script>

Option B: Separate Sites (Brand-Specific)

<!-- Brand A -->
<script src="https://cdn.usefathom.com/script.js" data-site="BRANDA" defer></script>

<!-- Brand B -->
<script src="https://cdn.usefathom.com/script.js" data-site="BRANDB" defer></script>

Best Practices

Choose the Right Strategy

Use Shared Site ID when:

  • You want aggregate cross-domain analytics
  • Domains are closely related (e.g., main + checkout)
  • You don't need domain-specific filtering
  • Budget is limited

Use Separate Sites when:

  • Each domain serves distinct purposes
  • You need clear separation of analytics
  • Domain-specific insights are critical
  • You can afford multiple sites on your plan

Implement Goals Consistently

Create a goal naming convention:

[DOMAIN]_[ACTION]

Examples:

  • MAIN_SIGNUP - Signup on main site
  • APP_LOGIN - Login on app domain
  • SHOP_PURCHASE - Purchase on shop domain

Document Cross-Domain Flow

Create a tracking plan:

User Flow:
1. yourdomain.com → Goal: LANDING
2. yourdomain.com/pricing → Goal: PRICING
3. checkout.yourdomain.com → Goal: CHECKOUT
4. checkout.yourdomain.com/success → Goal: PURCHASE (with revenue)

Test Thoroughly

Validation checklist:

  • Script loads on all domains
  • Pageviews tracked on all domains
  • Goals fire correctly on each domain
  • Referrer data flows between domains
  • Revenue tracking works on checkout domain
  • Real-time dashboard shows all domains
  • Cross-domain links preserve referrer

Troubleshooting

Issue: Referrer Not Showing

Cause: rel="noreferrer" on links

Solution:

<!-- Bad -->
<a href="https://other-domain.com" rel="noreferrer">Link</a>

<!-- Good -->
<a href="https://other-domain.com">Link</a>

Issue: Goals Not Firing on Second Domain

Cause: Script not loaded or incorrect Site ID

Solution:

  1. Verify script present on all domains
  2. Check Site ID matches
  3. Test in browser console: typeof fathom

Issue: Cannot Filter by Domain in Dashboard

Limitation: Fathom doesn't support domain filtering with shared Site ID

Workaround:

  1. Use separate sites for each domain, OR
  2. Use domain-specific goals to segment traffic, OR
  3. Analyze "Top Pages" to see full URLs with domains

Conclusion

Fathom's approach to cross-domain tracking prioritizes privacy while still providing valuable aggregate insights. While you won't get user-level journey tracking, you can:

  • Track aggregate traffic across domains
  • Measure conversions across properties
  • Understand referral flow between sites
  • Analyze funnel performance

Choose the implementation strategy that best fits your needs:

  • Shared Site ID for simple aggregate tracking
  • Separate Sites for domain-specific insights
  • Hybrid approach with goals for flexible reporting

Additional Resources: