Overview
Ensighten has developed a Conversions API (CAPI) solution in line with Meta’s recommendation to deploy the Conversions API tags server-side to achieve greater accuracy with conversion tracking and targeting. This guide will serve as a step-by-step implementation guide on how to deploy both the Meta Pixel and CAPI tags using Ensighten. Meta recommends deploying both the Meta Pixel (on the client side) and the CAPI (on the server side) for maximum accuracy and tracking due to possible browser and device tracking restrictions.
Requirements
- User role with
Manage
andServer Tag Console
permissions. - Be familiar with Google Tag Manager and SST.
Generate and Store Conversions API Access Token
Within this guide, we will assume a Meta pixel has already been created within your Business Manager and deployed via Google Tag Manager. If you have not created the Meta Pixel yet, use this to help How to set up and install a Meta Pixel.
Creating an access token for the Meta Pixel
- Log in to Business Settings and select your business.
- Under Data Sources on the left, click on Pixels.
- Select your pixel and click Open in Events Manager at the top right.
- Ensure you have the correct Pixel ID highlighted in the menu on the left, then click on Settings in the right panel.
- Under the Conversions API section and set up manually subsection, click on the Generate access token link.
- Copy the generated access token and save it for the next step in the implementation.
Storing the Access Token as an SST Secret
- Log in to Ensighten and navigate to the Secrets section within the SST UI.
- Click Create Secret in the top right corner of the page.
- In the NAME field enter meta_access_token. In the VALUE field paste in the value of your access token you copied in the previous step. Finally, click SAVE.
Configure Meta Pixel
Now that your Pixel has enabled the Conversions API feature and you have set up your access token, the Meta Pixel needs to be modified to enable the Conversions API tag.
- Edit your existing Ensighten Meta Pixel tags (if they exist) or create a new one by visiting the Manage Apps page, and search for Meta (Facebook) Pixel,
- Click Configure (or simply, click here).
- Within the configuration page, expand the Conversions API panel toggle on Enable SST Conversions API Integration.
- If this is a new Pixel tag, choose your Space and add any necessary Conditions or Ensighten
- Events that should execute this Pixel.
- Click Save & Commit.
- Publish the space.
Meta highly recommends sending user data (where possible) such as the user’s email address and/or phone number to improve the event match quality. These options are available in the “User Data” panel shown in the screenshot below.
Configure Server-Side Tagging Library
Next, we need to configure the Server-Side Tagging (SST) Library. You will only need one instance of the SST library for all your SST tags, so if you’ve already configured the tag, you can skip this step.
- Visit the Manage Apps page, search for Server-Side Tagging (SST), and click Configure (or simply, click here).
- Select Core Library as the tag type.
- Enter a tag name, like SST - Library.
- Enter your SST first-party domain and any additional fields if necessary, such as your data layer.
- Click Save & Commit.
- Publish the space.
Configure Meta Conversions API
Visit the Manage Apps page, Apps Library, search for Conversions API, and click Configure when hovering over the Meta Conversions API, or you can navigate directly to the App Meta (Facebook) Conversions API.
- Enter a tag name, like Meta Conversions API.
- Select your Access Token SST Secret in the Access Token field.
- Make sure the Enable Conversions API Integration toggled is enabled.
- Click Continue and select a Server-Side Tagging Space, typically having SST in the name.
- Choose the Condition All Pages - Non-blocking (Asynchronous).
- Click Save & Commit.
- Publish the space.
Ensighten will automatically configure the below CAPI fields when using the integration: | |
---|---|
event_id | A unique identifier that is used to deduplicate the event sent by both the web through the Pinterest Pixel and the Conversion API. |
event_source_url | The page URL that triggered the event |
event_time | The time that the event took place. |
language | Two-character ISO-639-1 language code indicating the user's language. |
partner_name (ss-ensighten) | The third-party partner name responsible for sending the event to Conversion API on behalf of the advertiser. |
event_time | The time that the Facebook event took place. |
event_source_url | The page URL that triggered the Facebook event. |
event_id | A unique identifier that is used to deduplicate the event sent by both the web (via Meta Pixel) and the Conversions API. |
user_data.external_id | If an external ID is not provided, an autogenerated uuid (unique universal ID) that Server-Side Tagging establishes as the same ID on both the client-side page and server-side environment will be used. |
user_data.client_ip_address | The website visitor’s IP address. |
user_data.client_user_agent | The website visitor’s browser user agent. |
user_data.fbc | The Facebook click ID that is stored on the _fbc cookie on the website visitor’s browser. |
user_data.fbp | The Facebook browser ID stored in the _fbp cookie on the website visitor’s browser. |
The more information you send to the Conversation API, the better the match rate will be.
For more information on fields, visit Conversions API.
Testing and Validation
Validate Meta Pixel and SST beacon
- First, visit the Server Tag Console and make sure Event Collection is toggle_on on.
- Next, install the Meta Pixel Helper extension for your Edge or Chrome browser.
- Visit the webpage(s) where your Meta Pixel(s) execute, open your Developer Tools’ Network panel, filter requests by sst, and refresh the page.
- Click on the Meta Pixel Helper icon which should have a green badge with the number of Meta events that executed successfully.
- Validate the expected values are passed correctly.
- Now that the Meta Pixel is validated, look at the entry beginning with sst and look at the Payload tab. Expand the events array and ensure there is an entry with the name
"facebook_conversions_api_integration"
like what is shown below. - After validating both the Meta Pixel and SST beacon are executing properly click on the Headers tab for the SST request, expand Response Headers, and copy the value for the
xens- event-id
header to use in the next steps.
Validate Facebook Conversions API request
- Visit your Server Tag Console, select the filter icon, choose Event ID, and then paste your
x-ens-event-id
value copied from the Meta Pixel and SST beacon steps and click enter. - Click on the visibility icon to inspect your event.
- Find the POST request to
graph.facebook.com
, validate the request was sent successfully, usually shown with a 200 status code. Check that the data sent is correct in the Request Payload section.
Validate Facebook Events Manager
- Visit and log in to Meta Business.
- Upon login, visit the Events Manager.
- Choose your Meta Pixel in the right-hand panel.
- Your Meta Pixel events should populate in the bottom panel and the Integration column should say Browser • Conversions API notifying you that Facebook is receiving data both from the Browser, Pixel implementation on the website, and the Conversion API. You can also see your Event Match Quality based on the user data, like an email, phone, IP address, etc., that is being passed.