Stripe integration
Stripe revenue attribution
DataFair connects your Stripe payments to the visits that led to them, so you can see which traffic sources earn money for your payments and subscriptions, not just which ones send visitors.
What you see once Stripe is connected
- Revenue by channel, referrer, campaign, landing page, country, device and browser
- Revenue per visitor and conversion rate next to your traffic, on one chart
- Every visitor journey that ended in a payment, from the first page to the purchase
- Refunds and disputes taken off the source that earned the sale
- Recurring revenue (MRR) by source, for subscriptions
How payments are matched to visitors
The DataFair script gives every visitor an anonymous id. When that visitor pays, the id travels with the payment and DataFair credits the sale to the visit that brought them.
Payment links are tagged automatically by the script. For Checkout sessions you create yourself, add df_visitor_id and df_session_id to the metadata. If one Stripe account sells for several websites, also add df_site_id with this website id, so each payment lands on the right one.
A payment that arrives without an id still counts in your revenue totals. It just has no traffic source.
Connect Stripe in a few minutes
- In DataFair, open Integrations, choose Stripe and copy your webhook URL.
- Open Stripe and go to Developers, then Webhooks (in Workbench).
- Click Create an event destination. Older dashboards call it Add endpoint.
- Choose events from Your account and tick the events listed below.
- Choose Webhook endpoint and paste your DataFair webhook URL as the endpoint URL. Create it.
- On the new destination, click Reveal next to Signing secret and copy it.
- Paste the signing secret into DataFair and save.
Stripe events DataFair listens to
Every webhook is checked against its signature before anything is stored, and the secret is encrypted at rest.
- checkout.session.completed
- checkout.session.async_payment_succeeded
- invoice.paid
- invoice.payment_failed
- charge.refunded
- charge.dispute.created
- customer.subscription.deleted
Good to know
Test mode and live mode keep separate webhooks, each with its own secret. Connect the one you are using.
Questions
- Do I need to write code to track Stripe revenue?
- Usually not. Payment links are tagged automatically by the script. For Checkout sessions you create yourself, add df_visitor_id and df_session_id to the metadata. If one Stripe account sells for several websites, also add df_site_id with this website id, so each payment lands on the right one.
- What happens to refunds?
- When Stripe reports a refund or a dispute, DataFair takes it off the source that earned the original sale, so your revenue by channel stays honest.
- Which plan do I need?
- Every plan includes revenue attribution. Starter includes one revenue provider connection; Growth and Scale include several. Starter is $5.99 a month at launch and falls to $3.99 as the community grows. Growth goes from $14.99 to $9.99, and Scale from $49.99 to $29.99. Every customer moves to the lower price at their next renewal.
- Can I use Stripe with another payment provider?
- Yes, on Growth and Scale you can connect several providers to one website, and each payment is attributed the same way.
Guides
- See Stripe Revenue by Traffic Source, Step by Step
- UTM Parameters on Stripe Payment Links: The Complete Guide
- Pass the Visitor Into Stripe Checkout With Metadata
- The Stripe Analytics Dashboard: What It Shows and What It Doesn't
- Best Stripe Analytics Tools for Founders in 2026