ViewContent for tracking events interactions. On mobile you can track the same events with App Events.ViewContent, AddToCart, and Purchase. Advantage+ catalog ads requires these events to work correctly.| iOS Event | Android Event | Web Equivalent |
|---|---|---|
FBSDKAppEventNameViewedContent | AppEventsConstants::
EVENT_NAME_VIEWED_CONTENT | ViewContent |
FBSDKAppEventNameAddedToCart | AppEventsConstants::
EVENT_NAME_ADDED_TO_CART | AddToCart |
[[FBSDKAppEvents shared] logPurchase:(double) currency:(NSString *) parameters:(NSDictionary *)]; | AppEventsConstants::
EVENT_NAME_PURCHASED | Purchase |
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"
}
];
Purchase event.[[FBSDKAppEvents shared] logPurchase:54.23 currency : @"USD" parameters:@{
FBSDKAppEventParameterNameContentID : @"['1234','5678']",
FBSDKAppEventParameterNameContentType : @"product"
}
];
"[\"1234\",\"5678\"]"
| Name | Description |
|---|---|
_valueToSum
string
| Optional. Value of the product or purchase amount |
fb_currency
string
| Optional. Currency of the product or purchase amount |
| Name | Description |
|---|---|
fb_mobile_content_view | When a Accounts Center account has viewed a product |
fb_mobile_add_to_cart | When a item has been added to the cart |
fb_mobile_purchase | When a item/items have been purchased |
product or product_group| Name | Description |
|---|---|
fb_content_type
string
| Either product or product_group |
fb_content_id
string
| Required. A string containing a JSON-encoded array of the retailer’s product or product group IDs |
_valueToSum
string
| Optional. Value of the product purchased |
fb_currency
string
| Optional. Currency of the product or purchase amount |
_valueToSum and fb_currency parameters when someone purchases items.
FB_MOBILE_CONTENT_VIEWFB_MOBILE_ADD_TO_CARTFB_MOBILE_PURCHASEapplink_treatment when you create your Advantage+ catalog ad and use one of these options:| Name | Description |
|---|---|
web_only | Always send someone to the given web URL. This overrides any deep links in your feed. |
deeplink_with_web_fallback | 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. |
deeplink_with_appstore_fallback | 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. |
| Event | Tracking Spec |
|---|---|
offsite_conversion | { 'action.type': 'offsite_conversion', 'fb_pixel': FB_PIXEL_ID } |
app_custom_event | {'action.type':'app_custom_event','application':APP_ID} |
mobile_app_install | {'action.type':'mobile_app_install','application':APP_ID} |
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/v25.0/<AD_ID>