---
title: 'Meta Pixel: what it is, find your Pixel ID and set it up'
description: 'Find your Meta Pixel or dataset ID, choose manual, platform or managed setup, and understand base code, standard events and consent before testing.'
canonical: 'https://plainrouter.com/library/meta-pixel'
format: Guide
last_updated: '2026-10-01'
---

The Meta Pixel is browser code that sends configured website events to Meta, such as PageView, AddToCart and Purchase. To set it up, identify the correct Pixel or dataset in Events Manager, choose one integration owner and verify a consented event before relying on reporting.

## Meta Pixel, dataset and Pixel ID: what is the difference?

**Meta Pixel is still the browser integration.** A **dataset** is the Events Manager container that can combine events from the Pixel, Conversions API and other supported sources. Calling the whole setup a dataset does not turn a browser event into a server event.

Meta says an existing Pixel linked to a dataset keeps its ID as the dataset ID. A dataset created without an existing Pixel can receive a new ID. The dataset ID can be used when configuring Pixel and Conversions API integrations. [Meta's dataset explanation](<https://www.facebook.com/business/help/750785952855662>)

Your Pixel ID identifies the destination; it is not an ad account ID, a campaign ID or an access token. It appears in browser code and is not a secret credential. Meta access tokens and Plainrouter server secrets belong on the server.

## How to find your Meta Pixel ID

1. Open [Meta Events Manager](<https://business.facebook.com/events_manager>) with an identity that can access the intended business's assets.
1. Select the correct business, then open its website data source. Depending on your interface, the list may be labelled **Data sources** or **Datasets**.
1. Select the intended Pixel/dataset and open **Settings**. Locate **Dataset ID** or **Pixel ID**; the identifier may also appear beside the data-source name.
1. Copy the numeric identifier, then compare it with the ID used by your website integration. In a manual installation, look for ` fbq('init', '...') `.

Meta's interface is rolling out dataset terminology, so labels can differ. If the asset is missing, check business selection and permissions before creating another Pixel. Creating a new ID does not reconnect an existing integration's history.

If you have no Pixel yet, Meta's setup flow starts with **Connect data → Web** in Events Manager and guides you through creating it and choosing an integration. [Meta setup instructions](<https://www.facebook.com/business/help/952192354843755>)

## What does Meta Pixel code look like?

The base code loads Meta's library, initializes the destination ID and sends a PageView. Meta recommends placing its installation in the website's shared head; your consent integration must still control when it executes. Get the actual base code for your destination from Events Manager. [Developer setup reference](<https://developers.facebook.com/docs/meta-pixel/get-started/>)

This recognizable base-code example is wrapped in a function so it does **nothing until your consent integration calls it**. Replace the placeholder ID and invoke it once per document only after the required advertising consent is granted. The wrapper is illustrative; it is not a complete consent-management implementation.

```javascript
function startMetaPixelAfterConsent() {
  if (window.fbq) return; // Another installation already owns the Pixel.

  !function(f,b,e,v,n,t,s) {
    if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s);
  }(window, document, 'script',
    'https://connect.facebook.net/en_US/fbevents.js');

  fbq('init', 'YOUR_PIXEL_ID');
  fbq('track', 'PageView');
}
```

The usual image-based ` noscript ` fallback is omitted here: an unconditional image request can bypass a JavaScript consent gate. Handle withdrawal and later events through your consent integration too; once a request has been sent, hiding a banner cannot recall it.

After initialization, a standard event call looks like this:

```javascript
// Only after the app confirms the action and consent still permits sending.
fbq('track', 'Purchase', { value: 49.00, currency: 'EUR' });
```

Use the actual purchase value and currency. Do not fire Purchase simply because someone clicked a checkout button, or add this manual sender alongside an integration already sending the same event. For paired browser/server delivery, follow the [event-ID deduplication guide](</library/meta-event-id-deduplication>).

## Choose one setup method

### Manual installation

Use the manual option in Events Manager, install the base code behind your consent gate and add event calls at the corresponding application actions. Document who owns each event. Single-page navigation, confirmation-page reloads and payment redirects need deliberate triggers rather than blindly repeating the base code.

### Platform integration

Use your platform's supported integration when it already owns storefront and checkout events. Shopify's **Facebook & Instagram by Meta** channel, for example, provides Pixel setup and data-sharing controls. Its documentation explicitly warns against leaving duplicate manually installed Pixel code in the theme. Review the selected sharing level and consent configuration rather than assuming installation alone is sufficient. [Shopify's instructions](<https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-pixel>)

Other platforms have their own supported event mappings and setup steps. Check those before combining plugins, a tag manager and a manual installation.

### Managed Pixel plus Conversions API with Plainrouter

In Plainrouter, open **Connections → Ad accounts → Meta**, authorize the required assets, then choose the destination under **Meta delivery**. Select the dataset by name or ID and compare it with Events Manager before saving. [Connect Meta](<https://plainrouter.com/docs/signals/connect-meta>)

Signals sends eligible browser Pixel and Conversions API events after ` ad_storage `, ` ad_user_data ` and ` ad_personalization ` are all granted. Its Meta ` _fbp ` and ` _fbc ` cookie handling is subject to that full consent grant; ` _fbc ` requires relevant click context, so do not assume every consented visitor has both cookies. The managed browser/server pair shares event identity. [Consent and event collection](<https://plainrouter.com/docs/signals/track-events>)

A saved connection is not delivery proof. Verify the installation and destination outcome, and retire overlapping senders for the same events after validating the replacement. For backend purchases, follow the documented purchase-owner pattern rather than independently firing both the browser command and a server event.

## Standard events versus custom conversions

**Standard events** are Meta-defined action names sent by your integration. A **custom event** is a name you define and send with ` fbq('trackCustom', ...) `. A **custom conversion** is a rule configured in Events Manager to classify qualifying activity; creating one does not add missing event collection to your website.

| Common event | Trigger it when | Setup note |
| --- | --- | --- |
| PageView | A tracked page is viewed | Included in the base-code example; avoid sending it twice for one load |
| ViewContent | A relevant product or content detail is viewed | Supply the relevant content identifiers where needed |
| Search | A visitor completes a search | Avoid sensitive data in search parameters |
| AddToCart | An item is actually added to the cart | Tie it to the successful cart action |
| InitiateCheckout | Checkout begins | This is not a completed purchase |
| AddPaymentInfo | Payment information is added | Never send card details as event parameters |
| Purchase | A purchase is completed | Include the required numeric value and currency |
| Lead | A qualifying lead action completes | Define the action consistently; not every page view is a lead |
| CompleteRegistration | Registration completes | Trigger after successful completion |
| StartTrial | A trial begins | Keep the trigger distinct from subscription payment |
| Subscribe | A paid subscription starts | Do not treat a free trial as the paid subscription event |

The table is a practical selection, not the complete event catalogue. See Meta's [event reference](<https://developers.facebook.com/docs/meta-pixel/reference/>) for required parameters and its [conversion guide](<https://developers.facebook.com/docs/meta-pixel/implementation/conversion-tracking/>) for custom conversions. Do not place sensitive health or financial information in event names, URLs or conversion rules.

## Check the installation

Test one action at a time with a permitted test setup. Confirm the expected ID and browser event, then inspect **Events Manager → Test Events** for receipt. Test consent acceptance and refusal separately. Seeing the browser call does not prove ad attribution.

For extension installation, statuses and errors, use the dedicated [Meta Pixel Helper / Meta Ads Data Advisor guide](</library/meta-pixel-helper>). Use it when the expected ID or event is missing, or the extension reports a warning.

## Meta Pixel versus Conversions API

The Pixel sends from the browser; Conversions API sends from a server. They can report matching copies of the same action, or different actions such as a backend-confirmed payment. The server path does not remove consent requirements or automatically repair a bad event trigger.

Continue with [Meta Conversions API setup](</library/meta-conversions-api>), [what \_fbp and \_fbc mean](</library/fbp-fbc>), or the broader [pixel tracking definition](</definitions/pixel-tracking>).
