Skip to main content
Pro Plan10 minutesIntermediate

How do I integrate Stripe for revenue tracking?

Connect Zenovay to your Stripe account to attribute revenue back to traffic sources, campaigns, and individual visitors. Paste a restricted Stripe API key and Zenovay wires up the rest.

striperevenueattributionintegrationwebhooks
Last updated:

Connecting Stripe lets Zenovay show revenue alongside your traffic data — which marketing source produced the paying customer, which page they converted on, which campaign closed the deal.

Setup happens per website, inside that website's dashboard. There's one credential to paste — a Stripe restricted API key — and Zenovay handles the webhook wiring for you.

Connecting Stripe

  1. Open the website's Revenue settings

    In app.zenovay.com, open the website you want to connect, go to its Settings, and open the Revenue tab. Each Stripe connection maps to one Zenovay website.

  2. Pick Stripe

    Click the Stripe card. You'll see a short setup form.

  3. Create and paste a restricted API key

    Zenovay links straight to Stripe's "Create restricted key" screen with the read permissions it needs (balance, charges, subscriptions, customers, payment intents, checkout sessions, invoices) plus webhook write. Create the key in Stripe, copy it (it starts with rk_live_… or rk_test_…), paste it into the field, and click Connect.

  4. Let Zenovay finish the wiring

    When you save the key, Zenovay validates it against Stripe and automatically creates the webhook endpoint on your Stripe account, so payments start flowing in without you touching the Stripe Dashboard. The card shows Connected with a green "credentials verified" badge once it's done.

Once connected, the Revenue tab on your dashboard shows MRR, ARR, revenue-per-visitor, and revenue-by-source charts. Revenue is captured going forward from the moment you connect — Zenovay records payments as Stripe sends the webhook events, it does not back-import past Stripe history.

Info

Use a restricted key (rk_…), not your secret key. Restricted keys are read-only on the data Zenovay needs (plus permission to register its own webhook), so a leaked key can't move money or change your Stripe account.

Configuring the webhook manually (optional)

Zenovay creates the Stripe webhook for you, so most people never need this. If you'd rather wire the webhook yourself — for example because your Stripe key doesn't include webhook-write permission — you can point Stripe at Zenovay's receiver and paste the signing secret back in.

  1. In the Stripe Dashboard, go to Developers → Webhooks → Add endpoint.
  2. Endpoint URL: https://api.zenovay.com/api/webhooks/stripe/YOUR_WEBSITE_ID (your website ID is in the page URL of the website's dashboard).
  3. Select these events:
    • checkout.session.completed
    • payment_intent.succeeded
    • invoice.paid
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
  4. Save, then copy the endpoint's signing secret (starts with whsec_…).
  5. Back in Zenovay's Stripe form (the Revenue settings tab), paste the signing secret so Zenovay can verify incoming events.

Attributing a payment to a visitor

For payment-to-traffic-source attribution to work, the visitor's anonymous Zenovay ID has to make it onto the Stripe record. The cleanest way is to set it as the checkout session's client_reference_id, or to attach it as metadata at checkout:

// On your checkout server
const visitorId = req.cookies['zv_visitor_id'] // or however your client passes it
stripe.checkout.sessions.create({
  // ...
  client_reference_id: visitorId,
  metadata: { zenovay_visitor_id: visitorId }
})

When the payment completes, Zenovay's webhook handler reads the client_reference_id (or metadata.zenovay_visitor_id / metadata.visitor_id) and joins the payment to the visitor's session — including the source, campaign, and pages they visited before paying. Payments without a visitor ID are still recorded as revenue, just without source attribution.

What attribution models are available

Zenovay computes several attribution models so you can see how credit shifts depending on which touchpoints you weight:

  • Last Touch — credit goes to the source on the session where the payment happened.
  • First Touch — credit goes to the source the visitor first arrived from.
  • Linear — credit split evenly across every touch on the path.
  • Position-Based — weights the first and last touch most heavily.
  • Time-Decay — touches closer to the conversion get more credit.

Switch between them in the Revenue tab to compare how each model assigns credit.

Disconnecting

In the website's Revenue settings tab, open the Stripe card and click Remove. By default this just disconnects the credentials — your existing payment records stay in the dashboard for the duration of your data retention window. If you also want to delete the historical revenue data, tick the cascade-delete option in the confirmation dialog (it shows you exactly how many records will be wiped first).

Removing the integration in Zenovay doesn't delete the webhook on Stripe's side, so you may want to remove the endpoint in your Stripe Dashboard too.

Was this article helpful?