How to Set Up the Conversions API for Stripe Checkout (Webhook to Events Manager)

A webhook-to-events-manager guide to server-side purchase tracking: the right Stripe event, a fast idempotent handler, and deduplication that holds up.

Top-down illustration of a wooden desk with a laptop, smartphone, diagram notebook, pen, and coffee mug.

Key takeaways

  • Fire the server purchase on checkout.session.completed and checkout.session.async_payment_succeeded, and skip fulfilment when payment_status is unpaid.
  • Answer the webhook with a 2xx immediately: Checkout waits up to 10 seconds for that response before redirecting the buyer to your thank-you page.
  • Stripe retries failed deliveries for up to three days with exponential backoff and doesn't guarantee event order, so make the handler idempotent on event ID and pass a session-based idempotency key downstream.
  • Normalize and hash identifiers with SHA-256 (trim, lowercase, E.164 phone format) or the event lands unmatched in Meta and Google.
  • Expect roughly 20 minutes for a test event to show in Events Manager, then remove the test code and check one live purchase moves the count by exactly one.

You set up the Conversions API for Stripe Checkout with a Stripe webhook. Point it at a public HTTPS endpoint that fires on checkout.session.completed. Read the order and customer data from that session. Then post a server-side purchase event to Meta (and Google) with the event ID the browser pixel used.

The event choice matters more than the code. A handler built on payment_intent.succeeded double-counts orders. It catches payments from other services on the same Stripe account. It also silently misses free trials and 100% coupons. None of these failures throws an error you'd notice.

The six steps below cover six tasks. Register the endpoint and check the signature. Answer fast enough that Checkout doesn't stall the buyer. Pull line items the payload leaves out. Hash identifiers correctly. Share one event ID across both paths. Confirm the whole thing in Events Manager and Google Ads. There's a server-side tracking checklist you can work through in order, from the event map to a live production test. It also covers the two mistakes that quietly break deduplication.

What you need to set up the Conversions API for Stripe Checkout

Four things have to be in place before a purchase event reaches Meta. You need a pixel ID and a Conversions API access token, plus a public endpoint Stripe can reach. You also need the customer identifiers saved on the order, and one shared event ID per action.

The Conversions API is the server half of a pair. The browser pixel fires on the page, and your server sends the same purchase once Stripe confirms payment. The browser half has gotten less reliable: which checkout signals still survive on Safari after iOS 14 covers why pixel purchases go missing. Adobe recommends running both paths with the same events, so what one misses, the other recovers (sending the same events from the client side and server side).

  • Pixel ID and access token. Configuring the Meta extension takes a Pixel ID. The Conversions API needs its own access token on top of that.
  • A public endpoint. An HTTPS URL Stripe can reach from outside your network. For local testing you can forward events to localhost with the Stripe CLI; a registered endpoint itself has to be a public HTTPS URL.
  • Identifiers stored on the order. Email and any other customer fields have to be written at checkout. You can't hash what the webhook never received.
  • One event ID per action. Generated once, shared with the pixel. Two IDs means two purchases in Meta.

Send close to real time. Delayed server events hurt ad campaign optimization, so a nightly batch job is the wrong shape for this.

Which Stripe event should fire the server-side purchase

Fire the server-side purchase on checkout.session.completed and checkout.session.async_payment_succeeded. Only fulfill the order when the session's payment_status is not unpaid. That pairing is the correct fulfilment trigger for Stripe Checkout: one object, one event, one status field. Check it before anything ships or gets reported.

The tempting alternative is payment_intent.succeeded, because it sounds like "the money arrived." Three things break if you build on it.

  • Double processing. Subscribe to both events for the same order and you're handling the same payment described from two different objects. A handler that acts on both ships twice.
  • Traffic from elsewhere. payment_intent.succeeded is account-wide. Payments from other services and Billing invoices on the same Stripe account arrive in your Checkout handler too.
  • Silent drops. Free trials, full-discount coupons and zero-total carts complete Checkout but never produce a payment_intent.succeeded event. A PaymentIntent-only setup loses those orders with nothing in your error logs.

Async payment methods are the one real exception. They settle after the session completes, which is why async_payment_succeeded belongs in the subscription list alongside the completed event.

