Whop + Web Tracking
Last updated: 2026-05-13
Get attribution tracking live in 5 minutes. DATALYR helps creators and communities selling through Whop track users from ad click to email capture to paid membership, so you can measure real ROAS and feed accurate conversion data back to your ad platforms.
Quick start guides: JavaScript / HTML · React / Next.js
Step 1: Create your DATALYR account
- Sign up at datalyr.com/signup
- Go to Settings → API — copy your API key (starts with
dk_)
Step 2: Install the Web SDK
The Web SDK tracks visitors across your landing page, marketing site, and email capture flow so we can connect the full journey from ad click to paying member.
- HTML: follow the setup guide
- React / Next.js: follow the setup guide
Install the SDK on every page visitors land on before they hit your Whop checkout — landing pages, sales pages, VSL pages, email capture forms. This is the only window DATALYR has to capture the click IDs and cookies your ad platforms need.
Step 3: Identify your users
Call identify()with the user’s email as soon as you have it. Email is the universal fallback for linking a Whop payment back to the original ad click — if metadata pass-through (Step 5) isn’t wired up, or if the user’s browser loses state between signup and checkout, email is what saves attribution.
- Call
identify()on signup, login, and any session restore - Pass the user’s email at minimum
- Use the same email the user will enter at Whop checkout
- Do this before any redirect to a whop.com URL
Step 4: Connect Whop
Connect Whop to DATALYR so we can track revenue events like new memberships, recurring payments, and cancellations. Setup is a one-time webhook configuration in the Whop dashboard.
- Go to Sources → Whop in the DATALYR dashboard
- Copy the webhook URL DATALYR gives you
- Paste it into your Whop dashboard under Developers → Webhooks
- That’s it — revenue data starts flowing automatically
What DATALYR tracks from Whop:
- New memberships and one-time payments (
payment.succeeded) - Recurring membership payments (Whop sends another
payment.succeededon each renewal) - Membership activations (
membership.activated) - Cancellations (
membership.deactivated) - Revenue values in USD
Step 5: Pass the visitor ID through Whop checkout metadata
Email-only attribution works, but passing the DATALYR visitor ID through Whop’s checkout metadata pushes match quality from 70-85% (email match) to 90%+ (direct ID match). Whop inherits checkout-configuration metadata onto every payment and membership created from that checkout, and DATALYR reads metadata.visitor_id automatically.
Pass { visitor_id: datalyr.getVisitorId() } as metadata when you create a checkout configuration via the Whop API:
whop.checkoutConfigurations.create({
plan_id: 'plan_xxx',
metadata: { visitor_id: datalyr.getVisitorId() },
});If you use Whop’s hosted checkout without creating configurations programmatically, email-based attribution still works — just make sure identify() has fired first.
Step 6: Connect your ad platforms
Connect your ad platforms so DATALYR can match ad spend to revenue, give you accurate ROAS, and send conversion events back server-side.
- Meta (Facebook / Instagram)
- TikTok
- Google Ads
- Other: reach out at hello@datalyr.com
Step 7: Set up conversion rules
Configure conversion rules to send the right events back to your ad platforms so they can optimize for paying members, not just email signups.
- Go to Conversions → Add Rule
- Pick your trigger event (e.g.
purchase,subscribe), choose your ad platform, and set the conversion value - Hit Save — it’s live immediately
Step 8: Verify it's working
- Set
debug: truein the SDK — you should see events logging in your console - Go through your real funnel: land on your page, submit your email, complete a test Whop purchase
- Open Live in your dashboard — you should see the page view, the identify call, and the purchase event all tied to the same visitor
- If the purchase shows up but is NOT linked to the prior page views, your
identify()call is firing too late or with a different email than the one used at checkout
Best practices
- If you create Whop checkouts programmatically, pass
{ visitor_id: datalyr.getVisitorId() }as the metadata on every checkout configuration — this is the highest-quality attribution bridge and takes you from 70-85% to 90%+ match rate. - Always call
identify()with the user’s email BEFORE they reach Whop as a fallback — if metadata pass-through isn’t used, or if the browser session is lost between pages, email is the only way back to the original ad click. - Always run paid traffic to a DATALYR-instrumented landing page first — never send paid ads directly to a whop.com URL. Without a landing page, there’s no opportunity to capture click IDs or cookies.
- Use the same email field everywhere — the email passed to
identify()must match the email the user enters at Whop checkout. Different emails means no match. - Only use the DATALYR SDK for tracking visitor events (page views, email capture, video watches) — do not track purchases client-side. Revenue should come from the Whop webhook only.
- If you have a free Discord or community tier, call
identify()on Discord OAuth too — this extends the attribution window for users who engage before paying.
Why attribution works the way it does on Whop
Whop inherits checkout-configuration metadata onto every payment and membership, so DATALYR can use two bridges depending on how you integrate:
- Best (90%+ match): pass
metadata.visitor_idwhen you create a Whop checkout configuration. DATALYR reads it off every resultingpayment.succeeded/membership.activatedevent and threads attribution directly. - Good (70-85% match): call
identify({ email })before checkout and let Whop capture the email at purchase. DATALYR matches browser session to payment on email. - Bad (0% match): send paid traffic straight to a whop.com URL with no landing page, no identify call, no metadata. Purchases arrive with nothing to match on.
If you’re running paid traffic to Whop and doing neither of the first two, you are flying blind on ROAS. Wire up metadata.visitor_id first, email identify second, everything else third.