---
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
published_at: '2026-10-01'
last_updated: '2026-10-28'
---

The [Meta Pixel](<https://developers.facebook.com/documentation/meta-pixel/get-started>) is browser code used to measure website actions, build audiences and support ad optimisation by sending configured events such as PageView, AddToCart and Purchase to Meta. Find its numeric Pixel or dataset ID in Events Manager by selecting the intended data source and opening Settings. Choose one integration owner and verify a consented event before relying on reporting.

## How to find your Meta Pixel ID

1. Open [Meta Events Manager](<https://www.facebook.com/events_manager2/>) with an identity that can access the intended business's assets. Our [Meta Events Manager guide](</library/meta-events-manager>) explains the dataset view.
1. Select the intended business and open Data sources, then choose the website dataset. Meta's dataset rollout can change the labels shown in your account.
1. Open Settings and copy the data source's numeric ID; Meta documents Settings as the place to view the ID and owner.
1. Compare the ID with your website tracking setup. For a manual Pixel, the ID appears in ` fbq('init', 'YOUR_PIXEL_ID') ` in the base code.

Meta's [Events Manager navigation](<https://www.facebook.com/business/help/898185560232180?locale=en_US>) describes the Settings ID field. Its [dataset explanation](<https://www.facebook.com/business/help/750785952855662?locale=en_US>) covers the shared Pixel/dataset ID, and the [base-code reference](<https://developers.facebook.com/documentation/meta-pixel/get-started>) shows the ID in website code.

A synthetic Pixel ID looks like ` 123456789012345 `: a numeric identifier, not an access token. Use the ID of your own intended data source, not this example.

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.

### How do you create a Meta Pixel?

Create the Pixel in Events Manager before installing its base code and configuring events. Meta's documented website flow is:

1. Open Events Manager, select Connect data → Web, then Connect.
1. Enter the Pixel's name and select Create pixel to generate its ID.
1. Enter your website URL and select Check to see available partner options; follow the offered partner setup, or continue to the other setup options.
1. Choose Get guidance for recommendations or Do it yourself to select the setup directly.
1. In the self-directed flow, choose Conversions API and Meta Pixel or Meta Pixel only, then follow the displayed partner or manual-installation instructions.

These steps follow [Meta's installation guide](<https://www.facebook.com/business/help/952192354843755?locale=en_US>). Creating the ID does not install code or prove that events arrive; the setup methods and installation checks below cover those separate steps.

For a business portfolio, Meta also documents Meta Business Suite → Settings → select the portfolio → Data Sources → Datasets & pixels as the asset-management and creation path. Full control of the portfolio is required for that creation workflow; see [Meta's business-portfolio guide](<https://www.facebook.com/business/help/314143995668266?locale=en_US>). To copy an existing ID, use the Events Manager Settings route above.

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

## Is a Pixel ID secret?

No. A Meta Pixel ID is public in the website's installed base code, including ` fbq('init', 'YOUR_PIXEL_ID') `; the ID selects an event destination and is not an access token. Meta documents the [public ID and unwanted-event risk](<https://www.facebook.com/business/help/572690630080597?locale=en_US>) separately from the [dataset permissions needed to view data or manage settings](<https://www.facebook.com/business/help/1178675675606697?locale=en_US>).

Knowing the ID alone does not grant access to the dataset's analytics, settings or advertising account. Another site can, however, copy the ID into Pixel code and send unwanted browser events. Meta provides [domain allow lists and block lists in Traffic permissions](<https://www.facebook.com/business/help/572690630080597?locale=en_US>) for controlling that traffic. Treat a Pixel ID as public configuration, and keep access tokens and server secrets private.

## 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 website events from the browser; Conversions API sends events from a server. They can report matching copies of one action or different actions, such as a later backend-confirmed payment. See [Conversions API vs Meta Pixel](</library/conversions-api-vs-meta-pixel>) for what each channel can see and when to use both.

## Frequently asked questions

### Where can I find my Meta pixel ID?

Open Events Manager, select the intended dataset or Pixel, then open Settings and copy the numeric ID. Follow the [Pixel ID steps above](<#how-to-find-your-meta-pixel-id>) and check that the website initializes the same ID.

### How do I get my Meta pixel code?

Get the base code for the selected Pixel from Events Manager's installation flow. Follow [Meta's Pixel setup instructions](<https://developers.facebook.com/documentation/meta-pixel/get-started>), then make sure your consent integration controls when the code runs.

### How do I delete a Meta pixel?

Removing a Pixel from your website is different from deleting a data source in Meta: remove its base code or disable the integration that installs it. That removes the browser sender; it does not delete the Events Manager dataset or stop a separate Conversions API integration. See [the base-code installation](<#what-does-meta-pixel-code-look-like>) before changing the sender.

### What events does the Meta pixel track?

The base code sends PageView; other events depend on the actions and integration you configure, such as AddToCart and Purchase. See [standard events versus custom conversions](<#standard-events-versus-custom-conversions>) and [Meta's event reference](<https://developers.facebook.com/documentation/meta-pixel/reference>).
