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,unsubscribeFromPushandgetPushPermission, plus thertn-sw.jsservice 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.jsto/sdk/0.7.0/rtn.min.js.
New in 0.6.0
- Smaller events.
context.attributiontravels only when the server may not have it: on the first event of a session, onorder_completed,checkout_startedandsigned_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
onDiagnostictoo_largereport 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.jsto/sdk/0.6.0/rtn.min.js. - Reports that read
context.attributionfrom 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: 2and a purpose-levelconsentsnapshot on every event. See Event Model. - Purpose-level consent.
setConsentPurposeandgetConsentPurposeforpersonalization,advertising,audiences, andreplay. See Consent. - Automatic interactions. Opt-in outbound link, download, and metadata-only form tracking, plus
trackDownloadandtrackOutboundLink. See Automatic Tracking. - Quality policies. SPA page filtering, global and per-event sampling and rate limits, reported through
onDiagnostic. - Confirmed attribution.
waitForAttributionreturns server-confirmed attribution with a local fallback. See Attribution. - Cross-domain identity.
decorateLinkandacceptLinkerTokencarry 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.jswhen you are ready. - Existing calls keep working:
setConsent(state)remains the shortcut for theanalyticspurpose. - The ingest edge still accepts v1 batches, so older pinned pages continue to deliver events during a staged rollout.
- If you rely on
pendinguntil your consent manager decides, passconsent: 'pending'toinit. Without it, a visitor with no stored decision starts asgranted.