Documentation

Stripe revenue

Record Stripe payments, and pass the visitor id at checkout so each payment credits the ad.

Connect your Stripe account so checkout.session.completed, invoice.paid, and related payment events become attributed conversions with source: stripe.

Portals:

Get credentials (signing secret)

Intently does not need your Stripe secret API key for revenue attribution. It needs a webhook endpoint on your Stripe account and the endpoint’s signing secret (whsec_…).

  1. Open Attribution settings and copy your dedicated webhook URL (includes your account id)
  2. In Stripe, open Developers → Webhooks (test mode vs live mode must match the account that takes payments)
  3. Add endpoint → paste the Intently URL
  4. Subscribe at least to:
  • checkout.session.completed
  • invoice.paid

Optional / advanced: payment_intent.succeeded, refund.created, refund.updated

  1. After creating the endpoint, open it → Reveal / Signing secret → copy whsec_…
  2. Paste the signing secret back into Intently → Save webhook secret

Intently verifies the signature and deduplicates payments via a stable stripePaymentKey so checkout + payment_intent pairs do not double-count.

Rotate the signing secret in Stripe if it leaks; paste the new whsec_… into Intently.

Credit the payment to the ad

The webhook above records the payment. It does not, by itself, attach that payment to an ad.

The visitor id is not in the Intently dashboard. The snippet on the checkout page creates a new one for each visitor when checkout starts. Your checkout has to pass that id to Stripe. Stripe sends it back on the webhook, and Intently uses it to credit the channel.

See the visitor id

Open your site in the browser, on any page where the Intently snippet is installed. Open the developer console (right-click the page, then Inspect, then Console) and paste:

await ADT.Attribution.getStripeCheckoutMetadataAsync()

The console prints the id for this visit. It is the value of intently_session_id.

To test a Payment Link with the visit you are on right now, paste that id onto the end of the link:

https://buy.stripe.com/your_link?client_reference_id=PASTE_THE_ID_HERE

That id belongs only to the browser you just used. It is the right value for a test. A link you send to a customer has to be built on the page when that customer clicks, with the same call, because their id is different.

You need both pieces below when your own code creates the Checkout Session. They run in different places.

1. On the checkout page

The Intently snippet must already be on this page.

const metadata = await ADT.Attribution.getStripeCheckoutMetadataAsync();

metadata looks like this:

{
  intently_session_id: "...",
  intently_user_hash: "..."
}

intently_session_id ties the payment to this visit. intently_user_hash is included when user tracking is on, so a later payment can still match an earlier visit.

Send metadata to your server in the same request that starts checkout. The server cannot read the snippet itself.

If you cannot use await, this version returns the session id only:

const metadata = ADT.Attribution.getStripeCheckoutMetadata();

2. Where the Checkout Session is created

Add metadata to the stripe.checkout.sessions.create call you already have. Leave mode, line items, and URLs as they are.

const session = await stripe.checkout.sessions.create({
  // mode, line_items, success_url, and cancel_url stay as they are
  metadata,
});

That call exists only when your own code creates the Checkout Session.

A Stripe Payment Link does not use checkout.sessions.create. If the link is on your page, append the visitor id to the URL. Get the id from the same snippet call as above.

const metadata = await ADT.Attribution.getStripeCheckoutMetadataAsync();
const url =
  paymentLinkUrl +
  "?client_reference_id=" +
  encodeURIComponent(metadata.intently_session_id);

Intently reads client_reference_id the same way it reads metadata.intently_session_id. Use it for the Intently visitor id, not an order number. An order number still creates a payment, and that payment stays unattributed.

A Payment Link that shoppers open with no code of yours cannot do this.

When you cannot change checkout

The webhook still records the payment. Intently lists it as Stripe revenue with no ad attached.

Ad credit can still come from a purchase or lead the snippet already tracks on the site. That path does not use this Stripe code.

Keys Intently accepts

FieldWherePurpose
metadata.intently_session_idCheckout Session or PaymentIntentThis visit
metadata.intently_user_hashCheckout Session or PaymentIntentSame person across visits, when user tracking is on
client_reference_idCheckout Session, or a Payment Link query stringThis visit, when you are not setting metadata

Also accepted as the session id: intentlySessionId, session_id. Also accepted as the user hash: intentlyUserHash, user_hash.

See also SDK reference.

Refunds

refund.created / refund.updated ingest as negative revenue adjustments so refunded dollars do not stay credited to channels.

Reporting

On /attribution, filter Stripe vs On-site vs All. KPIs separate Stripe revenue from track-event revenue. Unattributed Stripe counts surface as warnings with a link back to setup.

Next