Set Up Facebook Conversion API for Magento: Step by Step

Targeting the right people, with the right offer at the right time is key to effective Facebook campaigns. To know what offers to create, you need to monitor your customer's behaviour constantly. 

Although Facebook Pixel offers that, it's not always possible to get the "clearest" of pictures. All because people use ad blockers and other technologies to block the third-party trackers. So you need a more stable connection.

And we have one — Facebook Conversions API.

Today you'll learn how to set it up in the Magento admin with no technical experience. All you need is the Magento 2 Facebook Pixel Extension.

Ready to start?

What is Facebook Conversions API

Facebook Conversions API is a tool that allows you to create a direct connection between your marketing data (website, app, CRM) and Meta technologies.

In other words, it allows you to send events from multiple channels from your server to Facebook Conversion API endpoints. This bypasses all browser technologies that block tracking and helps you get more reliable data about actions across all channels.

Why Do You Need Conversions API?

Although it's not easy to set up, Facebook Conversion API is totally worth it. Here are just some of the benefits it brings to the table

  • Improved measurement — since all data sources are maintained from one connection point, it helps you quickly determine which channels are the most effective. This improves your measurement capabilities and gives access to more ad optimization tools.
  • Robust targeting data — with Facebook Conversion API no data is missed due to browser issues. So you get a higher volume of more reliable first-party data you can use to target the right people at the right time.
  • Decreased cost per results — the first-party data you collect helps you improve targeting and allows to allocate your budget toward potential buyers.

Facebook Pixel and Facebook Conversion API

Before we move any further, it's important to understand the relationship between Facebook Pixel and the Conversion API. They work on the same thing —  transferring your marketing data to Facebook. The destination is also the same — Pixel ID.

The difference is that while Facebook Pixel is about website data, Conversion API allows you to track app and CRM events as well. The delivery method is different too. Facebook Pixel uses a browser and Conversion API — server.

So it's important to understand that you don't have to use either Conversions API or Facebook Pixel. You use both

In fact, there is no separate option for Conversion API when you create a new data source in the Events Manager. They recommend you use both Facebook Pixel and Conversions API.

Set Up Facebook Conversions API in Magento

Confuring the Facebook Conversion API is easy, on the Facebook side. The biggest challenge is implementing it into your website. But that's what the Magefan Facook Pixel tool covers.

1. Create a new data source

The first step is to navigate to the Facebook Events Manager, click on the Connect Data Source (+) in the left flyout menu, choose Internet and click Connect

connect new data source facebook

Then give a Name to the new data set and hit Create.

new data set facebook events manager

Insert your website URL and let Facebook Verify it.

add website to facebook data source

Choose the setup method yourself and click Further

choose set up method for data source facebook

Since we set up the API Conversions and Facebook Pixel, choose a corresponding method and move Further.

conversion api and facebook pixel

Choose how you want to connect Conversion API with your store by selecting the Partner Integration

set up facebook conversions api

Then choose Magento as a partner.

magento partner in facebook conversion api

Finally, Facebook asks you to connect your Magento account with Facebook. You can just click Further till you go through all the steps. 

connect magento account to meta

2. Get your access token

If the data source you've just created doesn't open right after you complete the setup, go to Data sources on the left fly out and find your source. 

Move to the Settings tab and scroll down to the API Conversions section. Then click Generate access token under the Direct integration settings

generate access token facebook conversion api

This will generate a unique access token on the same page. Just copy it and move to the next step.

3. Get your pixel ID

Scroll to the top of the Settings tab to get your pixel ID. Find and copy it under the Dataset identifier.

dataset identifier facebook events manager

4. Insert your pixel ID and access token into the admin panel

The most important part is implementing the Facebook codes into your Magento. For that navigate to Stores > Configuration > Magefan Extensions > Facebook Pixel

Once there, enter your Facebook Pixel ID in the General section.

magento 2 facebook pixel id

Then add the Access Token in the Conversion API area and Save the settings.

facebook conversion api magento

The Facebook Pixel starts collecting your website events right after you save the settings. No need for any extra steps. However, you might also need to check the connection.

5. Test the connection

To test how the Conversion API and Facebook Pixel work, go back to the Events Manager. Find the data source you've just created and move to the Event testing tab. 

Facebook allows you to check if your server events are configured correctly with the Graph API Explorer. So just follow the described steps.

check facebook api connection

As for the Facebook pixel, you can test it in the same tab. Just enter your website URL and perform some actions in your store. 

check facebook pixel connection magento

You should keep the Events Manager open the whole time to see the actions you perform:

testing facebook pixel connection

You're all set up. Now all you need to do is gather those valuable insights and use them to optimize your ads for the best results. 

Be sure none of the events taken on your store will be missed. A more stable and reliable connection provided by the Facebook Conversion API will overcome any browser blockers.