Install the Motif tracker
One deferred script. The id in the tag is public. Revenue still comes from Stripe Connect, not from this file.

Default snippet
<script defer src="https://collect.motiftrace.com/m.js" data-website-id="WEBSITE_ID" data-domain="example.com"></script>- src is https://collect.motiftrace.com/m.js until Websites shows your first-party host live. After that, src is that host. If you add the CNAME before you copy the tag, the tag is final.
- data-website-id is the UUID from Websites. It is required. Without it, the script does nothing.
- If signup is on the app origin, put the same tag and website id there. Use one Motif website. Do not create a second website for app.
- defer keeps the tag off the critical path.
What the tracker sends
Pageviews, identify, custom milestones, and a checkout join when Stripe's session_id is on the success page. URLs keep only the path plus allowlisted attribution parameters (utm_*, gclid, other click ids, and ext_id). The tracker never accepts a payment amount.
Localhost
On localhost, 127.*, ::1, *.local, and *.localhost, the tracker sends nothing unless the tag includes data-allow-localhost. Use that flag only for your own debugging, not for production.
If this product has a Chrome extension
Motif does not run in the extension. Hosted m.js on the web app is the only tracker. Open the product and keep the chrome-extension referrer (do not use noreferrer). First-touch becomes chrome_extension. After a real signup, call identify and signup_completed on the web app. Use the product user id, never an email.
const extId = chrome.runtime.id;
chrome.tabs.create({
url: `https://app.example.com/extension-login?ext_id=${encodeURIComponent(extId)}`,
});Replace app.example.com/extension-login with the path that the extension already uses. Motif matches the path /extension-login exactly. A query ext_id or a chrome-extension referrer also classifies the visit. Do not add a Motif SDK, package, or service-worker tracker. Do not inject Motif on other tabs.