Configuring Event Postbacks to Facebook

Last Updated: Sep 27, 2016 06:29AM PDT
Note: If you are using the Facebook SDK to report your apps' events already, you won't need to set up Apsalar postbacks for these same events.  If both the Apsalar and Facebook SDK are reporting the same events, you may see double counting in your Facebook reporting.

With the steps below, you can quickly configure event notifications from your Apsalar account to Facebook. While the setup is easy, Facebook allows the addition of specific information for each of their allowed events; please be sure to read the applicable sections closely when creating your postbacks.

To configure an event postback to Facebook:

  • Navigate to the Attribution Tracking page on your Apsalar account
  • Select the Postback URLs tab.
  • Click the Create New Postback button
  • Enter the following settings for you postback to Facebook:
  • Once you've entered all of your information, click the Create Postback button.

Adding Additional Details for Facebook Events

Facebook requires that all events reported use their predefined event names and matching parameters. Apsalar has created applicable macros and formatted each event template with as much information as possible. The default URL for each Facebook Event will work as-is, but additional parameters may be added manually to pass more details. The additional parameters should always be added to the custom_events attribute.

For example, let's say you're configuring a postback to Facebook for your Apsalar custom event named 'level_up'. You select the Facebook event fb_mobile_level_achieved and the base URL in the preview section looks like this:

https://graph.facebook.com/{FB_APP_ID}/activities{POST}event=CUSTOM_APP_EVENTS&advertiser_id={IDFA}&attribution={FB_ATTR_ID}&advertiser_tracking_enabled={NODNT}&application_tracking_enabled=1&custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}}]&access_token={FB_ACCESS_TOKEN}
You decide to add the optional fb_level parameter to this base URL like so:
https://graph.facebook.com/{FB_APP_ID}/activities{POST}event=CUSTOM_APP_EVENTS&advertiser_id={IDFA}&attribution={FB_ATTR_ID}&advertiser_tracking_enabled={NODNT}&application_tracking_enabled=1&custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "fb_level":"10"}]&access_token={FB_ACCESS_TOKEN}
This will report to Facebook the applicable device has completed the fb_mobile_level_achieved event and achieved level '10'.

In the above example, the level is reported with a static value, but you could report the level using information from your custom Apsalar event. Using the example above, let's say your 'level_up'  custom event has an attribute named 'level' which contains the level value the user achieved, you could use this attribute in your postback to Facebook like so:
https://graph.facebook.com/{FB_APP_ID}/activities{POST}event=CUSTOM_APP_EVENTS&advertiser_id={IDFA}&attribution={FB_ATTR_ID}&advertiser_tracking_enabled={NODNT}&application_tracking_enabled=1&custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "fb_level":"{EVTATTR:level}"}]&access_token={FB_ACCESS_TOKEN}
For more information about sending event attributes in postbacks, please click here.

Please note, making any adjustments to the Postback URL beyond adding additional parameters to the custom_events attribute may cause the postback to fail and/or be rejected by Facebook's servers.

Facebook Event Details

Each event is explained below along with the optional parameters:

fb_mobile_level_achieved
  • Event name in Facebook Insights UI: Levels Achieved
  • Description: User has completed a level in your application.
  • Optional Parameters:
    • fb_level : Level user completed
  • Sample adjustment to custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "fb_level":"10"}]
fb_mobile_add_payment_info
  • Event name in Facebook Insights UI: Add Payment Info
  • Description: User has added payment information in your application.
  • Optional Parameters:
    • fb_success : '1' for yes, '0' no
  • Sample adjustment to custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "fb_success":'1'}]
