Stripe
Pingado reads trials, purchases, renewals and refunds from Stripe webhooks, and links each one to the visitor who paid.
1. Add the webhook
Section titled “1. Add the webhook”- In Settings → Integrations, select Connect next to Stripe. Pingado shows your webhook URL.
- In the Stripe Dashboard, go to Developers → Webhooks → Add endpoint and paste the URL.
- Select these events:
checkout.session.completedinvoice.paidcharge.refunded
- Copy the endpoint’s Signing secret (
whsec_…) and paste it into Pingado.
2. Set the success URL
Section titled “2. Set the success URL”Send customers back to a page on your site with the Checkout Session ID in the URL:
https://yoursite.com/thanks?session_id={CHECKOUT_SESSION_ID}On that page Pingado waits for Stripe’s webhook, then sends the trial or purchase from the browser with its value, currency and the event ID the server sends. See Order confirmation pages.
3. Pass the visitor ID through checkout
Section titled “3. Pass the visitor ID through checkout”Payment Links, the buy button and the pricing table: nothing to do. Pingado adds the visitor ID as client_reference_id to every buy.stripe.com link, <stripe-buy-button> and <stripe-pricing-table> on your pages.
Checkout Sessions you create on your server: send the visitor ID from the browser and set it on the session.
// In the browser, when the customer clicks your checkout buttonconst vid = window.pingado?.vid()await fetch('/api/checkout', { method: 'POST', body: JSON.stringify({ plan, vid }) })// On your serverconst session = await stripe.checkout.sessions.create({ mode: 'subscription', line_items: [{ price: priceId, quantity: 1 }], client_reference_id: vid ?? undefined, subscription_data: { metadata: { pg_vid: vid ?? '' } }, success_url: 'https://yoursite.com/thanks?session_id={CHECKOUT_SESSION_ID}',})Without a visitor ID, Pingado still links the payment to the visitor who reaches the confirmation page, or to an earlier lead with the same email.
How Stripe events become conversions
Section titled “How Stripe events become conversions”| Stripe event | Conversion |
|---|---|
checkout.session.completed, subscription with no charge |
Trial started |
checkout.session.completed, one-time payment or paid subscription |
Purchase |
invoice.paid, first paid invoice of a subscription |
Purchase, including the first charge after a trial |
invoice.paid, later invoices |
Renewal |
charge.refunded |
Refund |
Values are recorded without tax. Test-mode events are recorded and not sent to ad platforms.