Skip to main content

Implement Meta Conversions API Program via ATS for Web

You can integrate an ATS for Web configuration with the Meta Conversions API Program to collect online event data and send them to the Meta systems. You can use the event data to perform campaign measurement or ad targeting optimization for Facebook ads.

In this article, you will learn how to configure the events you want to send to the Meta CAPI. The event data can be collected via CSS selectors, URL, or data layer detection. A data layer is a JavaScript object that is used to pass information from your website to your tag management solutions.

Make sure you have fulfilled the requirements for setting up Meta CAPI before you get started. To learn more about the requirements, see "The Meta Conversions API Program for Online Conversions".Implement Facebook Conversion Adapter API

Features Included

This implementation method comes with the following features:

  • Obtain identity envelopes

  • Handle opt-outs from IAB U.S. Privacy API, GPP (U.S. state-specific strings) and TCF

  • Collect required parameters from Meta

  • Set up customizable events

  • Set up customizable triggers for each event

Set Up ATS for Web to Send Event Data

The procedure below is a direct continuation of the steps from "Set Up Meta Conversions API Program Integration in Console".

  1. Under “Event information”, select if you want to “Signify the event as a test”. When you enable this option, you can enter a code generated from Meta’s test event tools that can be used to distinguish the test event from other events. To learn more, see Meta's article "Test Events Tools".

  2. Select if you want to “Use IAB U.S. Privacy String”. When enabled, ATS will send an opt out signal to Meta and exclude the event for ads delivery optimization.

    Meta_Privacy_String.png
  3. Next, you must specify the events you want to send. Under ‘Events List’, click Create New.

    Meta_Create_New_Event.png
  4. Enter an Event Name and select the Event Type.

  5. (Optional) If the predefined standard events aren't suitable for your needs, you can select Custom Event as the event type. When selected, you must enter the name of the custom event in the Custom Event field.

    Custom_Event.png
  6. (Optional) If your website is leveraging data layer run by Google Tag Manager or Adobe Analytics, you can enable Data Layer Detection. If you enable this option, all parameters in this event will be obtained through data layer detection by default.

    Data_layer.png

    Note

    The data layer detection functionality currently supports data layer run Google Tag Manager and Adobe Analytics. To learn more, see Google's article "The data layer" or Adobe's article "Create a data layer".

  7. Enable event deduplication to eliminate duplicate events sent to Meta. Check Add Event ID and select how the Event ID should be obtained, and for which identifier. In the example below, we are using the Order Number as the Event ID.

    event_deduplication.png

    Note

    CSS selector allows you to obtain the parameter by targeting a specific HTML element in your page. We recommend using only ID selector to limit errors. For example; #product-value, #ItemValue

    Alternatively, you can provide a URL parameter which is added at the end of a URL after the ‘?’ symbol. For example; currency, product-currency

  8. If you selected the Purchase Event type, you must provide additional parameters under Required Custom Data for the ‘Currency’ and ‘Value’ and choose how to obtain them. Select URL or CSS Selector for each parameter and provide the required data.

    FB_CAPI_Required_param.png
  9. (Optional) Select Add Customer information to include additional parameters based on customer’s information. Click the plus button to add another parameter or select the minus button to remove.

    FB_CAPI_Customer_info.png
  10. (Optional) You can add standard parameters defined by Meta in the Standard Data Parameters section which include order ID, content type, content name, and others. For example, you can configure a purchase event that's only fired when a particular product is purchased from your website. The more parameters you add, the more accurate the data Meta will receive.

    You can also add your own Custom Properties, which can be used for both custom events or standard events, to further define custom audiences. When this option is enabled you can define your desired property and, if using the CSS selector method, configure the value of the property.

  11. Set up the Trigger event to decide when the events should be sent. Select Automatically to have it sent every time the event happens, or by an API call.

    If you select to set up a trigger event by an API call, this can be done by calling ats.sendFbEvents(['name_of_event']), where 'name_of_event' should be replaced with the event name you provided in step 4.

    Note

    For non-purchase events such as 'Add to Cart', Account 'Creation', and others, we recommend setting up a trigger event only on some pages to make sure they are not fired on every page load.

  12. Specify to have the trigger added to all pages by selecting Always, or in specific pages by selecting On some pages. If you choose the latter, you need to provide the page URL and a domain identifier. Click the plus button to add multiple pages.

    fbcapi_trigger.png
  13. Click Save.

  14. If you enabled Data Layer Detection (see step 6), in the Events List, click the three-dotted icon corresponding to the event you've just created and click Get Snippet. Copy the JavaScript code displayed to obtain the data layer specifications needed to push the event.

    Events_list.png

Once you are done with setting up the events, you may want to verify if your setup is working correctly in Meta Events Manager. After you start sending events, you should be able to verify them within 20 minutes.

To see an overview of event data delivered to Meta, log in to Events Manager and click the Data Sources tab.