fb_mobile_add_to_cart
  • Event name in Facebook Insights UI: Add to Cart
  • Description: User has added item to their cart.
  • Optional Parameters:
    • _valueToSum : Price of item added, use Apsalar macro {AMOUNT}
    • fb_content_type :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
    • fb_currency : ISO currency code, use Apsalar macro {CURRENCY}
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "_valueToSum":{AMOUNT}, "fb_content_type":"product", "fb_content_id":"123abc", "fb_currency":{CURRENCY}}]
fb_mobile_add_to_wishlist
  • Event name in Facebook Insights UI: Add to Wishlist
  • Description: User has added item to their wishlist.
  • Optional Parameters:
    • _valueToSum : Price of item added, use Apsalar macro {AMOUNT}
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
    • fb_currency : ISO currency code, use Apsalar macro {CURRENCY}
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "_valueToSum":{AMOUNT}, "fb_content_type":"product", "fb_content_id":"123abc","fb_currency":{CURRENCY}}]
fb_mobile_complete_registration
  • Event name in Facebook Insights UI: Complete Registration
  • Description: User has completed registration.
  • Optional Parameters:
    • fb_registration_method : Method used to register, such as Facebook, Twitter, email, etc.
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "fb_registration_method":"Email"}]
fb_mobile_tutorial_completion
  • Event name in Facebook Insights UI: Tutorials Completed
  • Description: User has completed tutorial.
  • Optional Parameters:
    • fb_success : '1' for yes, '0' no
    • fb_content_id : Content identifier, helpful if you have multiple tutorials
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, "fb_success":'1', "fb_content_id":"driving_tutorial"}]
fb_mobile_initiated_checkout
  • Event name in Facebook Insights UI: Initiated Checkout
  • Description: User has started checkout process.
  • Optional Parameters:
    • _valueToSum : Total price of items, use Apsalar macro {AMOUNT}
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
    • fb_num_items : Number of items
    • fb_payment_info_available :  '1' for yes, '0' no
    • fb_currency : ISO currency code, use Apsalar macro {CURRENCY}
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC},_valueToSum":{AMOUNT},"fb_content_type":"product","fb_content_id":"234bcd", "fb_num_items":'4',"fb_payment_info_available":'0',"fb_currency":{CURRENCY}}]
fb_mobile_purchase
  • Event name in Facebook Insights UI: Purchases
  • Description: User has completed a purchase.
  • Optional Parameters:
    • _valueToSum : Total price of item(s), use Apsalar macro {AMOUNT}
    • fb_num_items : Number of items
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
    • fb_currency : ISO currency code, use Apsalar macro {CURRENCY}
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC},_valueToSum":{AMOUNT},"fb_content_type":"product","fb_content_id":"234bcd","fb_num_items":'2',"fb_currency":{CURRENCY}}]
fb_mobile_rate
  • Event name in Facebook Insights UI: Rating
  • Description: User has rated an item.
  • Optional Parameters:
    • _valueToSum : Rating given by user
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
    • fb_max_rating_value : Maximum rating possible
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC},_valueToSum":'3',"fb_content_type":"product","fb_content_id":"345cde","fb_max_rating_value":'5'}]
fb_mobile_search
  • Event name in Facebook Insights UI: Search
  • Description: User has performed a search in your application.
  • Optional Parameters:
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_search_string : String user entered for search
    • fb_success : '1' for yes, '0' no
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC},"fb_content_type":"product","fb_search_string":"dress","fb_success":'1'}]
fb_mobile_spent_credits
  • Event name in Facebook Insights UI: Spent Credits
  • Description: User has spent in app credits.
  • Optional Parameters:
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC},"fb_content_type":"product","fb_content_ID":"points"}]
fb_mobile_achievement_unlocked
  • Event name in Facebook Insights UI: Achievements Unlocked
  • Description: User has unlocked an achievement
  • Optional Parameters:
    • fb_description : Description of achievement
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC},"fb_description":"Completed First Five Levels"}]
fb_mobile_content_view
  • Event name in Facebook Insights UI: Content View
  • Description: User has viewed content/item
  • Optional Parameters:
    • _valueToSum : Price of item added, use Apsalar macro {AMOUNT}
    • fb_content_type : :Either 'product' or 'product_group'
    • fb_content_id : International Article Number (EAN) when applicable, or other product or content identifier
    • fb_currency : ISO currency code, use Apsalar macro {CURRENCY}
  • Sample adjustment custom_events:
    custom_events=[{"_eventName":"{{eventname}}", "_logTime":{UTC}, _valueToSum":{AMOUNT}, "fb_content_type":"product", "fb_content_id":"123abc","fb_currency":{CURRENCY}}]
support@apsalar.com
http://assets0.desk.com/
apsalarinc
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
Invalid characters found
/customer/en/portal/articles/autocomplete