> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/activate/event-streaming/destinations/advertising/meta/meta-pixel.md).

# Meta Pixel

Meta Pixel, formerly Facebook Pixel, is tracking code for websites. It monitors visitor behaviors including page views, purchases and sign-ups. It helps advertisers assess Meta ad effectiveness, refine campaigns through user behavior analysis, and create targeted advertising across Meta platforms.

This is the browser version of Meta's tracking. For the server version, see [Meta Conversions API](/activate/event-streaming/destinations/advertising/meta/meta-conversions-api.md). See [Meta](/activate/event-streaming/destinations/advertising/meta.md) for why to use both.

## Getting started

You need one or more Meta Pixel IDs. You can get a Pixel ID from the snippet on the Meta Pixel creation page. Chord loads the Meta Pixel for you, so you don't install any script.

## Settings

* **Destination Name** (required): a name to tell this destination apart.
* **Pixel ID** (required): one or more Meta Pixel IDs. Click **Add Pixel ID** to add a row for each one. Each ID goes on its own row, and blank rows are ignored. To send events to a single pixel, add just one ID.
* **Product Content ID Field** (required): which product field to use as the content ID (`sku`, `variant_id` or `product_id`). Defaults to `sku`. It must match the content IDs of your catalog in Meta Business Suite, and it is used in the `contents.[].id` field.
* **Consent Requirements** (optional): the consent categories a visitor must accept before Chord sends data to this destination. See [Consent](/activate/event-streaming/consent.md).

## Connect

Add **Facebook Pixel** from the destination catalog, using the settings above. See [Connect a destination](/activate/event-streaming/connect-a-destination.md) for the full steps.

## Multiple pixel IDs

The destination supports any number of Pixel IDs on a single destination. Initialization is lazy — on the first tracked event the Meta events script is loaded once (shared across all pixel IDs), and each pixel ID is initialized on-demand before its events are sent. All events are dispatched per-pixel using Meta's `trackSingle` API rather than the broadcast `track` API, so each pixel receives exactly the events configured for it with no cross-pixel spillover.

Common uses:

* **Multi-agency setups** — route the same storefront events to pixels owned by different media agencies without creating separate destinations.
* **Brand or market segmentation** — fire events to separate pixels for distinct brands or regional ad accounts that share a single storefront.
* **Parallel testing** — run a new pixel alongside an existing one during a transition period to validate parity before cutting over.

**Adding a second pixel ID**

1. Open the Edit form for the destination.
2. Click **Add Pixel ID** in the **Pixel ID** section to add a new row.
3. Enter the additional Pixel ID.
4. Click **Save Changes**.

After saving, the new pixel will be initialized on the next tracked event and will start receiving all mapped events alongside the existing pixels.

**Removing a pixel ID**

Delete the row from the **Pixel ID** list and save. The pixel stops receiving events as soon as the updated configuration is picked up — no further events will be sent to it. No data is deleted from Meta — historical events already received by that pixel are unaffected.

### Migrating from a legacy single Pixel ID

Destinations created before multi-pixel support was added store their ID in a legacy `pixelId` field. The Edit form automatically promotes this value into the new **Pixel ID** list on first open, so no manual migration is needed. Save the form once to persist the promoted value; after that the destination is fully on the new format.

## Event mapping

| Chord event                                                                 | Meta event                                                               | Notes |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ----- |
| Page                                                                        | PageView                                                                 |       |
| [Checkout Started](/collect-data/tracking-plan/checkout-started.md)         | InitiateCheckout                                                         |       |
| [Order Completed](/collect-data/tracking-plan/order-completed.md)           | Purchase                                                                 |       |
| [Product Added](/collect-data/tracking-plan/product-added.md)               | AddToCart                                                                |       |
| [Product Viewed](/collect-data/tracking-plan/product-viewed.md)             | ViewContent                                                              |       |
| [Subscription Created](/collect-data/tracking-plan/subscription-created.md) | Subscribe                                                                |       |
| [Payment Info Entered](/collect-data/tracking-plan/payment-info-entered.md) | AddPaymentInfo                                                           |       |
| [Signed Up](/collect-data/tracking-plan/signed-up.md)                       | CompleteRegistration                                                     |       |
| [Email Captured](/collect-data/tracking-plan/email-captured.md)             | Lead, or the custom event SMSSignup when `properties.lead_type` is `sms` |       |
| *(other track events)*                                                      | Original event name, sent as a custom event                              |       |

## Common event options

| Chord source (priority order)                                                                                    | Meta field   | Notes                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------- |
| `properties.order_id` for Order Completed (Shopify GraphQL IDs reduced to the numeric ID); `messageId` otherwise | eventID      | Used for deduplication with the Conversions API. Falls back to `messageId` when an Order Completed has no `order_id` |
| `userId` > `anonymousId`                                                                                         | external\_id | Omitted if neither is present                                                                                        |

## Deduplication

Order Completed uses the order ID as the event ID, so it matches the same order sent by the [Meta Conversions API](/activate/event-streaming/destinations/advertising/meta/meta-conversions-api.md). Every other event uses the Chord message ID. See [Meta](/activate/event-streaming/destinations/advertising/meta.md#how-they-deduplicate) for how the two versions deduplicate.

## Page

Fires a Meta page view event.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "PageView", {}, eventOptions)`

The call is repeated for each configured Pixel ID. No additional attributes accompany page events.

## Checkout Started

Fires an initiate checkout event with order and product data.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "InitiateCheckout", orderData, eventOptions)` *(repeated for each configured Pixel ID)*

