← Documentation

Connect Stripe Checkout revenue

Configure signed webhook delivery and include the metadata needed for revenue attribution.

What the first release measures

VisitLift measures positive, paid Stripe Checkout payments received after the connection is configured. Initial paid subscription Checkouts are included. Subsequent invoices, free trials that charge later, refunds, disputes, processing fees, historical backfills, MRR, and net revenue are outside this release.

Keep currencies separate. The gross collected amount may include tax. Use Stripe or your accounting system for financial reconciliation beyond this scope.

Configure the webhook destination

Open the Stripe connection in workspace Settings and copy its webhook URL. In your Stripe account, create a snapshot webhook destination for checkout.session.completed and checkout.session.async_payment_succeeded. Copy its signing secret into VisitLift. Your Stripe API secret key is not required.

Use the test secret for test delivery and a live secret for live delivery. Secrets must remain server-side. The collector verifies signatures and counts a Checkout only when it is paid and its amount is positive.

Attach the site and attribution token

When persistent attribution is enabled and the visitor has granted consent, request a token in the browser and pass it to your own server when you create Checkout. Without a token, you can still include visitlift_site_id to record verified but unattributed revenue.

Your own server creates the Checkout Session using your Stripe credentials. Treat the browser token as optional, validate your application’s normal checkout inputs, and never move Stripe secret keys into the client.

// Browser: pass this optional value to your checkout API.
const token = await window.visitlift?.getAttributionToken();

// Server: add metadata when creating the Checkout Session.
metadata: {
  visitlift_site_id: "YOUR_SITE_ID",
  ...(token ? { visitlift_attribution_token: token } : {})
}

Verify a controlled test purchase

Start with a tagged campaign link, grant attribution consent through your site’s consent flow, and complete a test Checkout. Check the event delivery in Stripe and the connection’s latest webhook timestamp. Test payments must remain separate from live reports.

Reuse or create a Stripe Customer for accurate distinct-customer counts. Payments without a Customer ID count as revenue but reduce customer-count coverage. A Session is counted once even if Stripe retries its delivery.

Understand unmatched payments

A recognized site with a missing, expired, or invalid attribution token is Unattributed. A payment missing valid site metadata is Unassigned at workspace level. These categories are visible instead of being silently labeled Direct.

Attribution follows the last non-direct touch within 30 days and is frozen when the Checkout token is issued. It represents an attribution rule, not proof of marketing causation.