Step 1: Register the webhook endpoint and confirm requests come from Stripe

Two things must work first: a publicly accessible HTTPS URL and a signature check at the top of the handler. Stripe puts a signature in the Stripe-Signature header for every event. Verify that signature against the endpoint's signing secret before reading the payload. A request that fails the check didn't come from Stripe: return a 400 and stop there.

  • Deploy the handler to an HTTPS URL Stripe can reach. localhost won't work, so use a tunnel or the Stripe CLI.
  • Copy the endpoint's signing secret into your environment variables, never into the repo.
  • Verify Stripe-Signature on every request before parsing the event.
  • Subscribe only to the event types this flow needs (checkout.session.completed and checkout.session.async_payment_succeeded). Listening for extra events or all events puts undue strain on your server, and Stripe doesn't recommend it.
  • For local testing, run the Stripe CLI's stripe listen command. It prints the webhook signing secret to drop into your code and forwards live events to your machine.

If the checkout already runs on Sofunnels, there's no endpoint to host or sign. On Basic and Pro, Sofunnels checkouts charge through your own Stripe account and send Meta CAPI and server-side Google events for you.

Step 2: Answer fast, queue the real work, and make the handler idempotent

Return a 2xx as soon as the signature checks out, then hand the event to a queue. Receipt PDFs, Slack pings and API calls belong in a worker, not in the request.

The redirect is the reason. With a success_url set, Checkout waits up to 10 seconds for your endpoint to answer checkout.session.completed before it sends the buyer to your thank-you page. Blow that window and a paying customer watches a spinner.

Stripe's retries are patient. Failed deliveries are retried for up to three days with exponential backoff in live mode, so a bug you fixed on Monday can replay on Thursday with a session that has since been refunded. Order isn't guaranteed either: Stripe doesn't deliver events in the order they were generated, so an event created later can arrive before one created earlier. Read the state you need from the payload, not from what you assume already happened.

Then make the handler idempotent, twice over. Log the event IDs you've processed and skip anything already on that list, and pass an idempotency key tied to the session ID to Meta, so a repeat call updates nothing.

Step 3: Pull line items, order ID and a valid timestamp out of the session

The checkout.session.completed payload is not the whole order. It does not include line items. Fetch the session again with expand: ["line_items"] and build the event from that response: product names, quantities, amounts, currency. Do this inside the queued job, not in the webhook handler.

Two fields trip people up:

  • Order ID. Send one unique transaction ID per conversion. Use either the session ID (cs_...) or your own order number. Pick one format and use it on every platform. Mixing them across Stripe, Meta and Google is how the same sale gets counted twice.
  • Timestamp. Use the session's created value or your own Date.now(). Convert it to ISO 8601 with an offset, like 2026-11-23T14:32:07+01:00. The time must fall after the ad click and carry a timezone offset. A bare local time or a UTC value with no marker gets rejected, or lands in the wrong day.

If anything downstream reads the PaymentIntent, set those same values again. Session metadata is not copied to the PaymentIntent, so pass them through payment_intent_data.metadata when you create the session.

Step 4: Hash and normalize customer identifiers before they leave your server

Send SHA-256 hashes of email addresses and phone numbers, never the raw values. Google requires both to be hashed with SHA-256 before being imported as conversion data, and Meta's identity parameters work the same way: identity data must be hashed before it can be sent to the API.

The hash only matches if the input is byte-for-byte identical every time. Before hashing:

  • Trim leading and trailing whitespace.
  • Lowercase the text.
  • Format phone numbers to E.164, so +14155550132 rather than (415) 555-0132.

That's the order Google gives to standardize hash results. A trailing space or a capital letter produces a different digest, and the event lands unmatched.

Keep the raw email in your own database and hash at the moment you build the request. On the Google side, enhanced conversions for leads uses hashed user-provided data such as email addresses to supplement imported offline conversions, which Google says improves accuracy and bidding. Capture it where the customer types it: the Google tag is the most durable way to collect that form data.

Step 5: Share one event ID between the pixel and the server so Meta deduplicates

