# Meta

To connect Meta to Middle, you'll need the following:

1. **Access Token**
2. **Pixel ID / Dataset ID**
3. **Test Event Code** (optional, used for testing)

## How to get Meta credentials

{% embed url="<https://developers.facebook.com/documentation/ads-commerce/conversions-api/get-started#requirements>" %}

{% stepper %}
{% step %}

### Open Meta Events Manager

Go to **Meta Events Manager** from your Meta Business account.

Make sure you are logged in as a user who has access to the correct business, ad account, and Pixel/Dataset.
{% endstep %}

{% step %}

### Select your Pixel or Dataset

In Events Manager, select the Pixel or Dataset that should receive events from Middle.

This should usually be the same Pixel or Dataset used for your website tracking and Meta Ads optimization.
{% endstep %}

{% step %}

### Copy your Pixel ID / Dataset ID

In the selected Pixel or Dataset, open the settings or overview area and locate the ID.
{% endstep %}

{% step %}

### Generate or copy the Conversions API Access Token

In the selected Pixel or Dataset, look for **Conversions API** settings.

Generate or copy the access token for the Pixel/Dataset.
{% endstep %}

{% step %}

### Get a Test Event Code

To test before going live:

1. Open the selected Pixel or Dataset in Meta Events Manager.
2. Go to **Test Events**.
3. Find the server event testing section.
4. Copy the **Test Event Code**.
   {% endstep %}
   {% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.middle.app/middle-docs/guides/app-reference/meta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
