Security · website tracking

Tracker security

The ReachOut tracker runs in your visitors' browsers, so anything it sends can also be sent by someone else. This page explains what the client ID and the allowed origins do and do not protect, and how verified events keep automations and contact data in your hands.

The client ID is public

Every page that loads the tracker carries its client ID (cl_…) in the snippet. Anyone can read it and send events to /track with it, from a browser or from a script. Treat it like a public identifier, not like a password: it names your website, it does not prove that a request came from it.

Allowed origins

When a website has allowed origins, /track compares the request's Origin header with the list and refuses any other origin with 403 ORIGIN_NOT_ALLOWED. A website without allowed origins accepts every origin.

Browsers set the Origin header themselves, so the list stops other websites from using your client ID in their visitors' browsers. A script or a server can set any Origin header it likes, so the list does not stop someone who forges requests on purpose.

Set the allowed origins when you add the website in Studio (Settings → Tracking clients), and change them later with Edit allowed origins in the website's menu. Enter each origin as the scheme and host only, like https://mysite.com: an entry with a path would never match, so ReachOut refuses it. Over the API, use PATCH /api/projects/:projectId/tracking-clients/:id or the MCP tool update_tracking_client.

What a forged event can and cannot do

It can

  • Add page views and events to your analytics, as on any client-side analytics tool.
  • Create placeholder contacts that hold only a profile ID, without an email address or a name.
  • Avoid the bot filter: known bots are recognized by their user agent, which a script can also set.

It cannot

  • Change a contact that already exists: an unverified identify leaves it untouched.
  • Give a contact an email address, a name or custom fields: only a verified identify stores them.
  • Make ReachOut email an address it supplied: automations never send to an address that came from the browser.
  • Start automations, while the website lets only verified visitors start them (the default).

Verified events

An event is verified when your server vouches for it, in one of two ways:

  • Client secret. A server-side SDK sends the website's client secret with the event, and ReachOut checks it.
  • Identity token. Your server signs a short-lived token for the signed-in visitor's profile ID, and the page passes it to identify. Every later event of that visitor carries it.

Each website chooses Who can start automations in Settings → Tracking clients:

  • Verified visitors only (default): an event starts an automation only when it is verified. Unverified events still count in analytics, and the website lists their refusals as Visitor identity not verified.
  • Any identified visitor: identities set in the browser also start automations. Anyone who knows or guesses one of your contacts' profile IDs can then make the website send that contact its automated emails. ReachOut still sends only to contacts whose address came from an import, the API or a verified identity, and the per-recipient cap still applies. Choose it only when that risk is acceptable.

Sign identity tokens on your server

Create a signing key in Settings → Tracking clients. Studio shows its keyId and signingKey once; store them with your server's secrets. When you rotate the key, the previous one keeps verifying for 7 days.

A token is ro-id1.<keyId>.<exp>.<signature>, where <exp> is a Unix time in seconds at most 24 hours ahead and the signature is the base64url HMAC-SHA256 of ro-id1|<keyId>|<clientId>|<profileId>|<exp>, keyed with the base64url-decoded bytes of the signing key. On a project connected to Pulse, sign <collection>:<profileId> in place of <profileId>.

import { createHmac } from 'node:crypto';

// keyId and signingKey come from Settings → Tracking clients → Create signing key.
// Keep them on your server, never in the page.
export function identityToken({ keyId, signingKey, clientId, profileId }) {
  const exp = Math.floor(Date.now() / 1000) + 3600; // at most 24 hours ahead
  const signature = createHmac('sha256', Buffer.from(signingKey, 'base64url'))
    .update(`ro-id1|${keyId}|${clientId}|${profileId}|${exp}`)
    .digest('base64url');
  return `ro-id1.${keyId}.${exp}.${signature}`;
}
// In the page, after your server rendered the token for the signed-in user:
window.ro('identify', 'user_42', { token: '<token from your server>' });

A token vouches for one profile on one website until it expires. Mint it only for the visitor your server has authenticated, and never for a profile ID taken from the request.

Client secret

The client secret is for server-side SDKs only (Node and Express). The Astro component runs the browser tracker, so it never needs the secret. When a website has a secret, ReachOut refuses server-side events that omit it or send a wrong one (MISSING_CLIENT_SECRET, INVALID_CLIENT_SECRET). Never put it in code that reaches the browser. If it leaks, rotate it in Settings → Tracking clients: the old secret stops working at once.

Checklist

  1. Give every website the allowed origins it really serves.
  2. Keep Who can start automations on Verified visitors only.
  3. Sign identity tokens on your server for signed-in visitors, and pass them to identify.
  4. Keep the client secret and the signing key on the server, and rotate them if they leak.
  5. Read website analytics knowing that client-side counts can be inflated by forged events.