The Conversions API enables advertisers to send web, app, physical store and business messaging events to Meta through a single endpoint rather than across multiple sources. This consolidation will simplify an advertiser’s tech stack and create a more comprehensive view within Meta Events Manager by using datasets.
This documentation provides guidance for integrating app events to the Conversions API.
App events sent through the Conversions API must be associated with a dataset.
Datasets allow advertisers to connect and manage event data from web, app, store and business messaging event sources to the Conversions API. Datasets may show event data from any of these integrations that you choose to set up:
Datasets enable you to view all customer activities from a single interface. They also allow you to reduce the effort to build and maintain multiple API integrations.
In Events Manager, advertisers have different options to create a dataset depending on their starting point. Or you can create a brand new dataset in Events Manager by linking during offline event set creation or through an existing mobile app or during messaging event set creation information. Note that linking a dataset to an application is required before sending mobile app events to the Conversions API and only one application can be linked to a dataset. See more details and instructions here.
You can make the GET
call to https://graph.facebook.com/v16.0/{ads-pixel-id}/is_consolidated_container to detect if the advertiser’s dataset is consolidated and thus eligible for passing app events via the Conversions API.
a. Linking dataset ID and app ID
In Events Manager, there are two ways to link your app with a dataset:
Once you complete the linking, the dataset includes the connected app.
b. Required fields
You can refer here to the current set of parameters that can be sent over the Conversions API. For sending app events, the following server_event fields can be shared in the payload:
action_source
must contain the value app
for app events.event_id
is required for the deduplication setup case.Parameter | Description |
---|---|
advertiser_tracking_enabled boolean | Required for app events Use this field to specify ATT permission on an iOS 14.5+ device. Set to |
application_tracking_enabled boolean | Required for app events A person can choose to enable ad tracking on an app level. Your SDK should allow an app developer to put an opt-out setting into their app. Use this field to specify the person's choice. Use |
extinfo object Please use the down arrow to the right to see the list of | Required for app events Extended device information, such as screen width and height. This parameter is an array and values are separated by commas. When using Note:
|
campaign_ids string | Optional An encrypted string and non-user metadata appended to the outbound URL (for example, ad_destination_url) or deep link (for App Aggregated Event Manager) when a user clicked on a link from Facebook. Graph API definition: Parameter passed via the deep link for Mobile App Engagement campaigns. |
install_referrer string | Optional |
installer_package string | Optional Used internally by the Android SDKs |
url_schemes array | Optional Used internally by the iOS and Android SDKs. |
vendor_id string | Optional Vendor ID. |
windows_attribution_id string | Optional Attribution token used for Windows 10. |
Parameter | Description |
---|---|
anon_id string | Do not hash. |
madid string | Do not hash. |
Parameter | Description |
---|---|
description string | Optional. |
level string | Optional. |
max_rating_value | Optional. |
success boolean | Optional. |
In summary, the app events shared using the Conversions API will require the following data parameters:
action_source
: Must be set to ‘app’. (By using the Conversions API, you agree that the action_source
parameter is accurate to the best of your knowledge)event_id
: Required for the deduplication setup, see details in ‘Set up deduplication for multiple channels’ section.advertiser_tracking_enabled
application_tracking_enabled
extinfo
Below is an example of extinfo
. Make sure all the sub parameters below are filled and in sequential order. If anything is missing, use an empty string as a placeholder.
Subparameter Name | Required | Data Type | Example |
---|---|---|---|
extinfo version | Yes | string |
|
app package name | No | string |
|
short version | No | string |
|
long version | No | string |
|
os version | Yes | string |
|
device model name | No | string |
|
locale | No | string |
|
timezone abbr | No | string |
|
carrier | No | string |
|
screen width | No | string |
|
screen height | No | string |
|
screen density | No | string |
|
cpu core | No | string |
|
external storage size | No | string |
|
free space in external storage size | No | string |
|
device time zone | No | string |
|
c. Set Up Deduplication for Multiple Channels
The deduplication mechanism will be required to remove duplicate event traffic between the Conversions API integration and all other existing integrations you have with app events including SDK, MMPs and App Events API.
For app events, we apply the same deduplication functionality that exists for web events. The logic leverages the field event_id
and event_name
based deduplication (Conversions API and SDK / App Events API events that carry the same event_id
). The event_id parameter is an identifier that can uniquely distinguish between similar events. Inaccurate event IDs may cause your conversion to be wrongly deduplicated, further impacting conversion reporting and campaign performance.
You can refer to the following developer documentation to implement the deduplication setup:
Here is an example of how to log a custom event. To do so, pass the name of the event as an AppEvents.Name in iOS SDK:
AppEvents.shared.logEvent(.achievedLevel, parameters: [AppEvents.ParameterName(rawValue: "event_id"): "123"])
For app install events, there is already a deduplication mechanism that makes sure only one install is attributed in the last 90-day window. We keep the first event and drop the later ones no matter the action source they are from. There is no requirement for implementing deduplication for app events related to install events.
d. Sending Events
To send new events, make a POST
request to Conversions API from this path: https://graph.facebook.com/{API_VERSION}/{DATASET_ID}/events?access_token={TOKEN}
. When you post to this edge, Meta creates new app server events. For more details, please refer to the following developer document.
Here is an overview of how the parameters fit into the overall schema in the payload:
{ "data": [ { "event_name": "Purchase", "event_time": 1684389752, "action_source": "app", "user_data": { "em": [ "30a79640dfd8293d4f4965ec11821f640ca77979ca0a6b365f06372f81a3f602" ], "ph": [ "74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b", "74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b" ], "madid": "bbbbbbbbbbbb", "anon_id": "cccccccc" }, "custom_data": { "currency": "USD", "value": "142.52" }, "app_data": { "advertiser_tracking_enabled": "True", "application_tracking_enabled": "True", "campaign_ids": "aaaaaaaaa", "extinfo": [ "a2", "com.some.app", "771", "Version 7.7.1", "10.1.1", "OnePlus6", "en_US", "GMT-1", "TMobile", "1920", "1080", "2.00", "2", "128", "8", "USA/New York" ] } } ] }
You can use the Payload Helper tool to generate payload data:
app
action source when applicableUse the Test Events tool in Events Manager for testing.