Simple Analytics Cross-Domain Tracking | OpsBlu Docs

Simple Analytics Cross-Domain Tracking

Configure cross-domain tracking in Simple Analytics — link domains, preserve user sessions, and validate multi-domain setups.

Overview

Simple Analytics takes a fundamentally privacy-respecting approach to cross-domain tracking by treating each domain as an independent entity. This design philosophy ensures user privacy is maintained across your entire web presence while still providing valuable analytics insights for each property.

Unlike traditional analytics platforms that link user behavior across domains to build comprehensive profiles, Simple Analytics intentionally isolates each domain's data. This privacy-first architecture means you comply with GDPR and other privacy regulations without requiring cookie consent banners, even when operating multiple domains.

Simple Analytics Cross-Domain Philosophy

Privacy-Preserving Design

Simple Analytics' approach to multiple domains prioritizes user privacy:

  • Independent Domains: Each domain is tracked as a separate website
  • No Cross-Domain Cookies: No cookies that follow users between properties
  • No User Tracking: Visitor journeys are not linked across domain boundaries
  • Isolated Analytics: Each domain maintains its own statistics
  • Referrer Preservation: You can still see traffic flowing between your domains via referrer data

Benefits of Domain Isolation

  1. Complete Privacy: Users cannot be tracked across your domain portfolio
  2. GDPR Compliance: No need for complex cookie consent mechanisms
  3. Clean Data: Each domain's analytics remain uncontaminated
  4. Simple Setup: Add each domain independently without complex configuration
  5. Transparent Tracking: Users know their behavior is not being linked across sites

Setting Up Multiple Domains

Step 1: Add Each Domain in Dashboard

For each domain you want to track, create a separate website in Simple Analytics:

  1. Log into your Simple Analytics dashboard
  2. Click Add website
  3. Enter your domain name (e.g., example.com)
  4. Click Add website
  5. Repeat for each additional domain

Example Setup:

  • Website 1: example.com
  • Website 2: shop.example.com
  • Website 3: blog.example.com

Step 2: Install Tracking Code on Each Domain

Each domain uses the same Simple Analytics script but tracks to different properties:

Domain 1 (example.com):

<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

Domain 2 (shop.example.com):

<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

Domain 3 (blog.example.com):

<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

Step 3: Domain Recognition

Simple Analytics automatically recognizes which domain the script is running on based on the page URL. No additional configuration is needed - the script reports data to the correct website automatically.

Analyzing Multi-Domain Traffic

Dashboard Navigation

Access each domain's statistics separately:

  1. Open Simple Analytics dashboard
  2. Use the website dropdown in the top navigation
  3. Select the domain you want to view
  4. All statistics shown are for that domain only

Understanding Referrer Data

While users aren't tracked across domains, you can still understand traffic flow through referrer analysis:

Check Referrers:

  1. Select a domain in your dashboard
  2. Navigate to Referrers section
  3. Look for your other domains in the list
  4. This shows how much traffic comes from your other properties

Example:

  • On shop.example.com, you might see example.com as a referrer
  • This indicates visitors clicked from main site to shop
  • Individual visitors are not tracked, only aggregate counts

Combining Data from Multiple Domains

While Simple Analytics doesn't provide built-in cross-domain reporting, you can:

Option 1: Manual Aggregation

  • Export data from each domain using the CSV export feature
  • Combine in a spreadsheet or data analysis tool
  • Create custom reports showing total traffic across properties

Option 2: API Integration

  • Use Simple Analytics API to fetch data from each domain
  • Aggregate programmatically in your own system
  • Build custom dashboards combining multiple domains

Option 3: Use Tags

  • Create tags for different domains (e.g., "main-site", "shop", "blog")
  • View aggregate data across tagged properties
  • Useful for high-level organizational reporting

Implementation Patterns

Multi-Brand Architecture

For separate brand domains under one organization:

<!-- brand-a.com -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

<!-- brand-b.com -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

Each brand's traffic is tracked independently with full privacy protection.

Subdomain Structure

