RTN Docs

Web SDK · v0.6.0

What's New

Changes in Web SDK 0.7.0, 0.6.0 and 0.5.0 and how to upgrade.

New in 0.7.0

  • Web push. subscribeToPush, unsubscribeFromPush and getPushPermission, plus the rtn-sw.js service worker your store serves. Flows can then send browser notifications. See Web Push.

Upgrade from 0.6.0

  • Stable URL (/sdk/rtn.min.js): you already run 0.7.0. Nothing changes until you add web push.
  • Pinned URL: change /sdk/0.6.0/rtn.min.js to /sdk/0.7.0/rtn.min.js.

New in 0.6.0

  • Smaller events. context.attribution travels only when the server may not have it: on the first event of a session, on order_completed, checkout_started and signed_up, and until the ingest accepted a new touch. A typical event shrinks by more than half. See Attribution.
  • Return visits move the last touch. Coming back through the same campaign link after the session ended updates last_touch.at; a reload in the same session still does not.
  • Automatic cross-domain linking. The linker token is removed on load and exchanged once consent allows it; events wait for the carried-over identity, the token never reaches event data, and your own domain is not recorded as a referral. See Cross-Domain Identity.
  • Ingest limits enforced in the browser. Batches stay under 100 events and 500 KiB, and an event above 32 KiB is dropped with an onDiagnostic too_large report instead of being rejected by the server.

Upgrade from 0.5.0

  • Stable URL (/sdk/rtn.min.js): you already run 0.6.0.
  • Pinned URL: change /sdk/0.5.0/rtn.min.js to /sdk/0.6.0/rtn.min.js.
  • Reports that read context.attribution from arbitrary events should read the stored touches (waitForAttribution, server touch tables) or conversion events instead.
  • acceptLinkerToken() calls keep working; they now return the result of the automatic exchange.

New in 0.5.0

  • Event contract v2. Batches carry schema_version: 2 and a purpose-level consent snapshot on every event. See Event Model.
  • Purpose-level consent. setConsentPurpose and getConsentPurpose for personalization, advertising, audiences, and replay. See Consent.
  • Automatic interactions. Opt-in outbound link, download, and metadata-only form tracking, plus trackDownload and trackOutboundLink. See Automatic Tracking.
  • Quality policies. SPA page filtering, global and per-event sampling and rate limits, reported through onDiagnostic.
  • Confirmed attribution. waitForAttribution returns server-confirmed attribution with a local fallback. See Attribution.
  • Cross-domain identity. decorateLink and acceptLinkerToken carry one visitor across allowlisted domains. See Cross-Domain Identity.

Now documented

These APIs already shipped in 0.4.x and now have reference pages: pause / resume (Consent), beforeSend and redactPropertyKeys (Privacy Controls), onDiagnostic (Configuration), register / unregister, and getAnonymousId.

Upgrade from 0.4.x

  • Stable URL (/sdk/rtn.min.js): you already run 0.5.0. No change is needed.
  • Pinned URL (/sdk/0.4.x/rtn.min.js): change it to /sdk/0.5.0/rtn.min.js when you are ready.
  • Existing calls keep working: setConsent(state) remains the shortcut for the analytics purpose.
  • The ingest edge still accepts v1 batches, so older pinned pages continue to deliver events during a staged rollout.
  • If you rely on pending until your consent manager decides, pass consent: 'pending' to init. Without it, a visitor with no stored decision starts as granted.

On this page