name - A required string that describes the event. The name appears in the Event log when the app event is sent to Analytics.
valueToSum - An optional value that Analytics adds to other Value To Sum values from app events with the same name.
parameters - Optional values included with your app event.
100 Invalid parameter error when logging. However it is possible to deactivate obsolete events. Read more about event limits in the FAQ.POST request from your server to the /{app-id}/activities endpoint with the application_tracking_enabled and advertiser_tracking_enabled parameters:curl -i -X POST "https://graph.facebook.com/{app-id}/activities ?event=MOBILE_APP_INSTALL &application_tracking_enabled=0 &advertiser_tracking_enabled=0 &advertiser_id={advertiser-tracking-id} &{app-access-token}"
{
"success": true
}
advertiser_tracking_enabled field specifies whether a person has enabled advertising tracking on their iOS 14.5+ device. Set to 0 for disabled or 1 for enabled. You should fetch this data and return it to Facebook to determine if ad tracking can be used for optimization or conversions.
Meta will use the event data (from partners about user activities off Meta) pursuant to its Data Policy, including for ad reporting, fraud detection and to build and improve our products (including our ads delivery products), but will restrict use of data about that individual to personalize that user’s ads. For devices running earlier versions than iOS 6, this parameter should default to 1.Settings.shared.isAdvertiserTrackingEnabled property.print("isAdvertiserTrackingEnabled: \(Settings.shared.isAdvertiserTrackingEnabled)")
POST request to the /{app-id}/activities endpoint with the event set to CUSTOM_APP_EVENTS and set advertiser_tracking_enabled for each individual event. The advertiser_id or attribution parameter is required.curl -i -X POST "https://graph.facebook.com/{app-id}/activities
?event=CUSTOM_APP_EVENTS"
&advertiser_id={advertiser-tracking-id}
&advertiser_tracking_enabled=1
&application_tracking_enabled=1
&custom_events=[
{"_eventName":"fb_mobile_purchase",
"event_id":"123456",
"fb_content":"[
{"id": "1234", "quantity": 2,},
{"id": "5678", "quantity": 1,}
]",
"fb_content_type":"product",
"_valueToSum":21.97,
"fb_currency":"GBP",
}
]
&{app-access-token}"
{
"success": true
}
attribution endpoint returns installs and conversions based on clicks that happened on an ad within 30 days. Ads Manager uses a 1-day view through a 28-day click-through attribution model and insights are surfaced based on impression or click time, not install or conversion time. This is important when comparing your reporting to Facebook Ads Manager reports. In addition to the standard ad click app event claims, you should also keep the following scenarios in mind:consider_views=TRUE returns attribution data for installs that occurred within 1 day of an ad impression, provided the Accounts Center account did not click on an ad within 30 days.The response returned will be is_view_through=TRUE and view_time will replace click_time. All other attributions are the same as with ad click attribution data.POST request to the /{app-id}/activities endpoint with the ud parameter set to a parameter that will help to track your customer such as customer email or phone number. All customer data must be hashed or Facebook will ignore it. Be sure to set advertiser_tracking_enabled for each individual event.curl -i -X POST "https://graph.facebook.com/{app-id}/activities
?event=CUSTOM_APP_EVENTS
&advertiser_id={advertiser-tracking-id}
&advertiser_tracking_enabled=1
&application_tracking_enabled=1
&custom_events=[
{"_eventName":"fb_mobile_purchase",
"event_id":"123456",
"fb_content":"[
{"id": "1234", "quantity": 2,},
{"id": "5678", "quantity": 1,}
]",
"fb_content_type":"product",
"_valueToSum":21.97,
"fb_currency":"GBP",
}
]
&ud[em]={sha256-hashed-email}
&{app-access-token}"
{
"success": true
}
event_id and event_name based deduplication. 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./{app-id}/activities?extinfo. Values are separated by commas and must be in the order indexed in the /application/activites reference guide. When using extinfo all values are required.
version must be a2 for Androidversion must be i2 for iOSadvertiser_id. However, for Android devices and iOS devices earlier than iOS 6, you can also use the attribution parameter set to the mobile cookie of the device.
ContentProvider:
public static final Uri ATTRIBUTION_ID_CONTENT_URI = Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider");
public static final String ATTRIBUTION_ID_COLUMN_NAME = "aid";
public static String getAttributionId(ContentResolver contentResolver) {
String [] projection = {ATTRIBUTION_ID_COLUMN_NAME};
Cursor c = contentResolver.query(ATTRIBUTION_ID_CONTENT_URI, projection, null, null, null);
if (c == null || !c.moveToFirst()) {
return null;
}
String attributionId = c.getString(c.getColumnIndex(ATTRIBUTION_ID_COLUMN_NAME));
c.close();
return attributionId;
}
CFUUIDCreateString and is 128-bit UUID string representation.ASIdentifierManager *manager = [ASIdentifierManager sharedManager];
NSString *advertiserID = [[manager advertisingIdentifier] UUIDString];
if (advertiserID) {
// do stuff
}
POST requests are done from a central place such as a server or proxy, basically, a server-to-server call, then X-Forwarded-For HTTP header is required to ensure accurate location and device information. Send the device’s IP address, IPv4 or IPv6 format, via the X-Forwarded-For HTTP header parameter in each of the app event requests you send. By doing so, it allows us to pair the advertiser_id to the correct IP address, which we can then use in our platform.curl ...
-H "X-Forwarded-For: fd45:f238:3b40:23b1:ffff:ffff:ffff:abcd" \
https://graph.facebook.com/<APP_ID>/activities/
curl ...
-H "X-Forwarded-For: 192.168.0.99" \
https://graph.facebook.com/<APP_ID>/activities
/application/activites reference guide for more information on app extended information.
| User Data | Parameter | Format | Example |
|---|---|---|---|
Email | em | jsmith@example.com | |
First Name | fn | Lowercase letters | john |
Last Name | ln | Lowercase letters | smith |
Phone | ph | Digits only including country code and area code | 16505554444 |
External ID | external_id | Any unique ID from the advertiser, such as loyalty membership ID, user ID, and external cookie ID. | a@example.com |
Gender | ge | Single lowercase letter, f or m, if unknown, leave blank | f |
Birthdate | db | Digits only with birth year, month, then day | 19910526 for May 26, 1991. |
City | ct | Lowercase with any spaces removed | menlopark |
State or Province | st | Lowercase two-letter state or province code | ca |
Zip or Postal Code | zp | Digits only | 94025 |
Country | cn | Lowercase two-letter country code | us |
| Event Name | Event Parameters | _valueToSum |
|---|---|---|
AdClick | fb_ad_type | |
AdImpression | fb_ad_type | With App Ads, revenue of ads from a third-party platform appears on-screen within your app. |
Contact | ||
CustomizeProduct | ||
Donate | ||
fb_mobile_achievement_unlocked | fb_description | |
fb_mobile_activate_app * | ||
fb_mobile_add_payment_info | fb_success | |
fb_mobile_add_to_cart | fb_content_type, fb_content_id and fb_currency | Price of item added |
fb_mobile_add_to_wishlist | fb_content_type, fb_content_id and fb_currency | Price of item added |
fb_mobile_complete_registration | fb_registration_method | |
fb_mobile_content_view | fb_content_type, fb_content_id and fb_currency | Price of item viewed (if applicable) |
fb_mobile_initiated_checkout | fb_content_type, fb_content_id, fb_num_items, fb_payment_info_available and fb_currency | Total price of items in cart |
fb_mobile_level_achieved | fb_level | |
fb_mobile_purchase | fb_num_items, fb_content_type, fb_content_id and fb_currency | Purchase price |
fb_mobile_rate | fb_content_type, fb_content_id and fb_max_rating_value | Rating given |
fb_mobile_search | fb_content_type, fb_search_string and fb_success | |
fb_mobile_spent_credits | fb_content_type and fb_content_id | Total value of credits spent |
fb_mobile_tutorial_completion | fb_success and fb_content_id | |
FindLocation | ||
Schedule | ||
StartTrial | fb_order_id and fb_currency | Price of subscription |
SubmitApplication | ||
Subscribe | fb_order_id and fb_currency | Price of subscription |
fb_mobile_activate_app event in addition to install reporting to exclude users from seeing ads for this app. Do not use this event if you have automatic event logging enabled.| Event Parameter Name | Value | Description |
|---|---|---|
_logTime | int | Recommend parameter to specify the time of event, specified in unixtime |
_valueToSum | float | Numeric value of individual event to be summed in reporting, see above for recommended events to attach to |
fb_content_id | string | International Article Number (EAN) when applicable, or other product or content identifier(s). For multiple product ids: e.g. “["1234","5678"]” |
fb_content | string | A list of JSON object that contains the International Article Number (EAN) when applicable, or other product or content identifier(s) as well as quantities and prices of the products. Required: id, quantity. e.g. “[{"id": "1234", "quantity": 2,}, {"id": "5678", "quantity": 1,}]”. |
fb_content_type | string | The product or product_group |
fb_currency | string | ISO 4217 code, e.g., “EUR”, “USD”, “JPY”. Required when passing _valueToSum as a price or a purchase amount. |
fb_description | string | A string description |
fb_level | string | Level of a game |
fb_max_rating_value | int | Upper bounds of a rating scale, for example 5 on a 5 star scale |
fb_num_items | int | Number of items |
fb_payment_info_available | boolean | 1 for yes, 0 for no |
fb_registration_method | string | Facebook, Email, Twitter, etc. |
fb_search_string | string | The text string that was searched for |
fb_success | boolean | 1 for yes,0 for no |