Cross-Domain Tracking

Cross-domain tracking ensures that visitor attribution and conversion events are properly tracked when users navigate between different domains or subdomains within your website ecosystem.

Understanding Cross-Domain Tracking

Cross-domain tracking is essential if your business operates across multiple domains or subdomains. Without proper configuration, analytics platforms will treat visits to different domains as separate sessions, leading to broken attribution paths and missing conversion data.

Common Scenarios

  • Multiple Subdomains: www.example.com, blog.example.com, shop.example.com
  • Different Domains: example.com, example-shop.com, example-blog.com
  • International Sites: example.com, example.co.id, example.sg

Why It Matters

Without cross-domain tracking, each domain visit counts as a new session:

❌ Without Cross-Domain Tracking:

  • User visits www.example.com → Session 1 starts.
  • User clicks to shop.example.com → Session 1 ends, Session 2 starts.
  • Conversion on shop.example.com is not attributed to the original traffic source (e.g., Facebook Ads).

✅ With Cross-Domain Tracking:

  • User visits www.example.com → Session continues seamlessly.
  • User clicks to shop.example.com → Uses the same session ID.
  • Conversion is properly attributed to the original traffic source.

Konektor Implementation

1. Configure Tracking Parameters

Update your Konektor tracking code to include the cross-domain configuration:

konektor('init', 'WS-YOUR-WORKSPACE-ID', {
    crossDomain: {
        domains: ['example.com', 'shop.example.com', 'blog.example.com'],
        autoLink: true,
        forwardKParams: true // Optional: forward k_* query params from current page URL
    }
});

Ensure links between your domains include attribution parameters. By default, if autoLink: true is enabled, Konektor will attempt to do this automatically. However, for better control, you can ensure the link format looks like this:

<!-- Using a link with forwarded parameters -->
<a href="https://shop.example.com?utm_source=website&utm_medium=referral&_k_ref=www.example.com">Shop Now</a>

3. Dashboard Configuration

In the Konektor dashboard, configure your domain settings:

  1. Go to Settings > Tracking > Cross-Domain.
  2. Add all your domains and subdomains.
  3. Enable "Automatic Parameter Passing".
  4. Save and test the configuration.

Platform-Specific Settings

Each advertising platform handles cross-domain tracking differently.

Meta (Facebook) Cross-Domain

Ensure your Pixel is configured to allow first-party cookies on all subdomains.

// Meta Pixel with automatic cross-domain support
fbq('init', 'YOUR_PIXEL_ID', {}, {
    autoConfig: true
});

Enable Auto-tagging in your Google Ads account settings. This ensures the gclid parameter is passed to all URLs. Make sure Google Analytics (GA4) is also configured in its admin panel to recognize your domains within a single Data Stream.

TikTok Cross-Domain

Ensure the TikTok Pixel is installed on all domains and use the Pixel Helper Developer Mode to verify that ttclid or the related cookie is readable across both domains.

Technical Implementation

For persistent session IDs, cookies must be set at the highest level domain (TLD) if using subdomains.

// Example: Setting cookie domain to be readable across all subdomains
document.cookie = "_k_session=123; domain=.example.com; path=/; secure";
For Developers

Konektor automatically handles domain cookie settings (.example.com) if it detects you are on a subdomain. However, for different TLDs (e.g., .com to .co.id), parameters must be passed via URL query strings because cookies cannot be shared across different TLDs.

Advanced Features

Custom Attribution Rules

Create custom rules for complex cross-domain scenarios:

// Custom attribution for specific domain transitions
konektor('setAttributionRule', {
    fromDomain: 'blog.example.com',
    toDomain: 'shop.example.com',
    attribution: 'blog_traffic',
    credit: 0.3 // 30% attribution credit
});

Hierarchical Domain Structure

Handle complex domain hierarchies:

example.com (main)
├── shop.example.com (ecommerce)
├── blog.example.com (content)
├── support.example.com (help)
└── app.example.com (SaaS platform)

International Domain Handling

Manage attribution across regional domains:

konektor('init', 'WS-YOUR-ID', {
    internationalDomains: {
        'example.com': 'us',
        'example.co.uk': 'uk',
        'example.de': 'de'
    }
});

Testing Cross-Domain

1. Manual Testing

  1. Open your main domain (e.g., www.example.com) with dummy UTM parameters (?utm_source=test).
  2. Click a link pointing to your second domain (e.g., shop.example.com).
  3. Check the URL on the second domain. The UTM parameters or _k_ref parameter should be present.
  4. Perform a test conversion and check the dashboard to see if the source is recorded as "test".

2. Automated Testing

Use Konektor's debug mode:

konektor('test', 'cross_domain', {
    fromDomain: 'www.example.com',
    toDomain: 'shop.example.com'
});

Common Issues and Solutions

Attribution Loss

Problem: Parameters disappear when switching domains. Solution: Ensure autoLink: true is enabled or add manual link decoration scripts if you are using an SPA (Single Page Application) framework that renders links dynamically.

k_* Custom Params Not Forwarded

Problem: Rotator/form links do not carry k_* params from the current page URL. Solution: Enable crossDomain.forwardKParams: true in konektor('init', ...). This option only forwards keys with k_ prefix and does not override keys already present on the destination link.

Unreadable Cookies

Problem: Login or user session resets when switching subdomains. Solution: Ensure cookie domain configuration starts with a dot (e.g., .example.com) to apply to all subdomains.

SSL Issues

Problem: Security warnings or unsaved cookies. Solution: All domains MUST use HTTPS. Modern cookies with SameSite=None; Secure attributes only work on HTTPS.

Next Steps

:::tip Pro Tip Start with a simple two-domain setup. Ensure the data flow is smooth before adding a third or fourth domain to your tracking ecosystem. :::

:::warning Important Cross-domain tracking requires consistent protocols (HTTPS) across all domains for safe cookie and parameter passing. :::

Need More Help?

Our team is ready to help you maximize ad tracking and business attribution.

Email Supportsupport@konektor.id
YouTubeYouTube

© 2026 Konektor. All rights reserved.