Skip to content

Stripe

Pingado reads trials, purchases, renewals and refunds from Stripe webhooks, and links each one to the visitor who paid.

  1. In Settings → Integrations, select Connect next to Stripe. Pingado shows your webhook URL.
  2. In the Stripe Dashboard, go to Developers → Webhooks → Add endpoint and paste the URL.
  3. Select these events:
    • checkout.session.completed
    • invoice.paid
    • charge.refunded
  4. Copy the endpoint’s Signing secret (whsec_…) and paste it into Pingado.

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.

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 button
const vid = window.pingado?.vid()
await fetch('/api/checkout', { method: 'POST', body: JSON.stringify({ plan, vid }) })
// On your server
const 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.

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.