> ## 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.

# Exclude an event from the Conversion API (consent, GPC and CCPA)

> Exclude an event from the Conversion API in Cometly: keep it for attribution and reports, but never send it to an ad platform after an opt-out.

Cometly's Conversion API (CAPI) sends the conversions you track to your ad platforms server-to-server. Sometimes an event (a lead, a sale or another action Cometly records) should stay in Cometly only: the visitor opted out of data sharing under CCPA, their browser sent a Global Privacy Control (GPC) signal, or they declined your cookie banner. To exclude an event from the Conversion API in those cases, Cometly supports a per-event flag, `do_not_capi`.

When the flag is set on an event, Cometly records it exactly as usual, so attribution, reports, revenue and the contact's timeline are unaffected, and the event is never forwarded to any ad platform. You still see which ad produced each lead and sale, while honoring the person's opt-out. You tag the events you already send. There is no need to create a duplicate event.

> [!NOTE]
>
> The flag applies to every Conversion API destination in your space (Meta, Google, TikTok, LinkedIn, Microsoft, Reddit, X and the others). It cannot exclude one platform and keep another. The data-sharing mode and event rules on the **Conversion API** tab of Events Manager control which event types are sent at all. `do_not_capi` controls individual events.

> [!NOTE]
>
> **Disclaimer:** This page is for informational purposes only and is not legal advice. Per our [Terms of Service](https://www.cometly.com/terms), you are responsible for complying with the privacy laws that apply to you and for deciding which events may be shared with ad platforms.

## How it works

1. Your site or system decides whether the person has opted out of ad data sharing.
2. You send the event to Cometly with `do_not_capi` set to `true`.
3. Cometly stores the conversion and skips the Conversion API for that event only. Every other event is sent according to your Conversion API settings.

The flag is checked on every event, so a person who opts out today and opts back in next month is handled correctly each time.

## Option 1: Cometly API

Add `do_not_capi` to the event payload. Set it to `true` to keep the event in Cometly only. Set it to `false` or leave it out to send the event as usual. The field is accepted on `POST /public-api/v1/events/track` and on the original `POST /public-api/v1/events` endpoint.

```json theme={null}
{ "event_name": "purchase", "email": "jane@example.com", "amount": 149.00, "do_not_capi": true }
```

> [!WARNING]
>
> Send a JSON boolean (`true` / `false`) or the numbers `1` / `0`. Do not send the text `"false"` in quotes: any non-empty text counts as set, so the event would be kept out of the Conversion API.

Full field reference: [Create Event](https://docs.cometly.com/api-reference/endpoint/create-event.md).

## Option 2: Webhooks

If the app sending the webhook includes the person's consent decision in its payload, map it to Cometly's flag.

1. In **Events Manager**, open the webhook event and go to the **Configure Mapping** step.

2. Click **Add Field** and select **Do Not Send via Conversion API**.

3. Map it to the property in your payload that says whether the person opted out. To apply the same setting to every event this webhook receives, choose the `fixed_value` option instead and enter the value.

   ![Configure Mapping step of a webhook event with the Cometly Fields and Data Fields columns, and a box around the Do Not Send via Conversion API row mapped to the opted\_out property of the sample payload.](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/guides/conversion-api/exclude-an-event/01.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=e8ac3f50e2c3399660cfa1f45ec64890)

4. Click **Save & Continue**.

Cometly reads the mapped value as follows:

| Value received | Result |
| - | - |
| `true`, `1`, `yes`, `on` | Kept in Cometly only, not sent to the Conversion API |
| `false`, `0`, `no`, `off`, empty | Sent to the Conversion API as usual |
| Property missing from the payload | Sent to the Conversion API as usual |
| Anything else | Kept in Cometly only. An unexpected value never shares data. |

Values are matched regardless of capitalization, so `TRUE` and `Yes` work too.

> [!TIP]
>
> If your payload carries consent the other way round (for example `consent_given: true` means the person agreed to sharing), add the **Invert true/false value** formatter to the mapping under **Formatting Options**. If the decision depends on several fields, such as a state and a GPC flag, use the **Set value by condition** formatter to set the flag by rule.

New to webhooks? See [Webhooks](https://docs.cometly.com/integrations/webhooks.md).

## Option 3: Conversions added manually

When you add a conversion to a contact by hand (on the contact's page, **Actions** > **Add Conversion**), tick **Do not send event via Conversion API** before you click **Add Conversion**.

![Add Conversion dialog with Purchase selected as the Event Name and a box around the ticked Do not send event via Conversion API checkbox.](https://mintcdn.com/cometly/BM7eSn6-ecx8ZzBx/images/guides/conversion-api/exclude-an-event/02.webp?fit=max\&auto=format\&n=BM7eSn6-ecx8ZzBx\&q=85\&s=ba1f7236ec3889271b8f709c41cb7e1e)

## Browser pixel events

Events fired by the Cometly pixel in the browser can't carry this flag yet. If you track conversions with the pixel and need to honor an opt-out, either send those conversions server-side through the API or a webhook with the flag set, or block the pixel until the person consents, as described in [Track only after consent](https://docs.cometly.com/guides/tracking/consent.md).

## Check it worked

* The event still appears in Cometly: in the [Events Log](https://docs.cometly.com/support/troubleshooting/general/event-log.md) for API and webhook events, and in the contact's timeline.
* The event does not appear in the ad platform, for example in Meta Events Manager or in your Google Ads conversion action.

## Good to know

* **Per event, not per contact.** The flag affects only the event it is set on. Other events from the same person follow your Conversion API settings.
* **It can't recall an event already sent.** Setting the flag on an event Cometly has already forwarded does not remove it from the ad platform.
* **Nothing else changes.** Attribution models, reports, revenue and contact timelines include the event as normal.
* **Your Conversion API settings still apply.** Events without the flag are sent according to the data-sharing mode and event rules for each platform. See [Conversion API](https://docs.cometly.com/guides/conversion-api/overview.md).

## Frequently asked questions

### Does Cometly detect Global Privacy Control (GPC) or my cookie banner's opt-out automatically?

No. Your site or system decides whether the person has opted out, then sends the event to Cometly with `do_not_capi` set. Cometly acts on the flag it receives with each event.

### Can I exclude an event from Meta only and still send it to my other ad platforms?

Not with this flag. `do_not_capi` keeps the event out of every Conversion API destination in your space. To control which event types each platform receives, use the data-sharing mode and event rules on the **Conversion API** tab of Events Manager.

### Does excluding an event from the Conversion API stop Cometly from tracking that visitor?

No. The event is still recorded in Cometly and counts in attribution and reports. If no data may be collected until the visitor opts in, block the Cometly pixel until consent instead, as described in [Track only after consent](https://docs.cometly.com/guides/tracking/consent.md).

## Next steps

* [Create Event: the full API field reference](https://docs.cometly.com/api-reference/endpoint/create-event.md)
* [Set up webhooks to send events to Cometly](https://docs.cometly.com/integrations/webhooks.md)
* [Track only after consent](https://docs.cometly.com/guides/tracking/consent.md)
* [Set up the Conversion API for each ad platform](https://docs.cometly.com/guides/conversion-api/overview.md)
* [Find an event in the Events Log](https://docs.cometly.com/support/troubleshooting/general/event-log.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.