# How to set up Facebook Pixel to understand the actions people take on website?

### Overview

Facebook Pixel is an analytics tool that allows you to measure the effectiveness of your advertising by understanding the actions people take on your website. Therefore, [Setup Facebook Pixel](https://help.pagefly.io/manual/setup-facebook-pixel-to-my-page/) plays very important roles!

Therefore, Facebook Pixel plays an important role to monitor your Shopify Store Performance.

You can read more about [Facebook Pixel](https://www.facebook.com/business/help/742478679120153?id%3D1205376682832142).

### Requirements

Before getting started, ensure you have:

* A [Business Facebook page](https://www.facebook.com/business/tools/facebook-pages/get-started)
* A Shopify online store that is not password protected
* [Facebook Business Manager](https://www.facebook.com/business/help/1710077379203657?id%3D180505742745347) connected to your business’s Facebook page
* Administrator permissions
* A Facebook Ads account is set up and ready to go. If you haven't done that yet, simply follow Facebook's step-by-step guide, which can be found [here](https://www.facebook.com/business/tools/ads-manager).

If you have successfully setup Facebook Pixel on your account, skip Step 2.

### How To Setup Facebook Pixel

#### Step 1: Setup Facebook Pixel

First, in [Events Manager](https://www.facebook.com/events_manager2/), go to Business Settings > Click Data Source > Select Pixels > Click More

![](/files/31fNOxHEMB2RhE6jhzQH)

Next, choose your pixel name > Click Continue > Set up pixel now > Add code using partner integrations

![](/files/SPnhtL07XzkK7YrB288j)

Then choose Shopify as a Partner.

![](/files/db4kgebjbKm8tT0XJ3t0)

Follow the 3-step process to successfully connect the [Facebook Pixel](https://www.facebook.com/business/help/646757258759189) to your Shopify account.

![](/files/e054uIweFGeM6tqSEvYa)

Once you’re all set, it’s time to add a Facebook Pixel ID to your Shopify store.

#### Step 2: Install Facebook Pixel to Your Store

Make sure you’re on the Events Manager page. Copy the unique pixel ID under your account’s name.

Go back to your Shopify Admin > Head to Online store > Preferences > Paste the Pixel ID into the Facebook Pixel section > Hit Save.

Voila! You're all set to add a Facebook Pixel ID to your store.

#### Step 3: Add Facebook and Instagram App

1. From Shopify Admin, go to Sales Channel > Preferences > On Facebook Pixel section, select Set up Facebook.

![](/files/6mtRomyMfbQJwwYCHYvb)

2\. You will be directed to the Shopify App store page if you haven’t installed the app yet. After that, click on Install.

![](/files/fc6uapkcSua4n3Cz3kQg)

{% hint style="info" %}
**Note**: Once you click on the Set up Facebook button, you’ll redirect to the Shopify App Store to install the Facebook & Instagram app.
{% endhint %}

3\. Now, on the left sidebar, you’ll see a new sale channel which is Facebook & Instagram.

![](/files/wk3xLpWpeFmKl3DT5xcM)

#### Configuration

**General settings**

Now hop on over to the page you want to set up tracking.

The Tracking option for Facebook Pixel is available in 12 elements including:

* [Heading](https://help.pagefly.io/manual/heading-element)
* [Button](https://help.pagefly.io/manual/button-element)
* [Image](https://help.pagefly.io/manual/image-element)
* [MailChimp Form](https://help.pagefly.io/manual/integrate-mailchimp-form)
* [Product List](https://help.pagefly.io/manual/shopify-elements-product-list)
* [Product Image](https://help.pagefly.io/manual/shopify-elements-product-image)
* [Product Title](https://help.pagefly.io/manual/shopify-elements-product-title)
* [Product Add to cart](https://help.pagefly.io/manual/shopify-elements-product-add-to-cart)
* [Product View Details](https://help.pagefly.io/manual/shopify-elements-product-view-details)
* [Collection Image](https://help.pagefly.io/manual/shopify-elements-collection-image)
* [Collection Title](https://help.pagefly.io/manual/shopify-elements-collection-title)
* [Collection View Details](https://help.pagefly.io/manual/shopify-elements-collection-view-details)

There are 10 event types you can choose from, which are:

* Search
* View Content
* Add To Cart
* Add To Wishlist
* Initiate Checkout
* Add Payment Info
* Purchase
* Lead
* Complete Registration
* Custom Event

![](/files/ji3xartn4FtiQdc0Bpd5)

Once you choose an event type, the event code will be generated automatically.

To validate your pixel implementation, install the [Pixel Helper Google Chrome](https://chrome.google.com/webstore/detail/facebook-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc?hl%3Den) extension. When clicked, a panel will expand to show a detailed overview of the page's pixels, including warnings, errors, and successes.

![](/files/vTT9zsSon56YZ3NKBDu7)

**Check Facebook Pixel Event Tracking**

In Business Manager, select All Tools on the left sidebar > Choose Ads Manager.

![](/files/EBkqoZvrh6dnbuqBubxj)

Go to Ad Group tab > Click on column icon > Select Customize Columns.

![](/files/wn4uRY3A86DRNaCvYhk9)

Switch your view to Conversions > Scroll down to select the [type of pixel](https://developers.facebook.com/docs/facebook-pixel/implementation/conversion-tracking/) that you are using > Hit Apply.

![](/files/PWyQjwsBgYMJDbVW4iRX)

Select the menu again > Choose Events Manager. You will see the result of your pixel.

You can watch this video for more details:

{% embed url="<https://youtu.be/uxkzRz37W8A>" %}

### Use Cases

Below you’ll find the most frequently asked questions related to setting up the Facebook Pixel on your pages.

#### How To Fire A Specific Facebook Event When PageFly Page Is Loaded?

* **Step 1**: Head to the Editor
* **Step 2**: Insert the code below into the Custom Javascript option

```javascript
window.trekkie.load = function () {
  fbq("track", "ViewContent");
};

_window.addEventListener("load", function () {
  _;

  _fbq("track", "ViewContent");
  _;

  _;
});
_;
```

* **Step 3**: Click Save change and Publish the page
* **Step 4**: Check the result with the Facebook Pixel Helper

![](/files/FZ1BwvAEHDHhS0pDOqhR)

**Tips**

If you want to send additional objectives to the Facebook event, for example, “**content\_name**” and “**content\_type**” please use the following code:

```javascript
window.trekkie.load = function () {
  fbq("track", "ViewContent", { content_name: "Bearie Backpack", content_type: "product" });
};

window.addEventListener("load", function () {
  fbq("track", "ViewContent", { content_name: "Bearie Backpack", content_type: "product" });
});
```

Please keep in mind for the specific Facebook Event, you can assign pre-designed objectives. Please refer to the [Facebook Help doc](https://developers.facebook.com/docs/facebook-pixel/reference/).

For example, Facebook ViewContent supports the following objectives: content\_ids, content\_category, content\_name, content\_type, contents, currency, value.

Check the result with Facebook Pixel Helper. As you can see there are custom parameters sent including content\_type and content\_name.

![](/files/vQxtelLB6zhzGEMxKVEq)

#### How to fire the Facebook Pixel when the user scrolls a specific section?

* **Step 1**: Name your section.

In our example, it’s “**countdown**”.

![](/files/c9JAgJFyHlTh91IbFDQa)

* **Step 2**: Add custom Javascript code.

Two things you need to pay attention to.

Firstly, the jQuery function trigger the section ID with the name “**countdown**”.

Secondly, for our example, we send Facebook Pixel “**ViewContent**” without any objects.

* **Step 3**: Check the result

As you can see the section that we assigned a unique ID is called “**countdown**”, and after scrolling that part the Facebook pixel has been fired.

![](/files/rJgCeurERy90sv3fyK2Q)

#### How To Fire Multiple Facebook Pixels On The Same Page?

Inside the Customer Javascript settings please include code below:

Please keep in mind to replace “**YOUR PIXEL ID**” with your unique ID number. You can copy [the code](https://pastebin.com/raw/dbZ6ATbm) here.

![](/files/PrXqjYa2eVYnCnUOEtFS)

As a result you should see two pixels fired on the page load.

![](/files/E7BDCWY7BBaf30oNvJKB)

### Common Issues with Facebook Pixel

#### Error Messages

Error message: “**AddToCart Event missing some deduplication parameters**” or “**Purchase Event missing some deduplication parameters**”

* Reason: You have not successfully set up Facebook Pixel for your store.
* Solution: Please refer to the 3 setup steps above to check again if you missed anything.

#### Facebook Can Not Track Purchases Through ‘Shopify Thank You Page’

Solution:

* **Step 1**: Check if Facebook Pixel is completely set up in Online Store > Preferences. Refer to the steps above. Next, check to make sure your Facebook Pixel tracking app is working properly.
* **Step 2**: Check if Facebook Pixel is set up with Product Add to Cart, not the Button element.
* **Step 3**: Check if the Header and Footer are turned on.

#### Facebook Is Double Tracking One Event

Reason: You manually added an event for your PageFly page, while your Theme automatically fired the event before.

Check to see if it’s a product page built with PageFly or not.

Then, if you get the Theme from Themes Marketplace (themes.shopify.com), the reason may be that Facebook Pixel is already fired with Add to Cart. It leads to double tracking when you manually fired Facebook Pixel again with PageFly.Solution: Assign to None for your element you fired manually with PageFly

![](/files/lsa9UdAY5JCouIhe1MAK)

#### Sudden Disabled Facebook Tracking

Reason: Set up Facebook Pixel NOT in Online Store, but with manual code injection or within theme.liquid file.

Solution: Check the manual code or theme again.liquid file. Try to delete the manual code or restore Older versions of theme.liquid file > set up Facebook Pixel in Online Store > Preferences instead.

You may want to know how to Restore Older Versions of theme.liquid file.

![](/files/bf1yGMjq0OPz658w5Gky)

For other problems that are not listed above, the suggested solution is that please ensure you are ONLY firing Facebook Pixel properly by Online Store > Preferences, NOT by any other ways. Make sure the Facebook Pixel tracking app is working.

For more details about Facebook Pixel Advanced, check [this article](https://developers.facebook.com/docs/facebook-pixel/advanced/).

If you have any questions feel free [to submit a ticket](https://pagefly.io/pages/contact-us) and our Customer Support team will get back to you ASAP.

### Frequently Asked Questions

**1. What is Facebook Pixel?**

Facebook pixel is a piece of code, that should be embedded into your website (In this case, your Shopify Store), to measure, optimize and build audiences, with data collected from advertising campaigns.

**2. Where to find Facebook Pixel?**

It's under ‘**Business Settings**' > ‘**Data Sources**’ > ‘**Pixel**', in MetaSuites. Check out [this article](https://help.pagefly.io/manual/setup-facebook-pixel-to-my-page/).

**3. What are the different types of Facebook pixels?**

Three main types include standard events, custom conversions, and custom events.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.pagefly.io/page-structure-and-elements/optimization/setup-facebook-pixel-to-my-page.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
