Stickybeak Docs Dashboard Get early access

Goals and revenue

Stripe

Stripe analytics in Stickybeak starts when buyers return to your site. Verify the payment on your server, then send the purchase from the success page.

Stripe conversion tracking with Checkout

  1. Include the session ID

    const session = await stripe.checkout.sessions.create({
      mode: "payment",
      line_items: [{ price: "price_123", quantity: 1 }],
      success_url: "https://example.com/thank-you?session_id={CHECKOUT_SESSION_ID}",
      cancel_url: "https://example.com/pricing",
    });
  2. Verify it server-side

    Retrieve the session with your secret key. Continue only when payment_status is paid.

  3. Send the verified values

    window.stickybeak("purchase", {
      revenue: session.amount_total / 100,
      currency: session.currency,
      order_id: session.id,
    });

amount_total uses the smallest currency unit. Do not divide zero-decimal currencies such as JPY or KRW. Lowercase currency codes are accepted.

Under the payment link's Confirmation page, redirect to:

https://example.com/thank-you?session_id={CHECKOUT_SESSION_ID}

Buy Buttons use the payment link's settings. Verify the session as above.

Payment Element

Stripe adds a payment_intent parameter to your return_url. Retrieve it on your server, require status: succeeded, then send amount_received, currency and its ID.

Limits

  • Subscription checkout records the first payment. Renewals, upgrades and refunds are not recorded; a free trial starts at zero, so it is not an order.
  • The buyer must return to your page. Closing the tab before redirect loses the purchase.
  • Stripe return traffic has no referrer, and session_id is removed from analytics URLs.