Skip to main content

First-party tracker domain

By default the SDK is served from cdn.journeylayer.com and events are collected at collect.journeylayer.com. You can instead serve both from a subdomain of your own site — a first‑party tracker domain like track.yourdomain.com.

Why use it

  • Dodges ad‑blockers and tracking protection. Requests to your own subdomain are far less likely to be blocked than requests to a third‑party analytics host.
  • First‑party cookies & context. The whole pipeline runs under your domain.

How it works

You point a subdomain at JourneyLayer with a CNAME record. JourneyLayer serves the SDK and receives events on that host, and the SDK auto‑detects the endpoint from its own script URL — so once the CNAME is verified, both the script and the events are first‑party.

Set it up

  1. In the dashboard go to Settings → SDK / Install → First‑party tracker domain.

  2. Enter the subdomain you want to use, e.g. track.yourdomain.com.

  3. Add the CNAME record it shows you at your DNS provider.

  4. Click Verify. Once verified, the install snippet switches to your host:

    <script src="https://track.yourdomain.com/p/<PROJECT_PUBLIC_ID>/jl-script.js" async></script>

Until the domain is verified, the snippet safely falls back to the shared cdn.journeylayer.com host so your site never breaks mid‑setup.

Tracker domain vs. allowed domains

These are two different settings — don't confuse them:

SettingWhat it is
First‑party tracker domainThe host that serves the SDK and receives events (one per project).
Allowed website domainsThe page origins allowed to send events with your token.

The tracker domain is where the script lives; allowed domains are which websites may use it.