# Connect Meta

> Send Numbat's engagement event to Meta through the Conversions API and make it a custom conversion.

Available on the Optimize plan and above.

Numbat sends Meta one server-side event, `Numbat_Engagement`, for each
visitor who reaches the engagement level you choose. Each visitor is sent
once. You then make the event a custom conversion, so campaigns can
optimize toward it.

1. [Get the dataset details in Meta](#1-get-the-dataset-details-in-meta)
2. [Connect the dataset in Numbat](#2-connect-the-dataset-in-numbat)
3. [Set up Ad Signals in Numbat](#3-set-up-ad-signals-in-numbat)
4. [Turn on signals](#4-turn-on-signals)
5. [Create the custom conversion in Meta](#5-create-the-custom-conversion-in-meta)

## Before you begin

- The Optimize plan or above.
- A Numbat role that can edit site settings. A Workspace Member cannot.
- Access to the Meta dataset, with permission to generate a Conversions API
  token. See Meta's guide to
  [getting started with the Conversions API](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started).

## 1. Get the dataset details in Meta

You need three values: the Dataset ID, an access token and a test event
code.

1. In Meta Ads Manager, open **Events Manager** from the menu.

   ![The Meta Ads Manager menu, with Events Manager selected below Billing and payments](../../../assets/docs/meta/events-manager-menu.png)

2. Choose **Datasets**, then select your dataset.

   ![The Events Manager menu, with Datasets selected between Overview and Custom conversions](../../../assets/docs/meta/datasets-menu.png)

   ![The Events Manager dataset list, with one dataset selected, showing its name and ID](../../../assets/docs/meta/dataset-list.png)

3. On the **Settings** tab, copy the **Dataset ID**. Meta may call it the
   Pixel ID.

   ![The dataset's Settings tab in Events Manager, with the Dataset ID under Details](../../../assets/docs/meta/dataset-id.png)

4. On the same tab, under **Set up direct integration**, choose
   **Generate access token**. Either option above the button works. Copy
   the token now. Meta shows it only once.

   ![The Set up direct integration section of the dataset's Settings tab, with Set up with Dataset Quality API selected and a Generate access token button below](../../../assets/docs/meta/generate-token.png)

   ![Meta's access token panel, with the token blurred and a note to copy and save it because Facebook will not store it](../../../assets/docs/meta/token-dialog.png)

5. Open the **Test events** tab and copy the **Test event code**. Leave
   this tab open. Numbat's test event only shows while it is open, and the
   code changes each session.

   ![The dataset's Test events tab in Events Manager, showing the test event code with a Copy button beside it](../../../assets/docs/meta/test-events-code.png)

## 2. Connect the dataset in Numbat

1. [Open Ad Signals in Numbat](https://app.numbat.io/go/ad-signals)
   Choose **Connect Meta**.

   ![The platform list on Numbat's Ad Signals page, with LinkedIn and Meta marked Not connected, each with a Connect button](../../../assets/docs/numbat/ad-signals-offer.png)

2. Under **Connect your dataset**, enter the three values.

   ![Numbat's Connect your dataset step, with empty fields for the Dataset ID, the access token and the test event code, and a Save and verify button](../../../assets/docs/numbat/meta-details-form.png)

3. Choose **Save and verify**. Numbat sends one test event. Nothing
   reaches your reporting.

4. On the Test events tab, the event appears as `Numbat_Engagement` from
   Server. It shows only **Click id** and **User agent**. That is
   expected, since it matches no real person.

   ![The Test events tab in Events Manager receiving activity, with a Numbat_Engagement custom event received from Server and marked Processed, its user data keys Click id and User agent](../../../assets/docs/meta/test-event-received.png)

If verification fails, the Meta page says why. Fix it (see
Troubleshooting), choose **Edit** on **Connect your dataset**, and verify
again with a fresh test event code.

## 3. Set up Ad Signals in Numbat

These settings apply to every ad platform. Skip this section if you set
them for another platform already.

1. [Open Consent and matching in Numbat](https://app.numbat.io/go/ad-signals/consent)
   Under **Advertising consent**, pick an option. Signals cannot turn on
   until you do. [Consent and emission](/docs/conversions/consent-and-emission)
   explains the two options.

   ![The Advertising consent setting in Numbat, with the two options: Wait for a consent signal, and My consent tool blocks tracking](../../../assets/docs/numbat/ad-signals-consent.png)

2. Under **Known customer matching**, leave the Meta switch on and choose
   **Save**. It sends a hashed email and phone for identified visitors, so
   Meta can match people who never clicked an ad.

   ![The Known customer matching setting in Numbat, with a switch for LinkedIn and one for Meta, both on](../../../assets/docs/numbat/ad-signals-identity.png)

3. [Open Who counts in Numbat](https://app.numbat.io/go/ad-signals/signal)
   Pick the engagement level that counts as a conversion, and choose
   **Save**. The default is High Intent only. Each option shows how many
   visitors reached it in the last 14 days.

   ![The Who counts options in Numbat: Engaged and above, Researching and above, and High Intent only, each with a visitor count, with High Intent only selected](../../../assets/docs/numbat/ad-signals-signal.png)

## 4. Turn on signals

1. [Open the Meta page in Numbat](https://app.numbat.io/go/ad-signals/meta)
   Or choose **Continue setup** beside Meta on **Ad Signals**.

2. Choose **Turn on signals**. If the button is unavailable, a note in the
   step says what to fix. Sending starts now. Visitors who qualified
   earlier are not sent.

3. The page shows **Sending**, with a reminder to create the custom
   conversion. Choose **Done** on it once you have.

   ![The reminder in Numbat: Last step, create the custom conversion in Meta, with the event Numbat_Engagement, an Open guide button and a Done button](../../../assets/docs/numbat/meta-conversion-step.png)

   ![The Meta connection in Numbat, marked Sending, with rows for the Dataset ID, Who counts, Matching and Consent, and Pause, Edit details and Disconnect buttons](../../../assets/docs/numbat/meta-live.png)

The first time you turn signals on, Numbat sends one sample event so
`Numbat_Engagement` appears in Meta's event list. It describes no visitor
and carries no personal data, and it stays in your Meta event data.

## 5. Create the custom conversion in Meta

1. In Events Manager, choose **Custom conversions**.

   ![The Events Manager menu, with Custom conversions selected below Datasets](../../../assets/docs/meta/custom-conversions-menu.png)

2. Choose **Create custom conversion**.

3. Under **Name**, enter a name you will recognize, such as Engaged
   Visitors. **Description** is optional.

4. Under **Data source**, pick your dataset.

5. Set **Action Source** to **Website**.

6. Set **Event** to `Numbat_Engagement`.

   > Note. The event can take up to an hour to appear, depending on your traffic. If it is not listed, wait and reload Events Manager.

7. Under **Choose a standard event for optimization**, choose **Select
   your own category**, then **Custom attribution**.

8. Under **Rules**, choose **URL** and **contains**, then enter your
   domain, such as `example.com`. For more than one domain, add each as
   another keyword in the same rule.

   > Warning. Use your whole domain, not a single page. Numbat sends conversions from every page of your site, so a rule for one page misses them.

9. Leave **Enter a conversion value** unchecked.

10. Choose **Create**.

    ![Meta's Create a custom conversion dialog, with the name Engaged Visitors, the dataset as the data source, Website as the action source, Numbat_Engagement as the event, Custom attribution as the standard event for optimization, and a rule that the URL contains xyz.com](../../../assets/docs/meta/custom-conversion.png)

## Check that it works

The Meta row on **Ad Signals** counts visitors sent in the last 14 days,
within minutes of each one qualifying.

### In the dataset

On the dataset's **Overview**, `Numbat_Engagement` shows as Active through
the Conversions API. Meta can take up to 20 minutes to show server events.

![The dataset's Overview tab in Events Manager, listing the Numbat_Engagement event as Active through the Conversions API, with its event match quality and total events](../../../assets/docs/meta/dataset-overview.png)

A received event is not a matched one. The event match quality score shows
how well Meta matches them, and it fills in only with real ad-driven
visitors.

### In the custom conversion

Under **Custom conversions**, yours shows as Active with its total
conversions. It records only matched events from real visitors.

![The Custom conversions list in Events Manager, with an active custom conversion on the Numbat_Engagement event, its URL contains rule, its total conversions and a chart of conversions by day](../../../assets/docs/meta/custom-conversion-active.png)

## Troubleshooting

### Verify fails with a permission error

The token cannot write to this dataset. Generate it from this dataset in
Events Manager, or give its system user access in Business settings. Then
save again.

### Verify fails with an invalid token

Check the token is for this dataset and has not expired, then save again.

### Verify reports no events received

Use the current test event code, and keep the Test events tab open while
you verify.

### `Numbat_Engagement` is missing from the custom conversion picker

Meta lists live events only. It can take up to an hour after you turn
signals on. Reload Events Manager.

### The connection says "Stopped"

Meta refused the saved token. Sending pauses and waiting visitors are
kept. Choose **Edit details**, enter a new token and choose **Save and
verify**. Saving without verifying does not resume sending.

![The Meta connection in Numbat, marked Stopped, with a note that Meta rejected the saved access token, the connection's details, and an Edit details button](../../../assets/docs/numbat/meta-needs-attention.png)

## Next steps

- [Emission status](/docs/conversions/emission-status)
- [Consent and emission](/docs/conversions/consent-and-emission)
- [Connect LinkedIn](/docs/conversions/connect-linkedin)
