Blog
10 min read

Stripe Webhooks for Marketers: What They Are and Why They Fix Your Attribution

Stripe webhooks capture payment events server-to-server — immune to the 22% of pixel calls blocked by ad-blockers and Safari ITP. How marketers use them for attribution without writing webhook code.

TrackRev

Stripe Webhooks for Marketers: What They Are and Why They Fix Your Attribution

Stripe webhooks capture payment events server-to-server — immune to the 22% of pixel calls blocked by ad-blockers and Safari ITP. How marketers use them for attribution without writing webhook code.

Stripe webhooks fire server-to-server the instant a payment succeeds — before any browser event — making them immune to ad-blockers, Safari ITP, and iOS privacy settings that block 22% of client-side pixel calls. Browser pixels miss 23% of Stripe payments — ad blockers, cookie consent decline, and page-close-before-pixel-fire all cause silent drop-out. A Stripe webhook is an HTTP POST your Stripe account sends to your server the instant a payment event occurs, completely independent of any browser, cookie, or ad blocker — making it the most reliable attribution signal available to a SaaS marketing team. This guide explains what webhooks are in plain English, the four Stripe events every marketer should care about, and how to map each one to an attribution action without needing a developer on-call.

Key takeaway

A browser pixel fires only if the visitor's browser cooperates. A Stripe webhook fires on Stripe's infrastructure the moment money moves — before the browser gets involved. For revenue attribution, the webhook is always more reliable. The only question is whether you have a system to receive it and tie it back to a marketing click.

Why This Matters for Your Revenue

Attribution that depends entirely on browser-side pixels has a fundamental problem: the browser is not present at the payment. The payment happens in Stripe's infrastructure, not the visitor's tab. So if the tab closed, the visitor declined cookies, an ad blocker intercepted the pixel request, or the checkout redirect lost the session, the conversion never reaches your attribution layer. Your best-performing campaigns look worse than they are. Budget shifts to channels with less ad blocker exposure. Decisions compound on bad data.

Server-side webhook attribution breaks that dependency. When Stripe fires a checkout.session.completed event to your endpoint, your server receives it regardless of browser state. If you have already linked a visitor identifier to that Stripe session — which TrackRev does automatically — you can credit the correct marketing click without touching a browser at all. The result is attribution that matches your actual revenue, not your pixels' best guess.

What a webhook actually is (no jargon)

Think of a webhook as an automated text message that Stripe sends to your server when something happens — instead of you having to call Stripe every few seconds to ask "did anyone pay yet?"

How the message delivery works

When a customer completes a payment, Stripe immediately sends a small JSON package to a URL you specify. Your server reads that package and does whatever you have programmed it to do: update a database, send a welcome email, or — most relevant to attribution — record that a payment occurred and link it to the marketing click that brought the customer.

Webhook vs pixel: who sends the message

The key difference from a browser pixel is who sends the message. A pixel is fired by the customer's browser. A webhook is fired by Stripe's servers. The customer's browser can be blocked, closed, or misconfigured. Stripe's servers are not.

The 4 Stripe events marketers care about

Stripe emits dozens of event types, but for marketing attribution you only need four. These are the moments that map to real revenue changes — trial start, first charge, subscription creation, and recurring payment.

Stripe webhook events for attribution
checkout.session.completed
// Fires when a Checkout Session is paid. The primary event for
// attributing a new customer's first payment to a marketing click.

charge.succeeded
// Fires when any charge succeeds — including one-time payments that
// bypass Checkout. Use this as a fallback if you have multiple payment flows.

customer.subscription.created
// Fires when a new subscription is created (even on a free trial).
// Lets you attribute trial starts, not just paid conversions.

invoice.payment_succeeded
// Fires every time a recurring invoice is paid. Use for LTV tracking —
// credit the marketing channel every time a retained customer pays again.

How each event maps to an attribution action

Receiving the webhook is the first step. Connecting it to a marketing click is the second. Here is how each event should translate into an attribution record.

checkout.session.completed → new customer attribution

This is the highest-value event for marketing teams. When Stripe fires it, the payload contains the customer ID, the amount, and any metadata you passed into the Checkout Session — including a visitor token. TrackRev injects a trackrev_vid into the Checkout Session metadata automatically; when the webhook fires, it reads that token, looks up the original click, and records the conversion against the correct channel. No pixel required.

customer.subscription.created → trial attribution

Free trials that never convert are invisible in pixel-based attribution because no revenue changes hands. By listening to customer.subscription.created, you can attribute the trial start itself — and later compute trial-to-paid rates per channel. A channel that drives 50 trials but 40 conversions is better than one that drives 200 trials and 20 conversions. You cannot measure this without server-side events.

invoice.payment_succeeded → LTV attribution

Every recurring invoice that succeeds is additional revenue from a customer acquired by a specific channel. By crediting each renewal back to the original acquisition channel, you build a true LTV-per-channel view rather than just cost-per-acquisition. A paid social channel that looks expensive per new customer may look cheap per dollar of 12-month revenue. Read more in channel LTV by marketing source.

Webhook reliability vs browser pixel: the numbers

The reliability gap between server-side webhooks and browser-fired pixels is not theoretical. Based on TrackRev platform data across SaaS workspaces, webhook-based attribution captures measurably more conversions than pixel-only setups — particularly in the segments where high-value buyers concentrate.

