Supported events
| Event | Description |
|---|---|
popup.shown | The popup was displayed to a visitor |
popup.clicked | The visitor clicked the popup’s CTA button |
popup.converted | The visitor submitted the popup form |
popup.closed | The visitor dismissed the popup |
Setting up a webhook
Enter your endpoint URL
Paste your server’s endpoint URL. It must be a publicly accessible HTTPS address.
Webhook payload
Cool Popup sends a JSON body with each request. Here is an examplepopup.converted payload:
event— the name of the event that triggered the webhookcampaign_id— unique identifier for the campaigncampaign_name— the display name of the campaigntimestamp— ISO 8601 date and time when the event occurredvisitor.email— the visitor’s email address (present onpopup.convertedevents)visitor.fields— all form fields submitted by the visitor, as key-value pairspage_url— the URL of the page where the event occurred
Responding to webhooks
Your endpoint must return an HTTP200 status code within 5 seconds. If it does not respond in time, or returns a non-200 status, Cool Popup will retry the request up to 3 times with exponential backoff.
Validating webhook signatures
Cool Popup signs every webhook request using HMAC-SHA256. The signature is computed from the raw request body using your webhook secret, and sent in theX-CoolPopup-Signature header.
To validate:
- Read the raw request body (before parsing JSON).
- Compute an HMAC-SHA256 hash of the body using your webhook secret as the key.
- Compare the result to the value in the
X-CoolPopup-Signatureheader. - Reject the request if the values do not match.