POST /events accepts the same events the pixel sends from the browser, so you can report conversions that happen where no pixel runs. That covers a sale closed in your CRM, a payment on your own backend, a webhook from a form or booking tool, or a call a rep marks as booked.
Before you start, you need three things:
- The Whop Pixel installed on every page of your funnel. It creates the visitor ID this guide passes along.
- An API key with the
event:createpermission. Create one under Account API Keys, and keep it on your server. Never put it in browser code. - Your account ID, the part of your dashboard URL after
dashboard/that starts withbiz_.
When to use the Events API
Most integrations don’t need this. The pixel already reports everything that happens in the browser, and it fills in the visitor ID, IP address, and user agent on its own. Use the Events API only when your server is the only place that knows a conversion happened. If awhop.track call can fire where the action happens, use that instead.
Send a server event
Read the visitor ID in the browser
The pixel stores each visitor’s ID in a first-party cookie named Each subdomain gets its own
_wuid on your domain, and mirrors it to localStorage under the same key. The value looks like wuid_k3j9x2m1p8q4r7s0t5u6. Read it at the moment the visitor takes the action you’ll later report, not at page load. The cookie exists only after the pixel snippet has run on the page.Read the visitor ID
_wuid. The pixel links them to one person, so read whichever cookie is on the page where the handoff happens.Send it to your server with the action
Attach the visitor ID to whatever request already carries the action to your backend: a form post, a checkout call, a signup request. Capture the page URL at the same time. It carries the UTMs and click IDs that your server can’t see otherwise.If your backend answers on the same host as the page, the
_wuid cookie arrives on the request by itself. Read it there instead of sending it from the browser. The cookie is set for that host only, so a request from example.com to api.example.com doesn’t carry it.Your server already sees the visitor’s IP address and user agent on that request. Keep both.Store it on the customer record
Save the visitor ID, page URL, IP address, and user agent on the lead, customer, or order. The conversion you report might happen days after the visit. A deal your sales team closes next week still needs the visitor ID from the original visit to attribute. Whop accepts events up to 28 days old.
Send the event
Post the event from your server with your API key. The example reports a lead from a visitor who arrived from an ad, filled out a quote form, and was then qualified in a CRM.The
url in the example is what a visitor lands on after tapping a Whop ad on Meta. utm_meta_ad_id, utm_meta_adset_id, and utm_meta_campaign_id are the network’s IDs. wacid, wasid, and waid are the Whop campaign, ad group, and ad IDs. utm_source names the surface (fb, ig, msg, or an), utm_placement the placement, utm_content and utm_adset the ad and ad group names, and fbclid is the tag the network appends itself. Whop resolves which ad drove the visit from these, so store the URL whole rather than picking parameters out of it.The response returns the stored event ID. Whop prefixes your event_id with the account so IDs from different accounts never collide:Confirm it landed on the right person
List Events accepts a visitor ID as the Your server event appears next to the pixel’s page views with the same
identifier, so you can read the whole journey the event joined. The request needs a key with a read permission such as company:basic:read.cURL
person_id. If the page views are there but your event isn’t, the visitor ID didn’t match. See Troubleshooting. The event also shows up on the Events page in your dashboard.Parameters that decide attribution
Onlyaccount_id and event_name are required. The rest of the payload is what makes the event attributable, so treat these as required too.
The full request schema is on the Create Event reference page.
Name the event
Use the same names as the pixel. Alead you report from your server lands as the same event as a lead the pixel reports, so it counts toward the results of a campaign judged on leads.
Any other
event_name becomes a custom event under that name. Keep names short and stable, and reuse a small set.
Custom event
Avoid duplicate events
If the same conversion can reach Whop from both the browser and your server, send it from both with the sameevent_name and the same event_id. Whop keeps one copy. This is the safest setup when a form fires whop.track("lead", { event_id }) on submit and your backend reports the same lead again after validating it.
The event_id identifies one action, not the type of action. Every lead needs its own. A value made up at send time is new every time, so it stops nothing. Use an ID your system already has for that one action.
Troubleshooting
The event is stored but not attributed to an ad. The event carried nouser.anonymous_id, or a value the pixel never used. The usual causes are reading the cookie before the pixel snippet ran, reading it on a domain without the pixel, or storing the visitor ID on the wrong record. Confirm the fix by listing events for that visitor ID. The pixel’s page views must show up under the same identifier as your event.
400 with a message about event_time. The timestamp is more than 28 days old. Send the event closer to when it happens, or drop it.
400 on a purchase event. value is missing or not greater than zero. Ad networks can’t optimize toward a sale with no amount, so Whop rejects it.
401 or 403. The key is missing, lacks event:create, or belongs to a different account than account_id. Production keys use https://api.whop.com/api/v1.
