Stripe revenue attribution

Connect Stripe to your Clickport site with a read-only restricted key and revenue shows up next to your traffic: a Revenue KPI, a revenue line on the main chart, and payments attributed back to the visit that made them. For sites selling through Stripe Payment Links or hosted Checkout, attribution works with zero code changes.

Cookie-free attribution, honestly scoped. Clickport joins each payment to the single session that clicked through to checkout. There is no cross-session identity, so you get session attribution: the source, campaign, and channel of the visit that bought. What you don't get, by design, is customer lifetime tracking across weeks of return visits. No cookies means no persistent identity, and we don't fake one.

What you see in the dashboard

Once revenue events exist, a Revenue KPI appears in the KPI row with a comparison against the previous period of equal length. Click it to toggle a revenue line onto the main chart, bucketed exactly like the other metrics (hourly, daily, weekly, monthly, following your date range).

Revenue takes the cell that normally shows Views/Visit, which is pageviews divided by visitors, so the row keeps its size. Pick a date range without revenue and Views/Visit returns.

Dashboard · KPI row
Revenue joins the KPI row automatically
It appears once revenue events exist in the selected range. No configuration.
Visitors
4,218+12%
Pageviews
11,067+8%
Bounce
42%-3%
Duration
2m 14s+5%
Revenue
€3,842+18%

Because every attributed payment carries its session's dimensions, revenue works with the rest of the dashboard:

  • Cross-filtering: filter to a source, campaign, country, or device and the Revenue KPI re-computes for that slice. "How much did the newsletter earn last month" is one click on the Campaigns panel.
  • Custom events: Purchases and Refunds appear as events in the Goals panel's custom events list, with revenue totals and averages.
  • Goals and funnels: add a custom-event goal on Purchase and funnels can end at the payment, with real amounts behind the conversion step.
  • Refunds net out: a refund lands as a negative revenue event attributed to the same session as the original purchase, so per-source revenue stays honest.

How to connect

Setup is one paste. Clickport never asks for your full Stripe secret key, only a restricted key you scope yourself.

  1. In Stripe, open Developers → API keys and click Create restricted key.
  2. Grant it: Charges — Read, Checkout Sessions — Read. Optionally add Webhook Endpoints — Write (see the sync modes section below). Everything else stays None.
  3. Copy the key (it starts with rk_live_).
  4. In Clickport, open Settings → Integrations for your site, click Connect with restricted key on the Stripe card, and paste it.
Settings · Integrations · Stripe
Paste a restricted key, done
Full secret keys are rejected on purpose. Restricted keys only.
Restricted key from Stripe → Developers → API keys
rk_live_••••••••••••••••••••••••
Connect

On connect, Clickport validates the key, imports the last 90 days of payments as a backfill, and starts syncing new ones. Revenue from the backfill appears within a few minutes.

Sync modes

  • Real-time (recommended): if the key includes Webhook Endpoints — Write, Clickport creates a webhook endpoint on your Stripe account automatically. Payments appear in the dashboard the moment they land. The endpoint is signed and verified; it is removed again when you disconnect.
  • Periodic: without the webhook scope, Clickport pulls new payments every 10 minutes. Same data, small delay.

How attribution works

Clickport's tracker knows its own session ID. When a visitor clicks a link to buy.stripe.com or checkout.stripe.com, the tracker appends that session's token to the URL as Stripe's client_reference_id parameter, a passthrough field Stripe returns with the completed payment. Clickport joins it back to the session, and the payment inherits the visit's source, campaign, channel, country, and device.

That covers Stripe Payment Links and hosted Checkout with no code changes at all. Nothing to install beyond the tracker you already have.

Server-created Checkout Sessions

If your backend creates Checkout Sessions via the Stripe API, pass the token yourself. It's one line: read it from the tracker with clickport.checkoutRef() and hand it to Stripe as client_reference_id.

// In the browser: send the token to your backend with the checkout request
const ref = window.clickport.checkoutRef(); // "cp-1234567890"

// On your server: pass it when creating the Checkout Session
const session = await stripe.checkout.sessions.create({
  client_reference_id: ref,
  line_items: [...],
  mode: 'payment',
  success_url: 'https://example.com/thanks',
});
What stays unattributed. Payments with no checkout reference still count toward total revenue, just without a source: charges created directly via the API, invoices, and subscription renewals after the first payment. Recurring renewals can't be attributed honestly in a cookie-free model — the renewal happens without a visit — so we don't pretend otherwise. Each purchase carries an attributed property so you can see the split in the event's property breakdown.

Manual revenue tracking still works

The Stripe integration and the custom events API compose. If you sell through something else entirely, or want revenue on non-payment events, keep using:

clickport.track('Order Completed', { plan: 'yearly' }, { amount: 149, currency: 'EUR' });

The Revenue KPI and chart line sum every event that carries revenue, whichever way it got there.

Multi-currency

Amounts are recorded in the currency Stripe charged. Zero-decimal currencies (yen, won, and friends) are handled correctly. If your store charges in several currencies, the dashboard currently displays totals in your dominant currency without converting between them; keep that in mind when reading mixed-currency sums.

Disconnecting

Click Disconnect Stripe on the Integrations card. Clickport deletes the encrypted key immediately and removes the webhook endpoint it created on your Stripe account. Revenue already imported stays in your analytics; reconnecting later won't double-import it, because every processed payment is remembered by its Stripe ID.

Troubleshooting

"Use a restricted key"

You pasted a full secret key (sk_live_...). Clickport refuses those on purpose — create a restricted key instead (Stripe → Developers → API keys → Create restricted key) and grant only the scopes listed above.

"The key needs read access to Charges"

The restricted key exists but lacks the Charges — Read permission. Edit the key in Stripe, set Charges to Read, and paste it again.

Payments arrive but show as unattributed

  • The buyer must have the Clickport tracker loaded on the page where they clicked the checkout link. If your checkout button lives on a page without the tracker (a separate landing page, an email), there's no session to join.
  • If the checkout link already carries its own client_reference_id, Clickport never overwrites it — those payments stay unattributed rather than clobbering your reference.
  • Server-created Checkout Sessions need the one-line checkoutRef() pass-through shown above.
  • Ad blockers that block the tracker also block attribution for that visitor. The payment still counts via Stripe, just without a source.

Revenue totals differ from the Stripe dashboard

Clickport counts succeeded payments minus refunds, timestamped at payment time in your dashboard timezone. Stripe's own reporting may use settlement dates, include fees, or group by UTC days. Small windowing differences at day boundaries are normal.

Privacy and data handling

  • Your restricted key (and the webhook signing secret, in real-time mode) is AES-256-GCM-encrypted at rest. Disconnecting deletes it immediately.
  • The key is read-only by your own scoping; Clickport cannot modify anything in your Stripe account beyond the webhook endpoint you optionally allow it to create.
  • Clickport stores the payment amount, currency, timestamp, and Stripe object IDs. No customer names, emails, or card details are read or stored.
  • Attribution uses the session token alone. No cookies, no fingerprinting, no cross-session identity. Connecting or disconnecting the integration is recorded in your site's audit trail.