| Chord source (priority order)                                                                                     | Meta field         | Notes                                                                    |
| ----------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------ |
| The **Product Content ID Field** you chose, then `sku` > `product_id` > `id`                                      | `content_ids`      | Array of all product IDs                                                 |
| *(hardcoded)* `"product"`                                                                                         | `content_type`     |                                                                          |
| First product's `category`                                                                                        | `content_category` |                                                                          |
| Array of `{ id, quantity, item_price }` per product                                                               | `contents`         | `id` is chosen the same way as `content_ids`; `quantity` defaults to `1` |
| `properties.currency` > `properties.meta.i18n.currency` > `"USD"` (default)                                       | `currency`         |                                                                          |
| `properties.value` > `properties.total` > `properties.price`, then the sum of each product's price times quantity | `value`            | Formatted to 2 decimal places; defaults to `"0.00"`                      |
| Count of content IDs                                                                                              | `num_items`        |                                                                          |
| `properties.order_id` > `properties.orderId` > `properties.id` > `properties.cart_id`                             | `order_id`         | Omitted if none is present                                               |

The event is sent without order data if the event has no products.

## Order Completed

Fires a purchase conversion event with order and product data. An Order Completed with no products is skipped, so an empty cart never reports a purchase.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "Purchase", orderData, eventOptions)` *(repeated for each configured Pixel ID)*

Same attributes as Checkout Started above.

## Product Added

Fires an add-to-cart event using the first product from `order.products`.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "AddToCart", productData, eventOptions)` *(repeated for each configured Pixel ID)*

| Chord source (priority order)                                                | Meta field         | Notes                                               |
| ---------------------------------------------------------------------------- | ------------------ | --------------------------------------------------- |
| The **Product Content ID Field** you chose, then `sku` > `product_id` > `id` | `content_ids`      | Array with one value                                |
| *(hardcoded)* `"product"`                                                    | `content_type`     |                                                     |
| product `name`                                                               | `content_name`     |                                                     |
| product `category`                                                           | `content_category` |                                                     |
| `properties.currency` > `properties.meta.i18n.currency` > `"USD"` (default)  | `currency`         |                                                     |
| product `price`                                                              | `value`            | Formatted to 2 decimal places; defaults to `"0.00"` |
| `[{ id, quantity, item_price }]`                                             | `contents`         | Single-element array; `quantity` defaults to `1`    |

The event is sent without product data if the event has no products.

## Product Viewed

Fires a content view event using the first product from `order.products`.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "ViewContent", productData, eventOptions)` *(repeated for each configured Pixel ID)*

Same attributes as Product Added above.

## Subscription Created

Fires a subscribe event with order and product data.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "Subscribe", orderData, eventOptions)` *(repeated for each configured Pixel ID)*

Same attributes as Checkout Started above.

## Payment Info Entered

Fires an add payment info event with order and product data.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "AddPaymentInfo", orderData, eventOptions)` *(repeated for each configured Pixel ID)*

Same attributes as Checkout Started above.

## Signed Up

Fires a complete registration event. It carries no product data, only custom-mapped properties.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "CompleteRegistration", customData, eventOptions)` *(repeated for each configured Pixel ID)*

## Email Captured

Email Captured covers both email and SMS signup forms. Set `properties.lead_type` to `email` or `sms` to say which.

* Email (or no `lead_type`): fires Meta's standard Lead event.
* SMS: fires SMSSignup. Meta has no standard SMS event, so this goes out as a custom event.

**Meta Pixel SDK call:** `fbq("trackSingle", pixelId, "Lead", customData, eventOptions)` or `fbq("trackSingleCustom", pixelId, "SMSSignup", customData, eventOptions)` *(repeated for each configured Pixel ID)*

## Custom events

All other track events are sent as custom events under their own name, cut to 50 characters. Identify events are skipped.

## Custom property forwarding

Configure destination mappings in Chord with `properties.*` destination paths to forward additional event properties into the `fbq("trackSingle", ...)` payload. Only explicitly-configured non-schema fields are forwarded — nothing flows through automatically.

**How to configure:**

1. In Chord, open the destination's connection and find **Property Mappings**. See [Property mappings](/activate/event-streaming/property-mappings.md#add-a-mapping) for the steps.
2. Add a mapping with source path `properties.loyalty_tier` and destination path `properties.loyalty_tier`.
3. On the next event, `loyalty_tier` will appear in the event data payload sent to Meta.

**What is excluded:**

* Fields Chord already computes (for example `currency`, `value`, `content_ids` and `contents`). A mapping to `currency`, `value`, `content_ids`, `contents` or `products` is ignored.
* PII fields (`email`, `phone`, `first_name`, `last_name`) — PII is not forwarded by the pixel; use the Meta Conversions API destination for server-side user matching

A mapping to any other field Chord computes, such as `content_name` or `order_id`, replaces the computed value.

## Initialization

This destination supports one or more Pixel IDs. On the first event, it loads the Meta events script once (shared across all pixel IDs on the page), then calls `fbq("init", pixelId)` for each configured ID — optionally with `{ external_id }` if `userId` or `anonymousId` is present on the triggering event.

Each Pixel ID has its own initialization lifecycle (`fresh` > `loading` > `loaded`/`failed`), so IDs initialize independently without blocking one another. The script load itself is shared via a single promise — concurrent events during loading queue until the script is ready. If the script fails to load, all subsequent events are silently dropped.

If no valid Pixel IDs are configured, Chord logs a warning and skips initialization entirely.

## CSP requirements

If your site uses a Content Security Policy, allow the following domains:

| Directive     | Domain                         |
| ------------- | ------------------------------ |
| `script-src`  | `https://connect.facebook.net` |
| `connect-src` | `https://connect.facebook.net` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/activate/event-streaming/destinations/advertising/meta/meta-pixel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
