> ## Documentation Index
> Fetch the complete documentation index at: https://www.macaly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Meta Pixel

> Add the Meta Pixel to your Macaly project

The Meta Pixel (formerly Facebook Pixel) tracks what visitors do on your site after clicking a Facebook or Instagram ad. If you run paid campaigns on Meta platforms, this is how you measure conversions and build retargeting audiences.

<Callout icon="user">
  Available on all plans
</Callout>

## Why use the Meta Pixel

* **See which ads actually drive results.** Track signups, purchases, and other actions back to the exact ad that caused them.
* **Bring back visitors who didn't convert.** Retarget people who visited your site with follow-up ads on Facebook and Instagram.
* **Reach new people like your best customers.** Let Meta build lookalike audiences based on who already converts on your site.
* **Let Meta optimize your ad delivery.** The more conversion data Meta has, the better it gets at showing your ads to the right people.

## What you need

Before you start, make sure you have:

* A **Meta Business Suite** account. Set one up at [business.facebook.com](https://business.facebook.com)
* Your **Pixel ID**. A number that looks like `123456789012345`

<Accordion title="How to find your Pixel ID">
  1. Go to [Meta Events Manager](https://business.facebook.com/events_manager)
  2. Select your pixel from the left sidebar (or create one if you haven't)
  3. Click **Settings**
  4. Your **Pixel ID** is displayed at the top
</Accordion>

## Add the Meta Pixel to your project

Open the chat in your Macaly project and ask the agent:

```
Add the Meta Pixel to my site. My Pixel ID is 123456789012345.
```

The agent adds the Meta Pixel base code to your project. Once your site is published, the pixel starts tracking page views automatically.

<Tip>
  Replace `123456789012345` with your actual Pixel ID from Meta Events Manager.
</Tip>

## Verify it's working

<Steps>
  <Step title="Install the Meta Pixel Helper">
    Add the [Meta Pixel Helper](https://chrome.google.com/webstore/detail/meta-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc) Chrome extension. It shows which pixels are active on any page.
  </Step>

  <Step title="Visit your published site">
    Open your live Macaly project in Chrome.
  </Step>

  <Step title="Check the extension">
    Click the Pixel Helper icon in your browser toolbar. You should see your pixel listed with a green checkmark and a **PageView** event.
  </Step>
</Steps>

<Info>
  The pixel runs in the editor preview too, but events will be attributed to the preview domain, not your published site. For accurate data, check your analytics after deploying.
</Info>

## Track conversions

The pixel tracks page views by default. To measure specific actions, ask the agent to add conversion events:

| What to track            | Example prompt                                                                |
| ------------------------ | ----------------------------------------------------------------------------- |
| **Lead form submission** | *"Fire a Meta Pixel Lead event when someone submits the contact form"*        |
| **Purchase**             | *"Track purchases as Meta Pixel Purchase events with the order value"*        |
| **Add to cart**          | *"Send a Meta Pixel AddToCart event when someone adds a product to the cart"* |
| **Signup**               | *"Fire a Meta Pixel CompleteRegistration event after signup"*                 |

These events appear in Meta Events Manager and Ads Manager, so you can see exactly which ads drive results.

<Info>
  **Cookie consent.** The Meta Pixel sets cookies to track visitors across sessions and devices. If your site has visitors from the EU, UK, or other privacy-regulated regions, you are responsible for ensuring a cookie consent solution is in place before the pixel loads. Meta's own policies also require advertisers to comply with local privacy laws.
</Info>

## Good to know

* The pixel runs in the editor preview too, but events will be attributed to the preview domain. For accurate data, check your analytics after deploying
* **Standard events** like `PageView` are tracked automatically once the pixel is installed
* You can test events in Meta Events Manager under **Test Events**. Useful for verifying conversion tracking before launching a campaign
* If you also use [Google Tag Manager](/en/integrations/google-tag-manager), you can add the Meta Pixel through GTM instead of directly. The agent can help with either approach
