Cross-Domain Tracking & Whitelisting

Cross-domain tracking allows you to track page views, form submissions, and click events across multiple domains while having all data appear in your main website's dashboard. This is especially useful for ecommerce sites with separate checkout domains or multi-domain setups.

Track user interactions across multiple domains and subdomains while maintaining a unified view in your primary Humblytics dashboard. Whether you're running an ecommerce site with a separate checkout domain or managing multiple related websites, cross-domain tracking ensures complete visibility into your user journeys.


How Cross-Domain Tracking Works

Cross-domain tracking enables you to:

  • Track checkout processes on separate domains (e.g., yourdomain.comcheckout.yourdomain.com)

  • Monitor multi-step funnels that span different domains

  • Attribute conversions from external domains back to your main site

  • Maintain unified analytics across your entire digital ecosystem

Key Benefits:

Benefit
Detail

Unified Dashboard

All cross-domain events appear in your main site's analytics

Complete Funnels

Track user journeys across domain boundaries

Cookie-Free

No cross-domain cookies or complex consent management

Privacy-Compliant

Maintains GDPR/CCPA compliance across all domains


Cross-Domain Event Tracking

You can track three types of events across domains using the domain parameter:

Page Views

Track when users visit pages on external domains:

window.Humblytics.trackPageView("/checkout", {
  domain: "yourdomain.com",
});

Form Submissions

Track form completions on external domains:

window.Humblytics.trackFormSubmission("checkout-form", {
  domain: "yourdomain.com",
});

Click Events

Track button clicks and link interactions on external domains:

window.Humblytics.trackClickEvent("purchase-button", {
  domain: "yourdomain.com",
});

Important: The domain parameter should specify the main website domain where you want the event data to appear in your dashboard.


Setup Instructions

Step 1: Install Humblytics on Both Domains

Both your main domain and the external domain need the Humblytics tracking script:

<!-- Add to <head> of both domains -->
<script
  async
  src="https://app.humblytics.com/hmbl.min.js?id=YOUR_HUMBLYTICS_ID"
></script>

Step 2: Whitelist External Domains (If Required)

For some integrations, you may need to whitelist external domains in your Humblytics dashboard:

  1. Navigate to Settings → Domains

  2. Add the external domain to your whitelist

  3. Save the changes

Step 3: Implement Cross-Domain Tracking

On the external domain, use the tracking methods with the domain parameter:

Example: Ecommerce Checkout Flow

// On checkout.yourdomain.com - track checkout page view
window.Humblytics.trackPageView("/checkout-start", {
  domain: "yourdomain.com",
});

// Track form submission on checkout completion
window.Humblytics.trackFormSubmission("checkout-complete", {
  domain: "yourdomain.com",
});

// Track purchase button clicks
window.Humblytics.trackClickEvent("purchase-cta", {
  domain: "yourdomain.com",
});

Common Use Cases

Ecommerce with Separate Checkout

Scenario: Main site on store.com, checkout on checkout.store.com

// On checkout.store.com
window.Humblytics.trackPageView("/checkout", {
  domain: "store.com",
});

window.Humblytics.trackFormSubmission("purchase-form", {
  domain: "store.com",
});

Multi-Domain Company Website

Scenario: Main site on company.com, blog on blog.company.com, support on help.company.com

// On blog.company.com
window.Humblytics.trackPageView("/blog-post", {
  domain: "company.com",
});

// On help.company.com
window.Humblytics.trackFormSubmission("support-ticket", {
  domain: "company.com",
});

Third-Party Integration Tracking

Scenario: Main site on business.com, booking system on bookings.thirdparty.com

// On bookings.thirdparty.com
window.Humblytics.trackFormSubmission("appointment-booking", {
  domain: "business.com",
});

Foxycart Integration Example

This cross-domain tracking functionality powers our Foxycart integration:

<!-- In Foxycart custom footer -->
<script
  async
  src="https://app.humblytics.com/hmbl.min.js?id=YOUR_HUMBLYTICS_ID"
></script>

{% if context == 'checkout' %}
<script>
  window.Humblytics.trackPageView("/foxycart-checkout", {
    domain: "your-main-domain.com",
  });
</script>
{% endif %} {% if context == 'receipt' and first_receipt_display %}
<script>
  window.Humblytics.trackPageView("/foxycart-receipt", {
    domain: "your-main-domain.com",
  });
</script>
{% endif %}

Best Practices

Consistent Naming

Use clear, consistent naming for cross-domain events:

  • Page paths: Use descriptive paths like /checkout-start, /payment-complete

  • Event labels: Use descriptive names like checkout-form, newsletter-signup

  • Domain references: Always use your primary domain in the domain parameter

Event Organization

Structure your cross-domain events logically:

// Good: Descriptive and organized
window.Humblytics.trackPageView("/ecommerce/checkout", { domain: "main.com" });
window.Humblytics.trackFormSubmission("ecommerce-purchase", {
  domain: "main.com",
});

// Avoid: Generic or unclear naming
window.Humblytics.trackPageView("/page1", { domain: "main.com" });
window.Humblytics.trackFormSubmission("form", { domain: "main.com" });

Testing Your Implementation

  1. Install tracking on both domains

  2. Trigger test events on the external domain

  3. Verify in dashboard that events appear under your main domain

  4. Check attribution by following the complete user journey


