You can set up Advantage+ catalog ads on mobile with Facebook SDKs. You should incorporate deep linking and deferred deep linking into your app to provide people using your app with the best experience possible.
On the web, use Meta Pixel events such as ViewContent
for tracking events interactions. On mobile you can track the same events with App Events.
You must send the same three required events from your app as you do from your Pixel: ViewContent
, AddToCart
, and Purchase
. Advantage+ catalog ads requires these events to work correctly.
iOS Event | Android Event | Web Equivalent |
---|---|---|
|
|
|
|
|
|
|
|
|
For example, a ViewContent
event fires when someone views a product in an app:
[[FBSDKAppEvents shared] logEvent:FBSDKAppEventNameViewedContent
valueToSum:54.23
parameters:@{
FBSDKAppEventParameterNameCurrency : @"USD",
FBSDKAppEventParameterNameContentType : @"product",
FBSDKAppEventParameterNameContentID : @"123456789"
}
];
You can also provide a JSON array of values for product ID when an event occurs for multiple products. For example, you can send multiple products with the Purchase
event.
[[FBSDKAppEvents shared] logPurchase:54.23 currency : @"USD" parameters:@{
FBSDKAppEventParameterNameContentID : @"['1234','5678']",
FBSDKAppEventParameterNameContentType : @"product"
}
];
If you have multiple content IDs, you provide an escaped JSON array, for example:
"[\"1234\",\"5678\"]"
For every app event, you can send additional parameters; you should send them when someone makes a purchase:
Name | Description |
---|---|
string | Optional. |
string | Optional. |
If you use an approved Mobile Measurement Partner (MMP) to report events to Facebook, you can adjust your implementation to also send the required events. While this process varies by MMP, typically it looks like this:
The following events are required:
Name | Description |
---|---|
| When a Accounts Center account has viewed a product |
| When a item has been added to the cart |
| When a item/items have been purchased |
You must also send two additional parameters for Advantage+ catalog ads to function:
product
or product_group
The additional parameters available are:
Name | Description |
---|---|
string | Either |
string | Required. |
string | Optional. |
string | Optional. |
Note: You should also send _valueToSum
and fb_currency
parameters when someone purchases items.
The easiest way to test if your integration works is the App Ads Helper to see the events and paramters reported to Facebook in realtime.
You see these three event names if your integration is successful:
FB_MOBILE_CONTENT_VIEW
FB_MOBILE_ADD_TO_CART
FB_MOBILE_PURCHASE
Learn more about iOS and Android app events.
To verify your app events function, you can check recent events in
Facebook Events Manager.
By providing deep links in your product feed, anyone who interact with your ad on Facebook can go directly to a specific location of your app. For instance, when someone clicks an ad in Facebook on mobile, they see the product in your mobile app. See Deep Linking and Verify Deep Linking for more information.
If you use deep links, you can specify fallback behavior if someone does not have your app installed. When you provide deep links in your product feed, people without your app see the web URL for the product in the ad.
Since your likely goal is to increase catalog sales, you probably want people to see product pages, rather than your app to install. Therefore, we default to web URLs, though you can specify different behavior for more control. Set the fallback behavior to applink_treatment
when you create your Advantage+ catalog ad and use one of these options:
Name | Description |
---|---|
| Always send someone to the given web URL. This overrides any deep links in your feed. |
| If the app is installed and we have your corresponding deep links, send someone to your app. If one of these conditions is unfulfilled, send them to the website URL. |
| If the app is installed and we have corresponding deep link information, send someone to the app. If the app is not installed, send them to the app store for the app. |
Now you need to provide actual deep links for your Advantage+ catalog ads. See Product Catalog, Deep Linking for more information.
To measure conversion events from both your website and mobile apps, make sure any Advantage+ catalog ads have the correct Tracking Specs set for these events:
Event | Tracking Spec |
---|---|
|
|
|
|
|
|
Facebook can then track any events occurring from an Advantage+ catalog ad, regardless of if someone views your website or app. To set these tracking specs:
use FacebookAds\Object\Ad;
use FacebookAds\Object\Fields\AdFields;
$ad = new Ad(<AD_ID>);
$ad->{'tracking_spec'} = array(
array(
'action.type' => array('app_custom_event'),
'application' => array($app_id),
),
array(
'action.type' => array('offsite_conversion'),
'offsite_pixel' => array(<PIXEL_ID>),
),
array(
'action.type' => array('mobile_app_install'),
'application' => array($app_id),
),
);
$ad->update();
curl \
-F 'tracking_spec=[
{"action.type":["app_custom_event"],"application":["101"]},
{"action.type":["offsite_conversion"],"offsite_pixel":["<PIXEL_ID>"]},
{"action.type":["mobile_app_install"],"application":["101"]}
]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/<AD_ID>