Skip to main content
Webhooks send event data from one app to another in real time. Most apps support them, so you can send event data to Cometly with a webhook even when the app has no built-in Cometly integration. An event is an action Cometly tracks, such as a form submission, a lead or a purchase. This matters because Cometly can only attribute the events it receives. Once your CRM, form tool or payment app sends its leads and sales through a webhook, you can see which campaign, ad set and ad produced each one.

What you can do with Cometly webhooks

  • Send event data from any app. Connect apps that have no native Cometly integration.
  • Track the events that matter. Choose specific events such as form submissions, purchases or lead updates.
  • Map data to Cometly fields. Match your app’s data fields (for example email and event time) to Cometly’s fields for accurate reporting.
  • Filter out unnecessary data. Use filters so that only relevant events are processed.
Contact data enrichment: if the Cometly pixel (the tracking script on your website) only captures the email address on your form (and not the first name, last name and phone number), map those fields when you send event data to Cometly. The contact in Cometly is enriched with that information.

Send event data with a webhook

Set up one event at a time to stay organized and follow your tracking plan.
1

Start a new event

Go to Events Manager and click Create Event. You can also start from Setup, in the step Create conversion events, or from the Webhooks card on the Integrations page, which opens Events Manager.
Events Manager page on the Events tab, listing draft webhook events, with the Create Event button at the top right outlined
2

Choose Webhooks

Under App / Integration, choose Webhooks. If you can’t find it, click Select Webhooks next to “Don’t see your integration?”.
Create Event dialog with Webhooks chosen under App / Integration, arrow 1 on that field and arrow 2 on the Select Webhooks link
3

Pick or create the event

Under Events, choose a standard event (for example Lead or Purchase) or click Create New Event to make a custom one. Add an optional description, then click Create (Create Event when you start from Setup).
Create Event dialog with the Events list open, showing Create New Event at the top and standard events such as Lead, Purchase and Schedule
4

Copy the webhook URL into your app

The Send Event Data page opens on the Receive Data step with your webhook URL. You can place this URL in any app or integration to send event data to Cometly.
Receive Data step of the Send Event Data page for a Lead event, with the Your webhook URL field and its Copy button outlined, above the Check for Data button
  1. Click Copy and paste the webhook URL into your app.
  2. Once you’ve set it up, click Check for Data.
  3. Wait for your app to send an event.
If no data has been sent yet, click Save & Return When Data is Ready and come back later.To come back to the webhook, open Events Manager. The event shows the status Draft. Click Configure on its row to return to the webhook URL and check for data again.
Events Manager table of webhook events, with arrow 1 on the Lead event's Draft status and arrow 2 on its Configure button
5

Select a record

When data is received, each request is listed with the date it was pulled.
Receive Data step listing two received requests, outlined, below the Check for Data button, with the first request selected
Click Open on a request to view its fields. Select the request you want to use as your sample, then click Continue With Selected Record.
Receive Data step with the first request opened to show its email, firstname, lastname and phone fields, and an arrow pointing to Continue With Selected Record

Configure mapping

Mapping tells Cometly which fields in your app’s data match each Cometly field, such as the email address, the event time or other data you want to track.

Map fields

  1. Select the Cometly field you want to map (for example Email or Event Time).
  2. Choose the matching field from your app’s data (for example email@example.com).
  3. Repeat for each additional field you want to track.
Good to know:
  • Email and Event Time are required.
  • If your data has no event time, choose The time we receive the event for Event Time. Cometly then uses the time the event arrives.
Configure Mapping step with Email mapped to the payload's email field and Event Time set to The time we receive the event

Add more fields

If your event includes more data points (for example user IDs, product names or amounts), click Add Field and repeat the mapping. When every field is mapped and formatted, click Save & Continue. To finish later, click Save and continue later.

Use formatting options

Fields that can be formatted show Formatting Options under the mapping. The preview next to Formatted shows the result.
  • Date fields
    • Timezone conversion: convert timestamps to a specific timezone.
  • Amount and other number fields
    • Increase or decrease decimal places.
    • Add, subtract, multiply or divide by a fixed value you type, or by a numeric value from your payload (for example a tax or fee).
    • Currency conversion: convert amounts from one currency to another.

Set up filters

Filters are optional. They control which events are processed: only events that pass all of your filters are tracked in Cometly.
  1. Choose your filtering options.
  2. If your sample record passes the filters, a green box confirms that the webhook would have continued, with PASS next to each condition.
  3. If it does not pass, the box tells you the webhook would not have continued, with FAIL next to the condition that stopped it.
Filtering step with one filter, phone contains 98, and a green box saying the webhook would have successfully continued, with PASS next to the condition

Activate your webhook

On the Filtering step, click Activate. Cometly confirms that the event was created, and Continue to Events Manager takes you back to the list. In Events Manager, an activated webhook event shows a switch that is turned on in the Status column.
Events Manager row for an activated Lead webhook event, with arrow 1 on the switch in the Status column and arrow 2 on the Edit button and trash icon
Test data sent before the webhook was activated is not processed and does not appear in your reports.
You can turn the webhook off or on at any time with the switch. To change its mapping or filters, click Edit on its row. To delete it, hover over the row and click the trash icon. Once deleted, the webhook URL stops receiving data and this cannot be undone.

Check it worked

In Events Manager, your webhook event shows a switch that is turned on in the Status column. Send a new event from your app, then open the Events Log tab: the event appears there within 60 seconds, with SUCCESS in the Details column.

Additional notes about webhooks

Event time format

When you send the event_time field in your webhook payload, Cometly accepts UNIX time in seconds. It does not accept UNIX time in milliseconds. Correct format (seconds), a 10-digit UNIX timestamp:
Incorrect format (milliseconds), a 13-digit timestamp that will not process correctly:
If your system outputs timestamps in milliseconds, divide the value by 1000 before you send it to Cometly. This records the event with the correct date and time.

Frequently asked questions

How long does it take for a webhook event to show up in Cometly?

The event shows in the Events Log within 60 seconds of being sent. It can take up to 15 minutes to appear in the reporting areas, such as the Report Builder or Ads Manager.

How do I see what data my webhook sent to Cometly?

Open Events Manager, then the Events Log tab, and keep Source set to Server. Each event is listed with its raw data, and the Details column shows SUCCESS or the error message when something went wrong. See Use the Events Log for the full walk-through.

Should I use a webhook, Zapier or the Cometly API?

Use a webhook when your app can send data to a URL on its own. Use Zapier when you would rather build the connection as a Zap, with your app as the trigger and Cometly as the action. Use the Cometly API when a developer sends events from your own systems with an API token.

Next steps

Still have questions or need a hand? We’re happy to help. Reach our team at support@cometly.com.