> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cometly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Send event data to Cometly with a webhook from any app: copy your webhook URL, map the fields, add optional filters and activate the event.

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.

> [!TIP]
>
> **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

> [!TIP]
>
> Set up one event at a time to stay organized and follow your [tracking plan](https://docs.cometly.com/getting-started/tracking-plan.md).

**1. Start a new event**

Go to [**Events Manager**](https://app.cometly.com/space/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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/01.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=4c1bf6da793a5bdfa57ebad5cf2f8ecc)

**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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/02.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=a6817ce499aec04ff570b14fd53fbae3)

**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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/03.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=36852e32cb44c68bef07afc0e5e5dbbe)

**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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/04.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=7dfdf684afc4822310752decdcfb1613)

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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/05.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=8e8b7238a9e0215af1a3dd5c9247cdb0)

**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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/06.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=28ad40f95517af6e783f5be60bf29dc7)

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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/07.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=b7e476693f191493f194724019c6fb2c)

## 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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/08.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=4b885866530894a2c2b76ac6b3a7a1a2)

### 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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/09.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=e61dda57a31900755829b39233beede1)

## 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](https://app.cometly.com/space/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](https://mintcdn.com/cometly/cMwLedstW5vzvUYN/images/integrations/webhooks/10.webp?fit=max\&auto=format\&n=cMwLedstW5vzvUYN\&q=85\&s=728da542c134dcbb975bdb42860ee119)

> [!WARNING]
>
> 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](https://app.cometly.com/space/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:

```json theme={null}
"event_time": 1718044800
```

Incorrect format (milliseconds), a 13-digit timestamp that will not process correctly:

```json theme={null}
"event_time": 1718044800000
```

> [!TIP]
>
> 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](https://docs.cometly.com/support/troubleshooting/general/event-log.md) 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](https://docs.cometly.com/integrations/zapier.md) 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](https://docs.cometly.com/integrations/api.md) when a developer sends events from your own systems with an API token.

## Next steps

* [Use the Events Log to check incoming events](https://docs.cometly.com/support/troubleshooting/general/event-log.md)
* [Learn how events work in Cometly](https://docs.cometly.com/guides/events/how-events-work.md)
* [Manage custom events](https://docs.cometly.com/guides/events/custom-events.md)
* [Send events to Cometly with Zapier](https://docs.cometly.com/integrations/zapier.md)
* [Plan which events to track](https://docs.cometly.com/getting-started/tracking-plan.md)

Still have questions or need a hand? We're happy to help. Reach our team at [support@cometly.com](mailto:support@cometly.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.