Deduplication only works when the browser and the server send the same event ID for the same action. Create that ID once, where the purchase happens. Pass the same value to both sides: eventID in the pixel call and event_id in the server request. Meta asks for an event ID and a name on every event. That applies to events you send from both the client and the server (Adobe Experience League).

Illustration of hands holding and comparing two paper receipts side by side over a desk with a laptop in the background.
Two records of one purchase: matching event IDs collapse into a single event.
Which fields have to match between the browser pixel and the server event
LayerID fieldEvent name fieldExample
Browser (Pixel)eventIDevent namePurchase
Server (Conversions API)event_idevent_namePurchase
What breaks itA new ID generated on each sidepurchase instead of PurchaseTwo conversions, no merge

The pixel's eventID must match the Conversions API's event_id, and the event names must match on both sides too (Serkan Kaya). Case counts: a browser sending Purchase and a server sending purchase are tallied separately.

When the ID and name line up, Meta collapses the pair and keeps the most relevant data (Adobe Experience League). The single most common mistake is creating the event_id twice: once on the browser and once on the server. Then the identifiers never match, so nothing deduplicates (UnfoldCRO). Matching also only happens inside a limited window. Send the server copy the same day rather than from a weekly sync.

Step 6: Verify the events in Meta Events Manager and Google Ads

Send the server purchase with a test event code. Meta shows it as "Send as Test Event" in the payload. Then fire a real purchase and look for it in Events Manager. Expect a wait of up to about 20 minutes before the event appears (Meta event verification timing). The test code confirms server events arrive as expected without polluting live data (test event code setup).

Next, open Meta's Test Events tool and fire one real action. The browser and server copies should both land with the same event_id and the same event name (what to check in Test Events). If you see two separate events instead of one, your IDs differ.

On the Google side, set the upload request's partial failure option to true. Valid conversions then import while bad rows return individual errors you can fix (partial failure).

Then remove the test code, run one live purchase, and check the conversion count moved up by exactly one.

Questions

Do I still need the Meta Pixel if the Conversions API is set up on my Stripe checkout?

Yes. Keep the pixel and send the same purchase from both paths, because Adobe recommends running the client and server copies together so one recovers what the other misses. The pixel also picks up browser identifiers the webhook never sees, and deduplication stops the pair from counting twice.

Why are my Stripe purchases showing up twice in Meta Events Manager?

Usually because the browser and server copies don't share an event ID, or the event names don't match case for case. Creating the event_id separately on each side is the most common cause, and Purchase versus purchase gets tallied as two events. A handler that fires on both checkout.session.completed and payment_intent.succeeded produces the same result.

Can I set this up without writing a webhook handler?

Yes, if something else owns the server call. A hosted checkout that already sends server-side events, or a tag manager server container listening to your checkout, removes the endpoint, signature check and queue work. You still have to confirm one event ID reaches both the browser and the server copy.

Do I need a separate setup for Google Ads conversions from Stripe?

Yes. Meta and Google take different payloads, so Google needs its own upload with SHA-256 hashed email and phone, a unique transaction ID per conversion, and a timestamp that includes a timezone offset and falls after the click. Turn on partial failure so valid rows import while bad rows return individual errors.

Where do I find the fbp and fbc values if my checkout is hosted by Stripe?

You probably can't. Those values come from Meta's browser cookie, set on your own domain, and a checkout running on Stripe's domain won't have it. Meta can fall back to matching on fbp when a server event arrives without an event_id, but that is less dependable, so send a shared event ID and hashed email instead.

Does this work for Stripe subscriptions and installment payments, or only one-time purchases?

It covers the checkout itself, so subscription and payment-plan purchases report the first sale the same way a one-time order does. Free trials and fully discounted first invoices also complete Checkout, which is why the session events catch them. Later renewals arrive as Billing charges rather than new Checkout sessions, so plan for those separately.

Sources

  1. Receive Stripe events in your webhook endpoint, Stripe
  2. Checkout Session Completed vs Payment Intent Succeeded, Webhooker
  3. Manage offline conversions, Google for Developers
  4. Meta Conversions API extension overview, Adobe Experience League
  5. Meta Deduplication: How to Use event_id With Pixel and CAPI, Serkan Kaya
  6. Event Deduplication for Meta Pixel and Conversions API, UnfoldCRO