How to setup Meta Conversion API (CAPI) with Segment.io

The Facebook Conversion API (CAPI) by Meta enhances ad targeting and reporting but is often overlooked by marketers due to setup complexity. This article will show you how to easily set up CAPI using Segment

Abhishek

Monday, June 10, 2024

facebook meta conversion api integration with segment
facebook meta conversion api integration with segment
facebook meta conversion api integration with segment

The Facebook Conversion API (CAPI) is a useful tool offered by Meta that can enhance the targeting and reporting capabilities of your Facebook ads. However, many marketers tend to overlook it due to the complexity involved in setting it up. In this article, we’ll explore how to set up the Facebook Conversion API through Segment easily.

As online advertisers, we rely on Meta Pixel to track events when a user visits our website and performs actions such as pageview, button click, form submit, and Add to cart. The Pixel collects and sends these events directly from the user’s browser to the advertising platform. This helps us optimize our ads and improve ad performance.

As people have become more cautious about their privacy, they are reluctant to be tracked. As a marketer, you may have experienced a negative impact on Facebook Ads due to the iOS 14 update in September 2020.

In the iOS 14 Update, Apple allowed users to opt out of being tracked by Facebook, which affected ad targeting. As a result, Facebook advertising was severely impacted at that time.


However, Facebook later made several algorithm updates to their platform and introduced several changes to safeguard marketers. One of the awesome updates was Conversion API, also known as CAPI.

What is Meta Conversion API (CAPI)?

Facebook’s Conversions API is a way to send your data directly from your application servers to Facebook. This is more reliable than using Facebook’s pixel to collect data from the user’s device. With Conversions API, you can choose what data to share with Facebook and share conversion events that may not even happen on your website. This includes events that happen within your app or CRM.

Image credits: Segment.io

Benefits of Using the Facebook Conversion API

  1. Better Ad Targeting: By pulling all your data into one place, the API provides richer insights, enabling more accurate ad targeting and improved audience reach.

  2. More Cost-Effective Campaigns: Sharper targeting and precise measurement allow you to refine your advertising strategies, reduce costs, and increase your ROAS.

  3. Campaign Attribution: Forget about guessing how your campaigns are performing. The Conversion API offers reliable data, giving you a clear picture of your campaign’s effectiveness and ensuring conversions are attributed correctly.

  4. Easier Data Integration: The API takes the stress out of managing multiple data sources by consolidating them into a single system, streamlining your operations and boosting efficiency.

  5. Tracking Offline Conversions: It’s also equipped to track offline events, making sure that every conversion, whether it happens online or offline, is measured and accounted for in your analytics.

There are multiple ways to set up Facebook Conversion API, but in most cases, you may need the assistance of a developer to do so. However, platforms such as Segment.io make it super easy to set up the Facebook conversion API.

How to Setup Facebook Conversion API with Segment.io?

Step 1: Create Meta Pixel

First, You will need to create a Meta Pixel, to create new Pixel go to your Meta Business Settings and click on Data Source > Datasets. Then, click the add button to create a Pixel.

If you already have a Pixel, then you can ignore this step.

Create Dataset pixel

Now, name your pixel, (here I have given it as Demo Pixel) and click Create.

Then, you will have the option to “choose how to connect your website“, Here you can select Meta pixel and conversion API and click next.

Connect website activity using conversion API.

In this step select check for partner Integration

Select Segment

4 Select Segment

Connect your segment account to Meta

First, Turn on Authorise Segment Connection and click on Next Button and then click Finish.

5 Authorise Segment conection

Done, Your Meta Pixel is created.

Step 2: Setup Segment.io

To set up Facebook Conversion API using Segment, you need to make sure of the following things:

  • Your website is integrated with Segment.io

  • You have set up tracking events for form submissions, Add to Cart, Purchase, etc.

  • Go to Sources > Website > Debugger > and check for the track events

As you can see in the attached screenshots, whenever a user fills out a form on our website, we have set up a form submit tracker via Segment to capture the data.

You can learn more about tracking events with Segment in – this post. If you need help setting it up, consult with your developer.

Once you have integrated, your website. Go to Connections > Destinations and Click + Add Destination.

Step 3: Add Destination – Facebook Conversion API (Action)

Go to Catalog and search for Facebook Conversion API, and select the destination ‘Facebook Conversion API (Action)

Select Data Source:

Now you need to select a data source for this destination. Since website is the source, select your website data source and click next.



Setup:

  • Destination Name: Give it a name like – Facebook CAPI

  • How would you like to set up this destination? – Select fill in setting manually

