Track visitors across different domains

Monitor visitors seamlessly as they navigate between entirely different root domains (e.g., from example.com to myapp.io).

Looking to track across subdomains instead? See subdomain tracking -- it works automatically with no extra setup.

When to use cross-domain tracking

Cross-domain tracking is useful when you have multiple websites on different root domains that should be treated as a single user journey:

  • Marketing site on example.com and app on app.io
  • Main site on mysite.com and store on shop-mysite.com
  • Multiple brand domains with shared users

Setting up cross-domain tracking

  1. Open your website settings in Flowsery Analytics
  2. In the General tab, scroll to "Additional domains"
  3. Add the other domains you want to track (e.g., myapp.io)
  4. Install the tracking script on every domain using the same website ID, the same data-domain attribute, and include the data-allowed-hostnames attribute listing your additional domain(s):
<script
  defer
  data-fl-website-id="flid_******"
  data-domain="myapp.com"
  data-allowed-hostnames="myapp.io"
  src="https://analytics.flowsery.com/js/script.js"
></script>

Important: The data-allowed-hostnames attribute should contain a comma-separated list of all additional domains you want to track (excluding your primary domain).

How it works

When a user clicks a link to one of your allowed domains, Flowsery Analytics automatically appends tracking parameters (_fs_vid and _fs_sid) to preserve their visitor and session IDs across domains.

These URL parameters are automatically removed from the browser address bar after being captured, keeping your URLs clean.

Using the SDK instead of the script tag

If you are using the flowsery npm package instead of the script tag, cross-domain tracking works through manual helpers:

const flowsery = await initFlowsery({
  websiteId: 'flid_******',
  allowedHostnames: ['myapp.io'],
});

// Build a link URL with tracking params
const url = flowsery.buildCrossDomainUrl('https://myapp.io/signup');

// Or get the raw params to append yourself
const params = flowsery.getTrackingParams();

On the receiving domain, initFlowsery automatically picks up the _fs_vid and _fs_sid URL parameters and restores the visitor/session.