Server-side conversions
Send conversions from your server to the Koast pixel with a server-side key, so ad blockers and cookie rules don't hide them.
Ad blockers and cookie rules hide some conversions from any browser pixel. Server-side conversions close that gap: your server, or your tracker, sends the conversion straight to the Koast pixel with a key you create in Koast. Keep the browser pixel in place too. The two work together.
Before you start
- This is for Koast ad accounts.
- Set up the browser pixel first. See Set up the Koast pixel.
- You need someone who can change your server code or your tracker's settings.
Create a key
Open Settings, then Pixel, and scroll to Server-side tracking, marked Optional.
Select Create key. Type a name you'll recognise, for example "Checkout server", and select Create key again. Names are 2 to 60 characters.
Select Copy key and store the key somewhere safe. It's shown once, so copy it now.
Select I saved it. The key stays listed with its first characters and Active, and the count goes up, for example 1 of 3 keys created.
Select API instructions to copy a ready-made set of instructions, with your ad account ID already filled in, for your developer or an AI coding agent.
Up to 3 keys per ad account
A key works only for the ad account it was created on, and it can only send conversions. You can't delete keys from Koast yet. If you've used all 3 and need another, message us.
Send an event
Send a POST request to https://api.whop.com/api/v1/events with your key in the Authorization header:
curl -X POST https://api.whop.com/api/v1/events \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"account_id":"biz_7Qm2NimbusSleep","event_name":"lead","event_id":"order_1234",
"value":49.99,"currency":"usd","action_source":"website",
"user":{"email":"buyer@example.com"},
"context":{"fbclid":"...","ip_address":"...","user_agent":"..."}}'The event is acknowledged right away and shows up within about 15 minutes.
| Field | What to send |
|---|---|
account_id | Your ad account ID, as shown on the Pixel tab. Always send it. The key only accepts that account. |
event_name | One of the supported events below. |
event_id | The same ID the browser pixel sends for this conversion, and unique per conversion. |
value, currency | The conversion value. For purchase, the value must be greater than zero. |
action_source | Where it happened, usually website. |
user | As many match keys as you have: email, phone, external_id. |
context | As much attribution as you have: fbclid, fbp, fbc, gclid, ttclid, ip_address, user_agent, utm_source, utm_medium, utm_campaign. |
Supported events: lead, complete_registration, submit_application, schedule, contact, view_content, add_to_cart and purchase.
Rules that keep your numbers right
- Match the browser pixel's
event_id. When the browser and your server report the same conversion with the sameevent_id, it's counted once. Different IDs count it twice. - Keep
event_idunique per conversion. If a macro such as{txid}isn't filled in, every event carries the same ID and all but the first are dropped as duplicates. - Send one IP address, 45 characters at most. If your tracker sends a comma-separated chain of addresses, send only the first one. Anything longer is rejected with "ipAddress is too long (maximum is 45)".
- Don't resend Whop checkout purchases. Purchases through Whop checkout are already tracked. Send
purchaseonly for sales on your own checkout.
Send conversions from a tracker
Trackers like RedTrack, Voluum and BeMob send conversions as a postback: a plain GET URL with macros in it. The events endpoint needs a POST with your key in the Authorization header, which a postback can't carry. So put a small relay in between, such as a Zapier or Make webhook, or a short script on your own server.
Koast's RedTrack, Cometly and Hyros integrations only read data into Koast. They don't send conversions anywhere, so you still need this relay.
Create a webhook in Zapier (Webhooks by Zapier, Catch Hook) or Make (Custom webhook) and copy its URL.
In your tracker, set that URL as the postback URL for your traffic source, with the tracker's macros as query parameters, for example
https://hooks.example/abc?txid={txid}&payout={payout}&fbclid={fbclid}&ip={ip}&ua={ua}. Macro names differ per tracker, so pick them from its list.Add a step that sends a
POSTtohttps://api.whop.com/api/v1/eventswith the headersAuthorization: Bearer YOUR_KEYandContent-Type: application/json, and a JSON body built from the query parameters, mapped as below.Fire a test conversion in your tracker. It shows up within about 15 minutes.
| Body field | Fill it with |
|---|---|
account_id | Your ad account ID from the Pixel tab, typed in, for example biz_7Qm2NimbusSleep. |
event_name | The event, typed in, for example lead or purchase. |
event_id | The tracker's order or transaction ID, for example {txid}. It must be different for every sale. |
value, currency | The payout or sale amount and its currency. |
action_source | website. |
context.fbclid | The click ID your tracker captured from the ad click, for example {fbclid}. |
context.ip_address | The visitor's IP address. Only the first one if the tracker sends a list. |
context.user_agent | The visitor's browser user agent. |
user.email | The buyer's email, if the tracker has it. |
Leave utm_source and utm_medium off your ad links
Whop adds utm_source and utm_medium to every click itself and rejects an ad whose destination URL already has them, so Koast stops the launch and asks you to remove them. If your tracker's link template uses them, pass those values in the tracker's own parameters instead. The same applies to utm_content, utm_placement and utm_adset.
Using ClickFlare? It can send the POST itself, with no relay. See Send conversions from ClickFlare.
Send conversions from ClickFlare
This is a separate setup from Koast's ClickFlare integration. ClickFlare can send each conversion straight to the Koast pixel's server-side endpoint with a key you create in Koast, so conversions tracked in ClickFlare reach your Koast ad account. It's a plain JSON request, with no middleware or code.
- On a Meta ad account you use your own Meta pixel, so set up ClickFlare's Meta integration against Meta's endpoint instead.
- The Koast browser pixel must already be on your site and firing. See Set up the Koast pixel.
- Create a server-side key in Settings, Pixel, under Server-side tracking. See Create a key.
- Note your ad account ID from the Pixel tab. It must be the same account the browser pixel and the key belong to.
Set up the webhook in ClickFlare
These steps happen in ClickFlare. ClickFlare renames its menus from time to time, so the labels may differ slightly.
Go to Integrations, Conversion API, Add Integration, and pick Webhooks.
Choose the event that counts as your conversion, such as Conversion, Purchase or a custom event, and set the method to POST.
Set the URL to
https://api.whop.com/api/v1/events.Under Advanced Configuration, Headers, add
Authorization: Bearer YOUR_KOAST_KEY, with your server-side key in place ofYOUR_KOAST_KEY. ClickFlare sets the content type for JSON bodies itself.Paste the body below, put in your own
account_id, and pick each macro from ClickFlare's dropdown rather than typing it.Save and fire a test conversion. Events show up in Koast within about 15 minutes.
{
"account_id": "biz_7Qm2NimbusSleep",
"event_name": "lead",
"event_id": "{txid}",
"value": {payout},
"currency": "{payout_currency}",
"action_source": "website",
"user": { "email": "{email}" },
"context": {
"fbclid": "{external_id}",
"ip_address": "{ip}",
"user_agent": "{user_agent}"
}
}Set event_name to the event that matches this conversion: lead, complete_registration, submit_application, schedule, contact, view_content, add_to_cart or purchase. event_id must resolve to the same ID the browser pixel sends for the same conversion.
Why ClickFlare conversions don't count
| Problem | What happens |
|---|---|
event_name isn't a supported event | The conversion isn't recorded as one of your tracked events. |
event_id doesn't match the browser pixel's ID | The conversion is counted twice. |
{txid} isn't filled in | Every event carries the same ID, and all but the first are dropped as duplicates. |
| The IP address is longer than 45 characters | The event is rejected. Send only the first address if ClickFlare passes a chain. |
| You resend Whop checkout purchases | Purchases through Whop checkout are already tracked, so they're counted twice. |
account_id doesn't match the key's ad account | The key only accepts its own ad account, so the event is refused. |