How to Set up Facebook Conversion API on Shopify
Tags: api, facebook, shopify, devops
Published: 2022-10-13 07:22:49

Having accuracy problems tracking data through Facebook Pixel? Hold on: It’s time to sing the Facebook Conversion API’s praises as it will help you secure much better results in no time. 

Your browser-based, vintage Facebook Pixel fails to deliver accurate and consistent data due to ad-blockers, cookie blockers, etc. because it works on the browser side. On top of all that, the latest iOS updates put you in a tight spot when it comes to tracking & monitoring data through Facebook Pixel. 

The Facebook Conversion API comes to the rescue, though. It works on the server side and gets all your purchase data in the back end, providing much better results at the end of the day. 

Here, I’ll help you to set it up on your Shopify store - with no additional apps required. 

##3 Things You Should Do Before You Set Up Facebook Conversion API on Shopify

There are a couple of things to get done before taking action. First things first, you need to make sure that you:

1. Install the Facebook Channel App on your Shopify store. 
2. Get Facebook Business Manager with admin rights.
3. Use the native FB app to set up FB CAPI on your Shopify store.

##The Easiest Way to Set Up Facebook Conversion API on Shopify 

You can benefit from the native integration using Facebook Sales Channels to secure a solid setup that works. Just follow the steps below:

**1-** Navigate to the Shopify Admin > Online Store > Preferences > Setup Facebook

![Navigate to the Shopify Admin > Online Store > Preferences > Setup Facebook](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55mr7z41nx2azl95lfdd.png)

**2-** Authorize your FB Business Manager account and select the pixel. Make sure you opt for ‘Maximum’ to let all the data possible flow. Then, confirm.

![Authorize your FB Business Manager account and select the pixel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3n1m3sau4v9dc7mkerp.png)

##How to Validate Your Facebook Conversion API on Shopify

The native Facebook Conversion API setup on Shopify includes the browser pixel as well, and this is very useful for your validation. You should first check the Facebook Pixel to see if it includes the variables/data that FB CAPI needs.

###Step 1: Check browser-based Facebook Pixel
Go ahead and download a Chrome extension named **[Facebook Pixel Helper](https://chrome.google.com/webstore/detail/facebook-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc)** to kick things off. Then, go to your Shopify store’s homepage.

Here, you should activate the extension. To do that, click the icon on the upper right corner and then the little pin icon as you can see below.   

![Step 1: Check browser-based Facebook Pixel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/udv36c05yjj7lsc95g6t.png)

Important: Keep in mind that you need to deactivate your adblockers, if you have any, because they cause a malfunction by blocking the Facebook Pixel. 

After you activate the extension as told above, go to your store’s website. You should now see the extension like this:

![You should now see the extension like this](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0074ru9eomtbh0h63eeu.png)

Here, the PageView should be triggered on your homepage. Ideally, I recommend that you make use of one pixel but some merchants might want to do multiple pixels although it’s not a good practice. 

You can see the Event ID when you click the PageView event. 

![You can see the Event ID when you click the PageView event](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jdfa2vtfnyq9yqiez1h3.png)

Here’s a quick reminder that you can use the Event ID to de-duplicate events. Visit **[this page](https://www.facebook.com/business/help/823677331451951?id=1205376682832142)** to get more in-depth information on the topic. 

Also, you can go to a product page on your store and see the ViewContent event on your FB Pixel Helper. It lets you monitor product-level data such as ID, price, name, category, etc. as shown below: 

![Also, you can go to a product page on your store and see the ViewContent event on your FB Pixel Helper](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3nsuiors0chaukux8kpp.png)

At this point, you can level up your pixel by taking the following actions: 

1. Navigate to FB Pixel Settings > Automatic Advanced Matching. 
2. Re-adjust the settings (set all of the fields ON)

![Re-adjust the settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ncohlja3pk9h68d6xu59.png)

At this juncture, there's yet another thing to do so that you can get the best out of pixel:  You need to navigate to FB Pixel Settings > Automatic Advanced Matching. Then, you should re-adjust the settings that are already in use. That's to say, make sure you set all of the fields (from Email to External ID) ON.  


###Step 2: See your data on Facebook Business Manager

You can go to FB Business Manager > Events Manager > Pixels section to check your data. It would be wise to say that you should check your data after a couple of days as it takes some time for the data to be monitored. 

Then, navigate to Facebook Business Manager > Data Sources > Events Manager

![Then, navigate to Facebook Business Manager > Data Sources > Events Manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/moaj63dwlvn55cs6n2bn.png)

Here, you need to make sure that you check the correct pixel - you can compare the Pixel IDs.
Then, you can see the events listed. You should see “Browser - Server" in some events to understand everything works well. 

You should also check the "Last received X minutes ago". Although it’s not updated instantly, you can see your data here in a couple of hours. For instance, if you can’t see some data related to a purchase here after 12 hours or so, it means that there’s something wrong with the setup. 

![You should also check the Last received X minutes ago](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fvtm2gep4au9q4ylgoet.png)

Then, click “Purchase” and see the parameters section, the last received time, and then click View Details as you can see below:

![Then, click “Purchase” and see the parameters section](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vpa1jw3ndqq66x3ilth2.png)

You should also see all of your latest sales in detail once you go to the Recent Activities: 

![You should also see all of your latest sales in detail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dab97jm83jc1d0idwc9y.png)

You can see the Event Parameters section to monitor which parameters are being sent - and whether they are being sent correctly.

Just some useful tip here: you can see the order details in the URL section. This helps you detect which orders are being counted and which ones are not so that you can have a much better idea on what’s going on. 

> Everything is set! Are you ready to set up Facebook Conversion API on your Shopify store and make much more of your data?