Viewing Cross-Domain Data

All cross-domain events appear in your main dashboard exactly like native events:

  • Page Views: Dashboard → Pages

  • Form Submissions: Dashboard → Conversions → Forms

  • Click Events: Dashboard → Clicks

  • Funnels: Include cross-domain steps in funnel analysis

  • Split Tests: Use cross-domain events as conversion goals


Using Cross-Domain Events in Split Tests

Beyond just tracking cross-domain interactions, you can use these events as conversion goals in split tests. This enables sophisticated A/B testing scenarios where the conversion happens on external domains.

When to Use Cross-Domain Event Goals

Instead of simple destination page tracking, use cross-domain events when:

  • Complex conversion flows: The conversion involves multiple steps or specific interactions on external sites

  • Precise tracking: You need to track the actual conversion action, not just page arrival

  • External checkout processes: Track completed purchases on separate checkout domains

  • Third-party integrations: Monitor conversions through external booking systems, forms, or apps

Setup Process

Step 1: Implement Cross-Domain Event Tracking

Set up the appropriate tracking on your external domain:

// Example: Track checkout completion on external domain
window.Humblytics.trackFormSubmission("checkout-complete", {
  domain: "yourmainsite.com",
});

// Example: Track specific page interactions
window.Humblytics.trackClickEvent("external-signup-button", {
  domain: "yourmainsite.com",
});

// Example: Track custom page view events
window.Humblytics.trackPageView("/external-conversion-step", {
  domain: "yourmainsite.com",
});

Step 2: Create Split Test with Event Goal

  1. Navigate to Split TestingStart New Experiment

  2. Choose the appropriate event goal type:

    • Form Submission Event for trackFormSubmission() calls

    • Click Event for trackClickEvent() calls

    • Page View Event for trackPageView() calls

  3. Enter the exact event name from your tracking code (e.g., "checkout-complete", "external-signup-button")

Step 3: Configure Variants and Launch

Set up your page variants as normal and launch the test. The cross-domain events will be attributed to the correct split test variant based on the user's session.

Real-World Examples

Ecommerce Checkout Optimization

// Split test: Optimize product pages for checkout completion
// Goal: Track actual purchases, not just checkout page visits

// On external checkout domain
window.Humblytics.trackFormSubmission("purchase-complete", {
  domain: "store.com",
});

// Split test goal: Form Submission Event = "purchase-complete"

Lead Generation with External Forms

// Split test: Optimize landing pages for form completions
// Goal: Track successful form submissions on third-party platform

// On external form platform
window.Humblytics.trackFormSubmission("lead-qualified", {
  domain: "business.com",
});

// Split test goal: Form Submission Event = "lead-qualified"

SaaS Trial Activation

// Split test: Optimize signup flow for trial activation
// Goal: Track when users complete onboarding on external app

// On external app domain
window.Humblytics.trackPageView("/onboarding-complete", {
  domain: "marketing-site.com",
});

// Split test goal: Page View Event = "/onboarding-complete"

Advanced Attribution

Cross-domain event goals maintain proper attribution throughout complex user journeys:

  1. User visits your split test page variant

  2. User navigates to external domain (checkout, booking, etc.)

  3. Cross-domain event fires on external domain

  4. Attribution preserved back to original split test variant

  5. Conversion counted for the correct test group

This enables testing of complete conversion funnels that span multiple domains while maintaining accurate statistical analysis.

Best Practices for Split Test Goals

Event Naming:

  • Use descriptive, unique event names

  • Maintain consistency across domains

  • Document your event naming convention

Timing:

  • Ensure events fire after the Humblytics script loads

  • Place tracking calls at the actual conversion moment

  • Test event firing across different user scenarios

Validation:

  • Test the complete flow from split test variant to cross-domain conversion

  • Verify events appear in your dashboard with correct attribution

  • Monitor for any attribution delays or issues


Troubleshooting

Events Not Appearing

Check the following:

  1. Humblytics script is installed on the external domain

  2. The domain parameter matches your main domain exactly

  3. External domain is whitelisted (if required)

  4. Events are being triggered after the Humblytics script loads

Incorrect Attribution

Verify:

  1. The domain parameter value is correct

  2. Timing of event tracking (wait for script to load)

  3. Network connectivity from external domain to Humblytics


Advanced Implementation

Dynamic Domain Detection

For complex setups, you can dynamically set the domain parameter:

// Automatically detect main domain
const mainDomain = window.location.hostname.includes("checkout")
  ? "yourdomain.com"
  : window.location.hostname;

window.Humblytics.trackPageView("/current-page", {
  domain: mainDomain,
});

Conditional Cross-Domain Tracking

Only track cross-domain when necessary:

function trackEvent(eventType, eventName, options = {}) {
  const isExternalDomain = window.location.hostname !== "yourdomain.com";

  if (isExternalDomain) {
    options.domain = "yourdomain.com";
  }

  if (eventType === "pageView") {
    window.Humblytics.trackPageView(eventName, options);
  } else if (eventType === "formSubmission") {
    window.Humblytics.trackFormSubmission(eventName, options);
  }
}

Questions or need help with complex cross-domain setups? Email [email protected] for guidance on advanced implementations and custom attribution models.

Last updated

Was this helpful?