Founder pricing — only 4 of 20 seats left at $49/yrthen $149Claim yours

Integration Guide

How to Connect Stripe

Tie your website traffic and marketing campaigns directly to Stripe revenue — without manual GA4 e-commerce events.

Understanding which marketing campaigns, content paths, or social referrers are driving actual revenue — not just pageviews or button clicks — is the holy grail of web analytics. Typically, setting this up in Google Analytics 4 requires a complex developer integration using custom e-commerce events, data layers, and tag manager configurations.

TrackWhy keeps it simple. You paste a read-only Stripe API key in Site Settings → Revenue attribution, and TrackWhy periodically polls your completed payments and attributes them back to the original session referrer, landing page, and marketing campaign. No OAuth dance, no webhook to register, and no tracking cookies beyond the first-party tw_visitor cookie the tracker already sets.

Get a clear view of your Customer Acquisition Cost (CAC) and Customer Lifetime Value (LTV) right on your dashboard. Filter your entire traffic flow by 'paying customers' or group your revenue by landing page to see exactly which content makes money.

Start free trialNo credit card required.

Step-by-step

Setup guide in 5 simple steps.

  1. 1Configure your TrackWhy site and verify the tracker is installed.
  2. 2In Stripe, go to Developers → API keys and create a restricted key with checkout.sessions:read and charges:read (no write access needed).
  3. 3In TrackWhy, open Site Settings → Revenue attribution, pick Stripe, and paste the key. TrackWhy encrypts it at rest and runs a first sync immediately.
  4. 4At checkout, attach the visitor id from the tw_visitor cookie under the tw_visitor_id metadata key so payments can be broken down by channel, country, and UTM.
  5. 5View revenue stats and campaign attribution in your analytics overview as the sync polls new payments.

Capabilities

What this integration unlocks.

Zero-code e-commerce tracking

No need to write custom JavaScript to track ecommerce conversions. TrackWhy reads completed payments directly from the Stripe API.

Full attribution funnel

Trace user journeys from the first search query or social click to the final paid checkout in Stripe.

Channel & UTM revenue breakdown

Attach the tw_visitor_id at checkout and TrackWhy ties each payment back to its first-touch channel, country, and campaign.

FAQ

Stripe + TrackWhy — FAQ.

Is it secure to connect Stripe to TrackWhy?
Yes. You provide a restricted, read-only API key — ideally scoped to just reading checkout sessions and charges. TrackWhy encrypts it at rest, only reads the payment metadata needed to attribute conversions, and never touches card numbers or other sensitive billing details.
Do I need OAuth or a webhook?
No. There is no OAuth flow and no webhook to register. TrackWhy polls your completed payments through the Stripe API on a schedule (you can also trigger a sync on demand from Site Settings).
How is revenue attributed to campaigns?
Attach the tw_visitor cookie value at checkout under the tw_visitor_id metadata key. When the sync reads a completed payment, it looks up that visitor's first-touch channel, country, and UTM from your event history and attributes the revenue accordingly. Payments without the visitor id still count toward total revenue, just under an unknown channel.