Capture rate comparison by method

Attribution methodConversion capture rateBlocked by ad blockersAffected by cookie consentWorks after tab close
Stripe webhook (server-side)98%NoNoYes
Browser pixel (client-side)77%Yes (23% block rate)Yes (decline rate 15–40%)No
GA4 conversion event71%YesYesNo
Zapier Stripe trigger94%NoNoYes

Based on TrackRev platform data, 2026. Capture rates measured against Stripe dashboard totals across 120 SaaS workspaces.

Event-to-use-case mapping

Use caseBest webhook eventPixel alternativePixel gap
New customer acquisitioncheckout.session.completedThank-you page pixelTab close, blocker
Free trial startcustomer.subscription.createdNone reliableNo revenue = no pixel
First charge (non-checkout flow)charge.succeededRedirect pixelSame as above
Monthly/annual renewalinvoice.payment_succeededNoneRecurring; no page visit
Revenue by channel (LTV)invoice.payment_succeeded (all)Impossible client-sideNo session after signup

Stripe webhook events mapped to attribution use cases. Pixel gaps are structural — not fixable with better pixel placement.

Setting up Stripe webhook attribution without a developer

The traditional approach requires a developer to write endpoint code, deploy it, and maintain it. TrackRev removes that requirement.

No-code setup with TrackRev

You connect Stripe with a restricted API key (read-only), and TrackRev creates and manages the webhook endpoint on your behalf — listening for the four events above and automatically linking each payment to the click that preceded it via the visitor token. There is no server to configure, no code to write, and no endpoint to maintain.

Manual and Zapier-based alternatives

If you prefer to receive webhooks yourself and pass the data to TrackRev, the Stripe revenue attribution guide covers the manual connection. For teams using Zapier as middleware, the Zapier workflow guide covers how to chain Stripe webhooks into downstream actions. See also the comparison of server-side vs client-side tracking for a deeper technical breakdown.

How to verify your webhook is attributing correctly

After connecting Stripe, you need to confirm the full chain — from test payment to attributed conversion — before trusting live data.

Run a test payment in Stripe test mode

Run a test payment (Stripe's test mode accepts card number 4242 4242 4242 4242). In the TrackRev dashboard under analytics, the payment should appear within seconds with a channel label.

Troubleshoot unattributed payments

If it appears as "Unattributed," the visitor token was not passed into the Checkout Session — usually because the tracking script has not been placed before the checkout redirect. The UTM parameters and Stripe attribution guide covers the session-passing mechanics in detail.

Test before you trust

After wiring up webhooks, compare your TrackRev conversion count against your Stripe dashboard payment count for the same 7-day window. If they are within 2%, your attribution is solid. A gap larger than 5% usually means a second checkout flow (a legacy payment page or a third-party checkout) is not passing the visitor token.

Track Stripe webhooks automatically with TrackRev

TrackRev connects to Stripe in three minutes using a read-only API key and handles webhook receipt, visitor-token matching, and channel attribution with no code required. Every checkout.session.completed, customer.subscription.created, and invoice.payment_succeeded event is automatically linked to the tracking link the customer clicked — so your channel revenue figures match your Stripe revenue figures exactly. Start with the free tier (1,000 events/month) to verify attribution before committing to a paid plan.

When NOT to use TrackRev for this

If your Stripe account processes payments for multiple unrelated products with completely different marketing funnels, a single TrackRev workspace will mix attribution across them — you would need a workspace per product. Likewise, if your checkout is fully server-side with no browser session (B2B invoicing, sales-assisted deals, or API-only integrations), there is no first click to attribute to. Webhooks will capture the payment; there simply is no marketing click on record. For those deals, CRM-based attribution is more appropriate than click-based tracking.

Frequently asked questions

What is a Stripe webhook and how does it differ from a pixel?
A Stripe webhook is an HTTP POST that Stripe's servers send to your server the instant a payment event occurs. A pixel is a script that the customer's browser fires after a page load. The webhook is independent of the browser — it works even if the tab is closed, the browser blocks scripts, or the customer declines cookies. For payment attribution, webhooks are structurally more reliable.
Which Stripe webhook event should I use for new customer attribution?
Use checkout.session.completed for customers who pay through Stripe Checkout, and charge.succeeded as a fallback for non-checkout payment flows. Both events fire immediately when money changes hands and contain the customer ID needed to look up the originating marketing click.
Do I need a developer to set up Stripe webhook attribution?
With TrackRev, no. You connect Stripe with a read-only API key, and TrackRev manages the webhook endpoint automatically. If you want to receive webhooks on your own server and pass data to TrackRev, you need a developer for the endpoint — but that is optional. Most teams use the no-code connection.
Can Stripe webhooks track recurring revenue back to the original marketing channel?
Yes. Every time an invoice.payment_succeeded event fires for a subscription, you can credit that payment to the channel that acquired the customer originally. This gives you a true LTV-per-channel view rather than just cost-per-acquisition — which changes which channels look cheap or expensive.

Related articles

Stop guessing where your revenue comes from.

Set up TrackRev in 5 minutes. Free tier covers 1,000 events / month.