Skip to main content

Whop Webhooks

Connect Whop webhooks to automatically track payments and memberships as conversion events. DATALYR matches customers to their original ad click using email-based identity resolution.

What You’ll Learn

  • How to configure Whop webhooks
  • Supported Whop events
  • Email attribution matching
  • Testing and verification

Before You Start

  • DATALYR tracking script installed on your website
  • Email capture with datalyr.identify({ email }) before checkout
  • Admin access to Whop Dashboard
  • Active workspace in DATALYR

Supported Events

DATALYR processes these Whop webhook events:
Whop EventDATALYR EventDescription
payment.succeededpurchaseOne-time payment completed
membership.went_validsubscribeMembership activated
membership.renewedpurchaseRecurring membership payment

How Attribution Works

When a customer makes a Whop purchase:
  1. Whop sends webhook with customer email to DATALYR
  2. DATALYR queries events table: “Find visitor_id where email matches”
  3. DATALYR retrieves original attribution (fbclid, gclid, UTMs)
  4. Event is created with source: 'whop' and attribution data
  5. Conversion rules fire postbacks to Meta, Google, TikTok
Attribution only works if you call datalyr.identify({ email }) before the customer reaches Whop checkout. The email must be captured in a DATALYR event first.

Step 1: Get Webhook URL

  1. Log in to DATALYR dashboard
  2. Navigate to Sources tab
  3. Click Webhooks tab
  4. Click Whop card
  5. Copy your webhook URL
The URL format is:
https://webhooks.datalyr.com/webhooks/whop/YOUR_WORKSPACE_ID

Step 2: Configure Whop Webhook

Add Webhook Endpoint

  1. Log in to Whop Dashboard
  2. Navigate to SettingsDeveloperWebhooks
  3. Click Create Webhook
  4. Paste your DATALYR webhook URL
  5. Enter a description: “DATALYR Attribution”

Select Events

Choose these events to listen to:
  • payment.succeeded
  • membership.went_valid
  • membership.renewed (optional, for recurring payments)

Get Signing Secret

After creating the webhook:
  1. Click on the webhook endpoint
  2. Copy the Signing Secret
  3. Return to DATALYR webhook setup modal
  4. Paste the signing secret
  5. Click Save
DATALYR stores the secret to verify webhook signatures and prevent spoofing.

Step 3: Verify Setup

Test with Live Purchase

  1. Visit your site with ad parameters: yoursite.com?fbclid=test123
  2. Call datalyr.identify({ email: '[email protected]' })
  3. Complete Whop checkout with the same email
  4. Check DATALYR Event Stream
You should see:
  • A purchase or subscribe event with source: 'whop'
  • Attribution data (fbclid, visitor_id) from original session
  • Event value matching Whop amount

Check Webhook Delivery

In Whop Dashboard:
  1. Navigate to SettingsDeveloperWebhooks
  2. Click on your DATALYR webhook
  3. View Recent Deliveries
  4. Verify status is 200 OK

Step 4: Create Conversion Rules

After verifying webhook events are created, set up conversion rules to fire events to ad platforms.

Example: Meta Subscribe Event

  1. Navigate to IntegrationsConversion Rules
  2. Click Create Rule
  3. Configure rule:
Trigger:
  • Event Name: subscribe
  • Event Source: whop
Action:
  • Platform: Meta Ads
  • Event Type: Subscribe
Value Mapping:
  • Use event value from webhook
Now when Whop sends a membership.went_valid webhook, DATALYR will fire a Subscribe event to Meta with the original fbclid.

Event Data Structure

Whop webhooks create events with this structure:
{
  "event_id": "whop_payment_abc123",
  "workspace_id": "uuid",
  "event_name": "purchase",
  "source": "whop",

  "visitor_id": "original_visitor_id",
  "user_id": "[email protected]",
  "fbclid": "original_fbclid",
  "gclid": "original_gclid",

  "value": 49.99,
  "currency": "USD",

  "event_data": {
    "payment_id": "payment_abc123",
    "user_id": "user_abc123",
    "plan_id": "plan_abc123",
    "product_id": "prod_abc123",
    "status": "paid"
  }
}

