Success URL and checkout join

Stripe already knows the money. Motif only needs to know which visitor owned the session.

A visitor path of cubes returning to a Thank You page, with a session token on the path.

Checkout Sessions you create

Keep Stripe's default placeholder on success_url:

https://yoursite.com/thanks?session_id={CHECKOUT_SESSION_ID}

{CHECKOUT_SESSION_ID} is Stripe's literal token. Do not replace it with a value from your database. When the customer opens that page, the tracker reports the pair one time per session id.

Payment Links, Buy Buttons, Pricing Tables

Before checkout, the tracker stamps client_reference_id with the visitor id. You do not need to add that parameter by hand. If you already set it, your value wins. Pricing Tables still need checkout_started from your code, because Motif cannot reliably see their checkout-only click.

Identify is a different join

After login, identify connects the same person across browsers. It is not a payment. Call it with the stable app id, never an email.

window.motif?.identify(currentUser.id)