Click Create Destination.

11 Give Destination Name

Setting of Facebook Conversion API Destination:

  • Name: Give it a name

  • Pixel ID: Enter your Meta pixel ID. If you don’t know where it is, refer to STEP 1.

  • Test Event Code: Leave it blank.

  • Enable Destination: You can turn it On.

Saves The Changes.

12 Enter Pixek ID and turn on destination

Step 4: Configure the mappings of the destination

Now we have to setup the mapping, to send the data from segment to our pixel. To do this you need to Vist Mappings > New Mapping.

13 Click Mapping

Add Mapping

Segment has already created some custom facebook Pixel mappings like Purchase, Search, Page view, and Initiate checkout.

In this tutorial, I will setup Conversion API to send user details to Facebook whenever a visitor submit a form in my website. By sending more user data back to Meta, we can help their algorithm better understand our target audience, which will lead to more effective ad targeting.

So we will select Custom Event.

14 Select Meta Custom Event

Custom Event Setup

1. Select events to map and send: Enter the event name, which you have setup to track form submit data from website, If you don’t know that event name, go to the website source in segment and check the debugger.

Here, I have put “formfillcomplete” event because that is the track event which we have setup to capture form submit data in segment.

2. Add test event: After entering the event name click on load test event from source.

custom event mapping segment

After clicking on the load test event, a sample trigger event will appear. This event is triggered when a user submits a form on the website and includes parameters such as name, email, phone number, country, city, and region.

It is up to you what parameters you are capturing through your website.

16 Load test event

Now, once you have a sample data, you just need to map it.

Map all the available properties like Name, email, Phone, Country, City, Region, Gender Etc.

17 Map the properties

After you have mapped all the properties, click on the “Send test event to destination” button. This will send a test event to the Meta. If the test is successful, you can click on the “Save” button. If the test fails, check the error message and fix the issue accordingly.

18 Send test event to destination

Once you have set up the custom event, you also need to set up the “Page View” event and enable the mappings. Follow the same steps above to set the Page View event; just change the custom event to the “Page View” track event and map the parameters.

19 setup pageview and custom mapping

Step 5: Check Meta Events Manager

Now, go to the events manager within the meta ads manager to see if the events are coming or not. If you don’t see the event right away, don’t worry – it may take some time to appear.

Simply visit your website and manually perform the action that triggers the event. This should help the event to appear in the events manager.

Once you see your custom event in the event manage, click on it, and click “View Details.”

20 Meta Event manager conversion api event

Here, as you can see, the events are being received from the browser as well as the Server. This means both pixel and server are sending the event data to Meta and your conversion API is working properly.

Congratulations, you have successfully configured Meta Conversion API via Segment.

21 Meta Event Breakdown

Events Overview in Meta Event Manager

In the events overview tab, you will be able to see the analytics and the performance of your event. Meta will tell you the Match Quality Score and Event Deduplication stats.

The Match Quality Score is given by Meta when you configure the Conversion API. You don’t have to score a perfect 10/10. Simply sending the basic parameters is enough to improve your score.

22 Event Match Quality

How to improve the Match Quality Score in Meta Events Manager?

While setting up Facebook conversion API, sending more parameters can lead to an improvement in your quality score, but it is not mandatory to provide all the details. Basic information such as name, email, country and city, which are usually captured on the website, are sufficient to improve your match quality score.

23 Parameter to improve match quality for conversion api

Conclusion

The Facebook Conversion API is a tool that enables you to track events on your website or application more efficiently, securely, and with better reporting.

This API also helps the Facebook ads algorithm optimise audience targeting, which can ultimately help serve more relevant ads to people interested in your products or services. By targeting the right audience, you can increase the chances of users taking action such as filling out a form or making a purchase.

If you’re a marketer, you can make use of Segment.io to easily set up the Facebook Conversion API without having to rely on developers.

I hope this article helped you. If you face any issues, please let me know in the comments, and I will get back to you ASAP.

Get in touch.

Interested in discussing anything related to growth marketing, projects, or just saying hi? Let's connect!

©2024 Growthlity crafted with 🧡 from Uttarakhand, India

Get in touch.

Interested in discussing anything related to growth marketing, projects, or just saying hi? Let's connect!

©2024 Growthlity crafted with 🧡 from Uttarakhand, India

Get in touch.

Interested in discussing anything related to growth marketing, projects, or just saying hi? Let's connect!

©2024 Growthlity crafted with 🧡 from Uttarakhand, India