> For the complete documentation index, see [llms.txt](https://help.doctorlogic.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.doctorlogic.com/docs/extensions/facebook-pixel.md).

# Facebook Pixel

Facebook Pixel allows you to track ad performance and key metrics from people visiting and converting on your website.

The [Facebook Pixel](https://www.facebook.com/business/learn/facebook-ads-pixel) makes it easy to track conversions and determine the ROI of your Facebook (FB) advertising campaigns. Enabling this extension adds the FB Pixel code blocks to the *\<head>* of each page with the correct FB Pixel ID and event values.

![](https://2741824567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAUTtHOF4cY8fyDoNkF%2F-LBRIvty4Wj6upW4dYJe%2F-LBRJ69opV8b4PQ9EKuE%2F4421b85-facebook_pixel.png?alt=media\&token=5a04200f-9ffc-4a29-a3da-2021d1a95ed5)

## Prerequisites

You must [create/setup a FB Pixel](https://www.facebook.com/business/help/952192354843755?helpref=faq_content#createpixel) in your FB advertising account. Make sure you enable the *Lead event* during setup. Once setup, please \[Contact Support]\(doc:contact-support) and include the FB Pixel ID in your request.

## Helpful Notes

* On all page loads (except Confirmation page) we fire the *Pageview* standard event.
* On the Thank You (Confirmation) page the *Lead* standard event.
* We do not *currently* support firing custom events/conversions.
* A site can have 1 or more FB Pixels providing they are not duplicate FB Pixel IDs.
* The FB Pixel only renders on production and Implementation URLs. It does NOT render on on-page editing URLs.

## Testing + Troubleshooting

It is recommended that you test/validate that the FB Pixel is correctly functioning. You can easily accomplish this by using the [Facebook Pixel Helper chrome extension](https://developers.facebook.com/docs/facebook-pixel/pixel-helper). Once installed, you'll get details about which FB Pixel and event was fired.

![](https://2741824567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAUTtHOF4cY8fyDoNkF%2F-LBRIvty4Wj6upW4dYJe%2F-LBRKTqxgOB6SArIrhCk%2F25008ce-image2017-8-10_8_49_53.png?alt=media\&token=5d91e443-0ec9-4dea-8c42-54c56900d9d3)


---

# 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://help.doctorlogic.com/docs/extensions/facebook-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.
