Michael Levack  |   |  Facebook & Instagram Analytics  |  0 comments

How to Set Up the Facebook Conversions API

5 min to read ✭ In this post, you'll learn how to set up the Facebook Conversions API to continue collecting valuable data that will be blocked by the effects of the iOS 14 update on the Facebook pixel.

Facebook is one of the most popular social media platforms to date and it’s also one of the greatest marketing solutions mankind has experienced. With so many data privacy laws coming into effect, it is only a matter of time before 3rd party data becomes obsolete. One of the things starting to affect Facebook’s targeting algorithm is the update of iOS 14 which will take effect at the end of April 2021. However, Facebook has decided to fight back by introducing us to their conversions API (CAPI).

Facebook’s Conversion API is a response to the growing concerns from advertisers. Their concerns are about losing vital advertising data that they rely on to measure ad effectiveness and to optimize digital campaigns. So what is the Conversion API, also known as CAPI? It is a way to send data from your webserver to Facebook’s server to report on conversions. It prevents advertisers from losing out on data collection that is blocked by the browser and affects the Facebook pixel.

Below is our step-by-step guide on setting up your conversions API. 

CAPI Set Up Map

 

Set Up Google Analytics 4

  1. Set up Google Analytics 4 property here
  2. In your GA4 Property, set up data stream(s) for the website(s) you want to trackGoogle Analytics 4
  3. In each of your data streams, make sure the toggle button for ‘Enhanced measurements’ is turned off otherwise Google Tag Manager will send automatically collected events to Facebook
    • Sign in to Google Analytics
    • Click Admin, and navigate to the property you want to edit.
    • In the PROPERTY column, click Data Streams > Web.
    • Under ENHANCED MEASUREMENT, turn off the switch to disable all options.
      Click the settings wheel to edit individual options later if necessary.

 

Set Up a Google Tag Manager Server Container

  1. Create a new Google Tag Manager Server container
  2. Configure a GA4 Client:
    • Every GTM Server-side container comes with a default GA4 Client for listening to events configured from their GA4 Web Tag. The client listens to /g/collect route on your tagging server URL and sends the event Model to the downstream tag.
  3. Generate an API Token from your Facebook Business Manager
  4.  Create a ‘Constant’ variable in your GTM Server Container to use in your ‘Facebook Conversions API Tag’ later
  5. Copy your Facebook Pixel ID from your Facebook Business Manager account and create a ‘Constant’ variable in your GTM Server Container to use in your ‘Facebook Conversions API Tag’ later
  6. Copy your Test ID from your Facebook Business Manager and create a ‘Constant’ variable in your GTM Server Container to use in your ‘Facebook Conversions API Tag’ later

In your server container, create a new Tag and select the ‘Facebook Conversions API Tag’ and plug in your API Token, Facebook Pixel ID, and Facebook Test Code variables

 

Set Up a Google Tag Manager Web Container

  1. Create a new Google Tag Manager Web container
    • We want to have a new Google Tag Manager container so that it isn’t cluttered. The CAPI Template in the Server-Side container automatically picks up event data sent from GA4, so it will collect any events you have set up in your Web Container
  2. In your new Web Container, create a GA4 Configuration tag that fires on all pages.
  3. Next, configure your web container to send your website data to the created server; set your ‘transport_url’ Field to the Tagging Server URL.
  4. Configure your Tag and Trigger to track the event that you want to set up conversion tracking for
    • Be sure to follow the naming convention for GA4 events so the Facebook Server-side tag can automatically pick up the corresponding Facebook Event. List of eventsGoogle tag manager web container
    • Configure your GA4 event tag to pass the correct Parameters – such as email, first name, last name:
      • To pass the user_data parameters to the Server-side GTM, you must set the ‘first_party_collection’ flag to true.
      • Map each of the parameters you want to configure. The variable name has to be read from the event using the common event data schema.
  5. Test your event! 
    • Test the event through GTM
    • Test through Facebook’s test events

 

Generate a Facebook Access Token for Conversion API

There are three steps that are needed to successfully generate your Facebook access token and to export your conversion API into Google Tag Manager.

  1. Head over to your Events Manager and select “Settings” located on the right-hand side.facebook access token CAPI
  2. Next, you will want to scroll down to the Conversion API section and select “Set Up Manually”

    FB CAPI set up manually
    FB CAPI set up manually
  3. Once selected you will be prompted to select your pixel. Make sure to select the active pixel that is firing on your website. Once you have selected the right pixel click “Next.”
  4. You will then be prompted to this screen.generate an access token facebook CAPI
  5. If you are seeing the above screen please go ahead and “Generate Access Token.”
  6. Once your token has been generated be sure to select and copy it. (Please refer to step 4 in GTM server Container section)
    • If you have already generated an access token then you will need to click on “implementation” on the right-hand side of your Events Manager screen.CAPI Implementaions
  7. Once you have selected implementations you can go ahead and select “Get Started”CAPI Implementations 2
  8. Once you have selected your access token be sure to select “Implement the API Yourself” and head to step 4 in the Google Tag Manager Server Container SectionGoogle Tag manager server container
  9. Once your access Conversions API token has been successfully added, you now will want to test your setup.
  10. To test your CAPI (conversions API) you will head over to test events located in your Events Manager, and you will select the TEST ID on the right-hand side.
  11. Test Server Events CAPIIf your tracking was a success you should see your events firing and reading “server” under (received from).Test Your Events CAPI

Submit a Comment

Your email address will not be published. Required fields are marked *

Ready to grow your nonprofit?

Our team of purpose-driven digital marketers would love to learn more about your mission and chat about how your nonprofit can drive more online supporters, volunteers, clients & donors.