Attribution Match Rate

DATALYR’s email-based attribution achieves:
  • 95%+ match rate when email is captured before checkout
  • 90%+ match rate for cross-device (mobile ad → desktop purchase)
  • 85%+ match rate for 30+ day attribution windows

Maximize Match Rate

Capture email early in the customer journey:
// When user submits email form (before Whop)
document.getElementById('email-form').addEventListener('submit', function(e) {
  const email = document.getElementById('email').value;

  datalyr.identify({
    email: email
  });
});

// Or on landing page if using Whop checkout link
datalyr.identify({
  email: urlParams.get('email') // If email passed in URL
});

Value Calculation

DATALYR automatically converts Whop amounts:
  • Payments: amount / 100 (Whop uses cents)
  • Memberships: Monthly value calculated from billing period
    • Annual: price / 100 / 12
    • Monthly: price / 100
    • Lifetime: price / 100 (treated as one-time)

Deduplication

Whop may send the same webhook multiple times (retries). DATALYR uses Cloudflare KV to deduplicate:
  1. Extract event.id from webhook
  2. Check if workspace_id:event_id exists in KV
  3. If exists, return 200 OK but skip processing
  4. If new, process and store in KV
This prevents double-counting conversions.

Security

DATALYR verifies all Whop webhooks using signature validation:
  1. Extract X-Whop-Signature header
  2. Verify signature matches webhook secret
  3. Reject invalid signatures with 401 Unauthorized
Your signing secret is encrypted and stored securely in DATALYR’s database.

Troubleshooting

Events have no attribution data

Symptoms: Whop events appear in Event Stream but fbclid/gclid are null Cause: Email was not captured with datalyr.identify() before checkout Solution:
  1. Add datalyr.identify({ email }) on email capture forms
  2. Ensure identify call happens before Whop checkout
  3. Test by checking Event Stream for identify events with the same visitor_id

Webhooks not appearing in Event Stream

Symptoms: Whop purchase completes but no event in DATALYR Cause: Webhook URL not configured or signing secret incorrect Solution:
  1. Check Whop Dashboard → Developer → Webhooks → verify endpoint is active
  2. Check Recent Deliveries for errors
  3. Verify signing secret in DATALYR matches Whop
  4. Test with a new purchase

Signature verification failed

Symptoms: Whop Dashboard shows webhook delivery failures with 401 errors Cause: Signing secret mismatch or not saved in DATALYR Solution:
  1. Get signing secret from Whop webhook settings
  2. Return to DATALYR webhook setup modal
  3. Paste and save the signing secret
  4. Trigger new test event

Wrong event value

Symptoms: Event value in DATALYR doesn’t match Whop amount Cause: Currency conversion or billing period calculation Solution:
  1. Check event_data.amount in Event Stream
  2. Verify billing period for memberships
  3. For annual memberships, value is divided by 12 for monthly attribution
  4. Contact support if amounts are incorrect

What Happens Next

After webhook events are created:
  1. Postback Worker checks for matching conversion rules
  2. Rules filtered by trigger_event_source: 'whop'
  3. Conversions fire to Meta, Google, TikTok with original attribution
  4. Ad platforms receive events with fbclid/gclid for optimization

Whop Revenue Analytics (Coming Soon)

Webhook attribution is separate from Whop Revenue Analytics: Webhooks (This Feature):
  • Real-time conversion tracking
  • Fires events to ad platforms
  • No OAuth required
Revenue Analytics (Coming Soon):
  • Dashboard metrics (MRR, ARR, churn)
  • Requires OAuth connection
  • Periodic data sync via GraphQL API
Revenue Analytics is currently available by request. Contact support to enable Whop revenue analytics for your workspace.

Next Steps