For subdomain-based applications:

<!-- app.example.com -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>

<!-- docs.example.com -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>

<!-- api.example.com -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>

Each subdomain should be added as a separate website in Simple Analytics dashboard.

Marketing Site + Application Split

Common pattern for SaaS businesses:

<!-- marketing-site.com (public website) -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>

<!-- app.product.com (logged-in application) -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>

Track marketing and product usage separately while respecting user privacy.

Tracking Cross-Domain Interactions

While you can't track individual users across domains, you can track when links are clicked:

// Track when users click to another domain
document.querySelectorAll('a[href*="shop.example.com"]').forEach(link => {
  link.addEventListener('click', () => {
    sa_event('external_link_click', {
      destination: 'shop.example.com',
      source_page: window.location.pathname
    });
  });
});

This creates an event on the source domain showing clicks to the destination domain.

Form Submissions Across Domains

Track form submissions that lead to different domains:

document.getElementById('signup-form').addEventListener('submit', function(e) {
  sa_event('signup_redirect', {
    redirect_to: 'app.example.com'
  });
});

Validation and Testing

Test Multi-Domain Setup

For Each Domain:

  1. Visit the Domain: Open the domain in your browser
  2. Open DevTools: Press F12
  3. Check Network Tab: Filter by "simpleanalyticscdn.com"
  4. Verify Script Load: Confirm latest.js loads successfully (200 status)
  5. Check Dashboard: Wait 5 minutes, then verify pageview appears

Cross-Domain Navigation Test:

  1. Start on Domain A (e.g., example.com)
  2. Click link to Domain B (e.g., shop.example.com)
  3. Verify pageview recorded on Domain B
  4. Check that Domain A appears as referrer in Domain B's dashboard

Verify Domain Recognition

Test that Simple Analytics correctly identifies each domain:

// Run in browser console on each domain
console.log('Current domain:', window.location.hostname);
console.log('SA script loaded:', typeof sa_event !== 'undefined');

Dashboard Verification Checklist

For each domain:

  • Domain appears in website dropdown
  • Pageviews are being recorded
  • Referrer data shows correctly
  • Events track to correct domain (if using events)
  • No cross-contamination between domains

Troubleshooting

Issue Cause Solution
Pageviews on wrong domain Domain not added in dashboard Add all domains as separate websites in dashboard
No referrer data between domains HTTPS/HTTP mismatch Ensure both domains use HTTPS
Domain not appearing Not added to dashboard Add domain explicitly in Simple Analytics settings
Missing pageviews Script not installed Verify script is present on all pages of each domain
Duplicate tracking Script installed multiple times Check for duplicate script tags in HTML
Events tracking to wrong site Domain recognition issue Ensure each domain is configured as separate website
Data appearing mixed Subdomain configuration issue Add each subdomain as unique website
No noscript fallback working Image not loading Verify noscript.gif URL is correct and accessible

Best Practices

  1. Consistent Implementation: Use the same script structure across all domains
  2. Document Mapping: Maintain a list of which domains are tracked where
  3. Test Thoroughly: Verify tracking on each domain before launch
  4. Regular Audits: Periodically check that all domains are tracking correctly
  5. Monitor Referrers: Use referrer data to understand cross-domain traffic flow
  6. Use Events: Track cross-domain links with custom events for deeper insights
  7. Keep It Simple: Don't try to circumvent the privacy-first design
  8. Export Data: Regularly export data for cross-domain analysis if needed

Privacy Compliance

GDPR Considerations

Simple Analytics' cross-domain approach is GDPR compliant by design:

  • No personal data collected
  • No cross-domain user tracking
  • No persistent identifiers
  • No cookie consent required
  • Data processed anonymously

Privacy Policy Language

Include this in your privacy policy when using Simple Analytics across multiple domains:

We use Simple Analytics on our websites to collect anonymous usage statistics. Simple Analytics does not track individual users across our domains, does not use cookies, and does not collect any personal data. Each domain's analytics are tracked independently to respect your privacy.