Introduction
Rich in-app events provide advertisers with the ability to record post-install events and attribute them to the originating media source.
When users perform registrations, complete tutorials, add items to the shopping cart, or make purchases, then in-app events data can record the events with the details.
Rich in-app events are the ideal tool to determine the value of app users and the quality of traffic originating from different media sources. The implementation of rich in-app events is optional but we strongly recommended that you do so.
The trackEvent API
An in-app event is comprised of an event name and event parameters.
You can use any event name string of your choice. However, AppsFlyer SDK contains recommended event names via enumerations and definitions (see the Event Types tab for the list of recommended events and parameter names).
Event names are case sensitive, meaning that af_purchase and af_PURCHASE are two different events.
Syntax:
public static void trackEvent(Context context, String eventName, Map eventValues)
Context- Use
getApplicationContext()
- eventName
- Any string to define the event name.
- eventValues
- A map of event parameters that comprise a rich event.
- (void) trackEvent:(NSString *)eventName withValues:(NSDictionary*)values
eventName- Any string to define the event name.
- values
- A dictionary of event parameters that comprise a rich event.
In-app events for hybrid apps
In cases where your app is a hybrid app, see our guide on in-app events for hybrid apps.
Warning
Each network has its own limitations regarding the permitted characters in event names. To avoid problems, use only lower-case alpha-numeric characters (a-z and 0-9) for your in-app event names.
In-app event types
The following section describes the recommended structure of each event type together with the parameter mappings for Facebook, Twitter, Criteo, Google Ads, and Snapchat.
Note
The following parameters, as part of the rich in-app events value, are only available in the raw data reports. Ensure that your account has access to raw data reports to fully enjoy the benefits of rich in-app events.
Recommended in-app events structures
The following in-app events are defined as part of the AFInAppEventType interface and are recommended:
Level achieved
Event Name: af_level_achieved
Description: Used to record game level events
Event Parameter (Android): AFInAppEventType.LEVEL_ACHIEVED
Event Parameter (iOS): AFEventLevelAchieved
Facebook Mapped Event: fb_mobile_level_achieved
Twitter Mapped Event: LEVEL_ACHIEVED
Criteo Mapped Event: userLevel
Google Ads: level_up
Snapchat: LEVEL_COMPLETE
Recommended attributes: af_level, af_score
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_level | fb_level | level | ui_level | level_up | level |
af_score | - | - | - | score | - |
Add payment info
Event Name: af_add_payment_info
Description: Used to record payment info configuration status
Event Parameter (Android): AFInAppEventType.ADD_PAYMENT_INFO
Event Parameter (iOS): AFEventAddPaymentInfo
Facebook Mapped Event: fb_mobile_add_payment_info
Twitter Mapped Event: ADDED_PAYMENT_INFO
Criteo Mapped Event: None
Google Ads: add_payment_info
Snapchat: ADD_BILLING
Recommended attributes: af_success
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_success | fb_success | user_payment_info | - | add_payment_info | success |
Add to cart
Event Name: af_add_to_cart
Description: Used to record add to cart events of specific items
Event Parameter (Android): AFInAppEventType.ADD_TO_CART
Event Parameter (iOS): AFEventAddToCart
Facebook Mapped Event: fb_mobile_add_to_cart
Twitter Mapped Event: ADD_TO_CART
Criteo Mapped Event: viewBasket
Google Ads: add_to_cart
Snapchat: ADD_CART
Recommended attributes: af_price, af_content_type, af_content_id, af_content, af_currency, af_quantity
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snap | ||
---|---|---|---|---|---|
af_price | _valueToSum | price_micro* | price** | price | price |
af_content_type | fb_content_type | content_type | - | item_category | item_category |
af_content_id | fb_content_id | content_id | id | item_id | item_ids |
af_content | fb_content | - | - | - | - |
af_currency | fb_currency | price_currency | currency | currency_code | currency |
af_quantity | - | number_items | quantity | quantity | number_items |
*To report an event containing multiple items, click here.
Add to Wishlist
Event Name: af_add_to_wishlist
Description: Used to record add to wishlist events of specific items.
Event Parameter (Android): AFInAppEventType.ADD_TO_WISH_LIST
Event Parameter (iOS): AFEventAddToWishlist
Facebook Mapped Event: fb_mobile_add_to_wishlist
Twitter Mapped Event: ADD_TO_WISHLIST
Criteo Mapped Event: None
Google Ads: add_to_wishlist
Recommended attributes: af_price, af_content_type, af_content_id, af_content, af_currency, af_quantity
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_price | _valueToSum | price_micro* | - | Price |
af_content_type | fb_content_type | content_type | - | item category |
af_content_id | fb_content_id | content_id | - | item_id |
af_content | fb_content | - | - | - |
af_currency | fb_currency | price_currency | - | currency_code |
af_quantity | - | number_items | - | quantity |
*To report an event containing multiple items, click here.
Complete Registration
Event Name:af_complete_registration
Description: Used to record user registration methods
Event Parameter (Android): AFInAppEventType.COMPLETE_REGISTRATION
Event Parameter (iOS): AFEventCompleteRegistration
Facebook Mapped Event: fb_mobile_complete_registration
Twitter Mapped Event: SIGN_UP
Criteo Mapped Event: None
Google Ads: sign_up
Snapchat: SIGN_UP
Recommended attributes: af_registration_method
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_registration_ method |
fb_registration_ method |
registration_method | - | registration_method | sign_up_method |
Tutorial completion
Event Name: af_tutorial_completion
Description: Used to record tutorial completions
Event Parameter (Android): AFInAppEventType.TUTORIAL_COMPLETION
Event Parameter (iOS): AFEventTutorial_completion
Facebook Mapped Event: fb_mobile_tutorial_completion
Twitter Mapped Event: TUTORIAL_COMPLETE
Criteo Mapped Event: None
Google Ads: tutorial_complete
Recommended attributes: af_success, af_content_id, af_content
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_success | fb_success | - | - | success |
af_content_id | fb_content_id | content_id | - | item_id |
af_content | fb_content | - | - | - |
*To report an event containing multiple items, click here.
Initiated checkout
Event Name: af_initiated_checkout
Description: Used to record checkout events
Event Parameter (Android): AFInAppEventType.INITIATED_CHECKOUT
Event Parameter (iOS): AFEventInitiatedCheckout
Facebook Mapped Event: fb_mobile_initiated_checkout
Twitter Mapped Event: CHECKOUT_INITIATED
Criteo Mapped Event: viewBasket
Google Ads: begin_checkout
Snapchat: START_CHECKOUT
Recommended Attributes: af_price, af_content_type, af_content_id, af_content, af_quantity, af_payment_info_available, af_currency
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_price | _valueToSum | price_micro* | price | price | price |
af_content_type | fb_content_type | content_type | - | item_category | item_category |
af_content_id | fb_content_id | content_id | id | item_id | item_ids |
af_content | fb_content | - | - | - | |
af_currency | fb_currency | price_currency | currency | currency_code | currency |
af_quantity | fb_num_items | number_items | quantity | quantity | number_items |
af_payment_info_ |
fb_payment_info_ available |
user_payment_ info |
- | payment_info_ available |
payment_info_available |
af_content_list | fb_content_id | - | - | item_id | - |
af_date_a- | fb_checkin_date | - | din | start_date | - |
af_date_b | fb_checkout_date | - | dout | end_date | - |
af_departing_ departure_date |
fb_departing_ departure_date |
- | - | - | - |
af_returning_ departure_date |
fb_returning_ departure_date |
- | - | - | - |
af_destination_a | fb_origin_airport | - | - | origin | - |
af_destination_b | fb_destination_airport | - | - | destination | - |
af_destination_list | fb_destination_ids | - | - | - | - |
af_city | fb_city | - | - | - | - |
af_region | fb_region | - | - | - | - |
af_country | fb_country | - | - | - | - |
af_departing_ arrival_date |
fb_departing_arrival_ date |
- | - | - | - |
af_returning_- arrival_date |
fb_returning_arrival_ date |
- | - | - | - |
af_suggested_ destinations |
fb_suggested_ destinations |
- | - | - | - |
af_travel_start | fb_travel_start | - | - | - | - |
af_travel_end | fb_travel_end | - | - | - | - |
af_num_adults | fb_num_adults | - | - | - | - |
af_num_childr-en | fb_num_children | - | - | - | - |
af_num_infant-s | fb_num_infants | - | - | - | - |
af_class | fb_travel_class | - | - | travel_class | - |
af_suggested_hotels | fb_suggested_hotels | - | - | - | - |
af_user_score | fb_user_score | - | - | - | - |
af_hotel_score | fb_hotel_score | - | - | - | - |
af_price | fb_purchase_value | - | - | price | - |
af_purchase_currency | fb_purchase_currency | - | - | - | - |
af_preferred_star_ ratings |
fb_preferred_star_ ratings |
- | - | - | - |
af_preferred_price_ range |
fb_preferred_price_ range |
- | - | - | - |
af_preferred_ neighborhoods |
fb_preferred_ neighborhoods |
- | - | - | - |
af_preferred_-num_ stops |
fb_preferred_num_ stops |
- | - | - | - |
*To report an event containing multiple items, click here.
Purchase
Event Name: af_purchase
Description: Used to record purchase events (and associate revenue to them)
Event Parameter (Android): AFInAppEventType.PURCHASE
Event Parameter (iOS): AFEventPurchase
Facebook Mapped Event: fb_mobile_purchase
Twitter Mapped Event: PURCHASE
Criteo Mapped Event: transactionConfirmation
Google Ads: in_app_purchase
Snapchat: PURCHASE
Recommended attributes: af_revenue, af_content_type, af_content_id, af_content, af_price, af_quantity, af_currency, af_order_id
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | Partnerize | ||
---|---|---|---|---|---|---|
af_revenue* |
_valueToSum |
price_micro** |
ui_revenue |
value |
price |
- |
af_content_type |
fb_content_type |
content_type |
- |
item_category |
item_category |
Category |
af_content_id |
fb_content_id |
content_id |
id |
item_id |
item_ids |
- |
af_content |
fb_content |
- |
- |
- |
- |
Custom conversion meta |
af_currency |
fb_currency |
price_currency |
currency |
currency_code |
currency |
Currency |
af_quantity |
fb_num_items |
number_items |
quantity |
quantity |
number_items |
Quantity |
af_validated |
- |
- |
- |
validated |
success |
Voucher |
af_receipt_id |
- |
- |
transaction_id |
transaction_id |
- |
Conversion Reference |
af_order_id |
fb_order_id |
- |
- |
order_id |
transaction_id |
Clickref |
af_content_list |
fb_content_id |
- |
- |
item_id |
- |
Custom item meta |
af_date_a |
fb_checkin_date |
- | din | start_date | - | - |
af_date_b |
fb_checkout_date |
- | dout | end_date | - | - |
af_departing_ departure_date |
fb_departing_ |
- | - | - | - | - |
af_returning_ departure_date |
fb_returning_ |
- | - | - | - | - |
af_destination_a |
fb_origin_airport |
- | - | origin | - | - |
af_destination_b |
fb_destination_ |
- | - | destination | - | - |
af_destination_list |
fb_destination_ids |
- | - | - | - | - |
af_city |
fb_city |
- | - | - | - | - |
af_region |
fb_region |
-- | -- | -- | -- | - |
af_country |
fb_country |
- | - | - | - | - |
af_departing_arrival_ date |
fb_departing_arrival_ |
- | - | - | - | - |
af_returning_arrival_ date |
fb_returning_arrival_ |
- | - | - | - | - |
af_suggested_ destinations |
fb_suggested_ |
- | - | - | - | - |
af_travel_start |
fb_travel_start |
- | - | - | - | - |
af_travel_end |
fb_travel_end |
- | - | - | - | - |
af_num_adults |
fb_num_adults |
- | - | - | - | - |
af_num_children |
fb_num_children |
- | - | - | - | - |
af_num_infants |
fb_num_infants |
- | - | - | - | - |
af_class |
fb_travel_class |
- | - | travel_class | - | - |
af_suggested_ hotels |
fb_suggested_ |
- | - | - | - | - |
af_user_score |
fb_user_score |
- | - | - | - | - |
af_hotel_score |
fb_hotel_score |
- | - | - | - | - |
af_price |
fb_purchase_value |
- | price** | price | - | Value |
af_purchase_ currency |
fb_purchase_ |
- | - | - | - | - |
af_preferred_star_ ratings |
fb_preferred_star_ |
- | - | - | - | - |
af_preferred_price_ range |
fb_preferred_price_ |
- | - | - | - | - |
af_preferred_ neighborhoods |
fb_preferred_ |
- | - | - | - | - |
af_preferred_num_ stops |
fb_preferred_num_ |
- | - | - | - | - |
* af_revenue is counted as revenue in AppsFlyer’s platform.
**af_price - You can use af_price as a monetary parameter that is not counted as revenue (such as in an “Add to Cart” event). This parameter refers to the individual item price. The total amount of all purchases appears under the af_revenue parameter.
For a list of currency symbols supported by AppsFlyer, click here.
*To report an event containing multiple items, click here.
Subscription
Event Name: af_subscribe
Description: Used to record paid subscription purchases
Event Parameter (Android): AFInAppEventType.SUBSCRIBE
Event Parameter (iOS): AFEventSubscribe
Facebook Mapped Event: Subscribe
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Recommended attributes: af_revenue af, af_currency
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_revenue |
_valueToSum |
- |
- |
- |
af_currency |
fb_currency |
- |
- |
- |
Start Trial
Event Name: af_start_trial
Description: Used to record the start of a free trial of a product
Event Parameter (Android): AFInAppEventType.START_TRIAL
Event Parameter (iOS): AFEventStartTrial
Facebook Mapped Event: StartTrial
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Recommended attributes: af_price, af_currency
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_price |
_valueToSum |
- |
- |
- |
af_currency |
fb_currency |
- |
- |
- |
Rate
Event Name: af_rate
Description: Used to record app/item rating events.
Event Parameter (Android): AFInAppEventType.RATE
Event Parameter (iOS): AFEventRate
Facebook Mapped Event: fb_mobile_rate
Twitter Mapped Event: RATED
Criteo Mapped Event: None
Google Ads: submit_rating
Recommended attributes: af_rating_value, af_content_type, af_content_id, af_content, af_max_rating_value
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_rating_value |
_valueToSum |
price_micro |
value |
|
af_content_type |
fb_content_type |
content_type |
- |
content_type |
af_content_id |
fb_content_id |
content_id |
- |
content_id |
af_content |
fb_content |
- |
- |
- |
af_max_rating_value |
fb_max_rating_value |
max_rated_value |
- |
max_rating |
*To report an event containing multiple items, click here.
Search
Event Name: af_search
Description: Used to record search events
Event Parameter (Android): AFInAppEventType.SEARCH
Event Parameter (iOS): AFEventSearch
Facebook Mapped Event: fb_mobile_search
Twitter Mapped Event: SEARCH
Criteo Mapped Event: viewSearch
Google Ads: view_search_results
Google Ads: SEARCH
Recommended attributes: af_content_type, af_search_string, af_success
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_content_type |
fb_content_type |
content_type |
- |
item_category |
item_category |
af_search_string |
fb_search_string |
search_string |
- |
search_term |
search_string |
af_date_a |
fb_checkin_date |
- |
din |
start_date |
- |
af_date_b |
fb_checkout_date |
- |
dout |
end_date |
- |
af_destination_a |
fb_origin_airport |
- |
- |
origin |
- |
af_destination_b |
fb_destination_airport |
- |
- |
destination |
- |
af_success |
fb_success |
- |
- |
success |
success |
af_content_list |
fb_content_id |
- |
- |
item_id |
- |
af_departing_ departure_date |
fb_departing_ |
- | - | - | - |
af_returning_ departure_date |
fb_returning_ |
- | - | - | - |
af_destination_list |
fb_destination_ids |
- | - | - | - |
af_city |
fb_city |
- | - | - | - |
af_region |
fb_region |
- | - | - | - |
af_country |
fb_country |
- | - | - | - |
af_departing_arrival_ date |
fb_departing_arrival_ |
- | - | - | - |
af_returning_arrival_ date |
fb_returning_arrival_ |
- | - | - | - |
af_suggested_ destinations |
fb_suggested_ |
- | - | - | - |
af_travel_start |
fb_travel_start |
- | - | - | - |
af_travel_end- |
fb_travel_end |
- | - | - | - |
af_num_adults |
fb_num_adults |
- | - | - | - |
af_num_children |
fb_num_children |
- | - | - | - |
af_num_infants |
fb_num_infants |
- | - | - | - |
af_class |
fb_travel_class |
- | - | travel_class | - |
af_suggested_hotels |
fb_suggested_hotels |
- | - | - | - |
af_user_score |
fb_user_score |
- | - | - | - |
af_hotel_score |
fb_hotel_score |
- | - | - | - |
af_price |
fb_purchase_value |
- | - | price | - |
af_purchase_currency |
fb_purchase_currency |
- | - | - | - |
af_preferred_star_ ratings |
fb_preferred_star_ |
- | - | - | - |
af_preferred_price_ range |
fb_preferred_price_ |
- | - | - | - |
af_preferred_ neighborhoods |
fb_preferred_ |
- | - | - | - |
af_preferred_num_ stops |
fb_preferred_num_ |
- | - | - | - |
Spent credits
Event Name: af_spent_credits
Description: Used to record credit spend events
Event Parameter (Android): AFInAppEventType.SPENT_CREDIT
Event Parameter (iOS): AFEventSpentCredits
Facebook Mapped Event: fb_mobile_spent_credits
Twitter Mapped Event: SPENT_CREDITS
Criteo Mapped Event: transactionConfirmation
Google Ads: spend_virtual_currency
Recommended attributes: af_price, af_content_type, af_content_id, af_content
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_price |
_valueToSum |
price_micro* |
price** |
price |
af_content_type |
fb_content_type |
content_type |
- |
item_category |
af_content_id |
fb_content_id |
content_id |
item_id |
item_id |
af_content |
fb_content |
- |
- |
|
*To report an event containing multiple items, click here.
Achievement unlocked
Event Name: af_achievement_unlocked
Description: Used to record achievement unlocking events
Event Parameter (Android): AFInAppEventType.ACHIEVEMENT_UNLOCKED
Event Parameter (iOS): AFEventAchievementUnlocked
Facebook Mapped Event: fb_mobile_achievement_unlocked
Twitter Mapped Event: ACHIEVEMENT_UNLOCKED
Criteo Mapped Event: achievement
Google Ads: unlock_achievement
Recommended attributes: af_description
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_description |
fb_description |
description |
ui_achievement |
description |
Content View
Event: af_content_view
Description: Used to record content view events
Event Parameter (Android): AFInAppEventType.CONTENT_VIEW
Event Parameter (iOS): AFEventContentView
Facebook Mapped Event: fb_mobile_content_view
Twitter Mapped Event: CONTENT_VIEW
Criteo Mapped Event: viewProduct
Google Ads: view_item
Snapchat: VIEW_CONTENT
Recommended attributes: af_price, af_content_type, af_content_id, af_content, af_currency
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | Snap | ||
---|---|---|---|---|---|
af_price |
_valueToSum |
price_micro* |
price |
price |
price |
af_content_type |
fb_content_type |
content_type |
- |
item_category |
item_category |
af_content_id |
fb_content_id |
content_id |
id |
item_id |
item_ids |
af_content |
fb_content |
- |
- |
- |
- |
af_currency |
fb_currency |
price_currency |
currency |
currency_code |
currency |
af_content_list |
fb_content_id |
- |
- |
item_id | - |
af_date_a |
fb_checkin_date |
- | din | start_date | - |
af_date_b |
fb_checkout_date |
- | dout | end_date | - |
af_departing_ departure_date |
fb_departing_ |
- | - | - | |
af_returning_ departure_date |
fb_returning_ |
- | - | - | - |
af_destination_a |
fb_origin_airport |
- | - | origin | - |
af_destination_b |
fb_destination_ |
- | - | destination | - |
af_destination_list |
fb_destination_ids |
- | - | - | - |
af_city |
fb_city |
- | - | - | - |
af_region |
fb_region |
- | - | - | - |
af_country |
fb_country |
- | - | - | - |
af_departing_arrival_ date |
fb_departing_arrival_ |
- | - | - | - |
af_returning_arrival_ date |
fb_returning_arrival_ |
- | - | - | - |
af_suggested_ destinations |
fb_suggested_ |
- | - | - | - |
af_travel_start |
fb_travel_start |
- | - | - | - |
af_travel_end |
fb_travel_end |
- | - | - | - |
af_num_adults |
fb_num_adults |
- | - | - | - |
af_num_children |
fb_num_children |
- | - | - | - |
af_num_infants |
fb_num_infants |
- | - | - | - |
af_class |
fb_travel_class |
- | - | travel_class | - |
af_suggested_hotels |
fb_suggested_hotels |
- | - | - | - |
af_user_score |
fb_user_score |
- | - | - | - |
af_hotel_score |
fb_hotel_score |
- | - | - | - |
af_price |
fb_purchase_value |
- | - | price | - |
af_purchase_currency |
fb_purchase_currency |
- | - | - | - |
af_preferred_star_ ratings |
fb_preferred_star_ |
- | - | - | - |
af_preferred_price_ range |
fb_preferred_price_ |
- | - | - | - |
af_preferred_ neighborhoods |
fb_preferred_ |
- | - | - | - |
af_preferred_num_ stops |
fb_preferred_num_ |
- | - | - | - |
List view
Event Name: af_list_view
Description: Used to record listings view events
Event Parameter (Android): use the string "af_list_view" instead:
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "af_list_view", eventValue);
Event Parameter (iOS): AFEventListView
Facebook Mapped Event:
Twitter Mapped Event:
Criteo Mapped Event: viewListing
Google Ads: view_item_list
Recommended attributes: af_content_type, af_content_list
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_content_type |
- |
- |
- |
item_Category |
af_content_list |
- |
- |
- |
item_id |
Ad click
Event Name: af_ad_click
Description: Used to record ad clicks on ads displayed in the app
Event Parameter (Android): AFInAppEventType.AD_CLICK
Event Parameter (iOS): AFEventAdClick
Facebook Mapped Event: AdClick
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Recommended attributes: af_adrev_ad_type
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_adrev_ad_type |
ad_type |
- |
- |
- |
af_currency |
fb_currency |
- |
- |
- |
Ad view
Event Name: af_ad_view
Description: Used to record ad views of ads displayed in the app
Event Parameter (Android): AFInAppEventType.AD_VIEW
Event Parameter (iOS): AFEventAdView
Facebook Mapped Event: AdImpression
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Recommended attributes: af_adrev_ad_type
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_adrev_ad_type |
ad_type |
- |
- |
- |
af_currency |
fb_currency |
- |
- |
- |
Travel booking
Event Name: af_travel_booking
Description: Used to record travel booking events (and associate revenue to them)
Event Parameter (Android): AFInAppEventType.TRAVEL_BOOKING
Event Parameter (iOS): AFEventTravelBooking
Facebook Mapped Event: fb_mobile_purchase
Twitter Mapped Event: PURCHASE
Criteo Mapped Event: transactionConfirmation
Google Ads: ecommerce_purchase
Recommended attributes: af_revenue, af_destination_a, af_destination_b, af_class, af_description, af_customer_user_id, af_content_type, af_content_id, af_date_a, af_date_b
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_revenue* |
_valueToSum |
price_micro** |
price*** |
value |
af_customer_user_id |
- |
- |
cid |
customer_user_ |
af_content_type |
fb_content_type |
content_type |
- |
item_category |
af_content_id |
fb_content_id |
content_id |
- |
item_id |
af_class |
- |
- |
- |
travel_class |
af_date_a |
- |
- |
din |
start_date |
af_date_b |
- |
- |
dout |
end_date |
af_destination_a |
- |
- |
- |
origin |
af_destination_b |
- |
- |
- |
destination |
af_success |
fb_success |
- |
- |
success |
af_content_list |
fb_content_ids |
- |
- |
item_id |
af_date_a |
fb_checkin_date |
- | - | start_date |
af_date_b |
fb_checkout_date |
- | - | end_date |
af_departing_ departure_date |
fb_departing_ |
- | - | |
af_returning_ departure_date |
fb_returning_ |
- | - | |
af_destination_a |
fb_origin_airport |
- | - | origin |
af_destination_b |
fb_destination_airport |
- | - | destination |
af_destination_list |
fb_destination_ids |
- | - | |
af_city |
fb_city |
- | - | - |
af_region |
fb_region |
- | - | - |
af_country |
fb_country |
- | - | - |
af_departing_arrival_ date |
fb_departing_arrival_ |
- | - | - |
af_returning_arrival_ date |
fb_returning_arrival_ |
- | - | - |
af_suggested_ destinations |
fb_suggested_ |
- | - | - |
af_travel_start |
fb_travel_start |
- | - | - |
af_travel_end |
fb_travel_end |
- | - | - |
af_num_adults |
fb_num_adults |
- | - | - |
af_num_children |
fb_num_children |
- | - | - |
af_num_infants |
fb_num_infants |
- | - | - |
af_class |
fb_travel_class |
- | - | travel_class |
af_suggested_hotels |
fb_suggested_hotels |
- | - | - |
af_user_score |
fb_user_score |
- | - | - |
af_hotel_score |
fb_hotel_score |
- | - | - |
af_price |
fb_purchase_value |
- | - | price |
af_purchase_currency- |
fb_purchase_currency |
- | - | - |
af_preferred_star_ ratings- |
fb_preferred_star_ |
- | - | - |
af_preferred_price_ range |
fb_preferred_star_ |
- | - | - |
af_preferred_ neighborhoods |
fb_preferred_ |
- | - | - |
af_preferred_num_ stops- |
fb_preferred_num_ |
- | - | - |
af_order_id |
fb_order_id |
- | - | order_id |
Share
Event Name: af_share
Description: Used to record sharing events
Event Parameter (Android): AFInAppEventType.SHARE
Event Parameter (iOS): AFEventShare
Facebook Mapped Event: None
Twitter Mapped Event: SHARE
Criteo Mapped Event: None
Google Ads: share
Recommended Attributes: af_description
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_description |
- |
description |
- |
description |
Invite
Event Name: af_invite
Description: Used to record invite (social) events
Event Parameter (Android): AFInAppEventType.INVITE
Event Parameter (iOS): AFEventInvite
Facebook Mapped Event: None
Twitter Mapped Event: INVITE
Criteo Mapped Event: None
Google Ads: invite
Recommended attributes: None
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_description |
- |
description |
- |
description |
Login
Event Name: af_login
Description: Used to record user login events
Event Parameter (Android): AFInAppEventType.LOGIN
Event Parameter (iOS): AFEventLogin
Facebook Mapped Event: None
Twitter Mapped Event: LOGIN
Criteo Mapped Event: None
Google Ads: login
Recommended attributes: None
Re-engage
Event Name: af_re_engage
Description: Used to record user re-engagement events
Event Parameter (Android): AFInAppEventType.RE_ENGAGE
Event Parameter (iOS): AFEventReEngage
Facebook Mapped Event: None
Twitter Mapped Event: RE_ENGAGE
Criteo Mapped Event: None
Google Ads: custom_event
Recommended Attributes: None
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_description |
- |
description |
- |
description |
Opened from push notification
Event Name: af_opened_from_push_notification
Description: Used to record app opens from push notification events
Event Parameter (Android): AFInAppEventType.OPENED_FROM_PUSH_NOTIFICATION
Event Parameter (iOS): AFEventOpenedFromPushNotification
Facebook Mapped Event: None
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: notification_open
Recommended Attributes: None
Update
Event Name: af_update
Description: Used to record update events
Event Parameter (Android): AFInAppEventType.UPDATE
Event Parameter (iOS): AFEventUpdate
Facebook Mapped Event: None
Twitter Mapped Event: UPDATE
Criteo Mapped Event: None
Google Ads: app_update
Recommended attributes: af_content_id
Attributes Mapping:
AppsFlyer | Criteo | Google Ads | ||
---|---|---|---|---|
af_content_id |
- |
content_id |
- |
item_id |
*To report an event containing multiple items, click here.
In addition to the events described above, that can be mapped to various networks' pre-defined events, Facebook offers additional events that are sent without attributes.
Optional parameters
In addition to the recommended parameters that can be passed with each event, the parameters below are defined as part of the AFInAppEventParameterName
interface and can be sent as part of the event dictionary value:
Parameter String Constant | Parameter String Name | Recommended Value Type |
---|---|---|
REVENUE (details) |
af_revenue |
Float |
PRICE (details) |
af_price |
Float |
LEVEL |
af_level |
Int |
SUCCESS |
af_success |
Boolean |
CONTENT_TYPE |
af_content_type |
String |
CONTENT_LIST |
af_content_list |
Array of strings |
CONTENT_ID |
af_content_id |
String |
CURRENCY |
af_currency |
String |
REGISTRATION_METHOD |
af_registration_method |
String |
QUANTITY |
af_quantity |
Int |
PAYMENT_INFO_AVAILABLE |
af_payment_info_available |
Boolean |
RATING_VALUE |
af_rating_value |
Float |
MAX_RATING_VALUE |
af_max_rating_value |
Float |
SEARCH_STRING |
af_search_string |
String |
DESCRIPTION |
af_description |
String |
SCORE |
af_score |
Int |
DESTINATION_A |
af_destination_a |
String |
DESTINATION_B |
af_destination_b |
String |
CLASS |
af_class |
String |
DATE_A |
af_date_a |
String |
DATE_B |
af_date_b |
String |
EVENT_START |
af_event_start |
Unixtime |
EVENT_END |
af_event_end |
Unixtime |
LATITUDE |
af_lat |
Int |
LONGITUDE |
af_long |
Int |
CUSTOMER_USER_ID |
af_customer_user_id |
String |
CUSTOMER_SEGMENT |
af_customer_segment |
String |
VALIDATED |
af_validated |
String |
RECEIPT_ID |
af_receipt_id |
String |
ORDER_ID |
af_order_id |
String |
TUTORIAL_ID |
af_tutorial_id |
String |
ACHIEVEMENT_ID |
af_achievement_id |
String |
VIRTUAL_CURRENCY_NAME |
af_virtual_currency_name |
String |
DEEP_LINK |
af_deep_link |
String |
OLD_VERSION |
af_old_version |
String |
NEW_VERSION |
af_new_version |
String |
REVIEW_TEXT |
af_review_text |
String |
COUPON_CODE |
af_coupon_code |
String |
DEPARTING_DEPARTURE_DATE |
af_departing_departure_date |
String |
RETURNING_DEPARTURE_DATE |
af_returning_departure_date |
String |
DESTINATION_LIST |
af_destination_list |
String[] |
CITY |
af_city |
String |
REGION |
af_region |
String |
COUNTRY |
af_county |
String |
DEPARTING_ARRIVAL_DATE |
af_departing_arrival_date |
String |
RETURNING_ARRIVAL_DATE |
af_returning_arrival_date |
String |
SUGGESTED_DESTINATIONS |
af_suggested_destinations |
String[] |
TRAVEL_START |
af_travel_start |
String |
TRAVEL_END |
af_travel_end |
String |
NUM_ADULTS |
af_num_adults |
Int |
NUM_CHILDREN |
af_num_children |
Int |
NUM_INFANTS |
af_num_infants |
Int |
SUGGESTED_HOTELS |
af_suggested_hotels |
String[] |
USER_SCORE |
af_user_score |
Float |
HOTEL_SCORE |
af_hotel_score |
Float |
PURCHASE_CURRENCY |
af_purchase_currency |
String |
PREFERRED_STAR_RATINGS |
af_preferred_star_ratings |
Int[2] |
PREFERRED_PRICE_RANGE |
af_preferred_price_range |
Int[2] |
PREFERRED_NEIGHBORHOODS |
af_preferred_neighborhoods |
String[] |
PREFERRED_NUM_STOPS |
af_preferred_num_stops |
Int |
CONTENT |
af_content |
String |
PARAM_1 |
af_param_1 |
String |
PARAM_2 |
af_param_2 |
String |
PARAM_3 |
af_param_3 |
String |
PARAM_4 |
af_param_4 |
String |
PARAM_5 |
af_param_5 |
String |
PARAM_6 |
af_param_6 |
String |
PARAM_7 |
af_param_7 |
String |
PARAM_8 |
af_param_8 |
String |
PARAM_9 |
af_param_9 |
String |
PARAM_10 |
af_param_10 |
String |
Revenue parameter
You can send revenue values with any parameter name and event. However, to register the revenue in AppsFlyer's raw and aggregated data, you MUST use the af_revenue parameter. Always use it with in-app events that represent actual revenue generation in your business logic.
For more details about the af_revenue parameter visit the Revenue Attribution guide.
Multiple items
You can add multiple items to a single transaction. Instead of single values per event parameter you can have an array of items describing the transaction, separated by commas.
Example
In the same transaction, Mr A. Flyer purchases two identical shirts, one pair of shoes and a hat from a US-based online store. The sequence in which each item is listed must be identical for each parameter.
af_content_id: ["123","988","399"]
af_quantity: [2,1,1]
af_price: [25,50,10]
af_revenue: [110]
af_currency: USD
For Multiple Items, the code appears, as follows:
Map<String,Object> eventData = new HashMap<>();
eventData.put(AFInAppEventParameterName.CONTENT_ID, new String[] {"123","988","399"});
eventData.put(AFInAppEventParameterName.QUANTITY, new int[] {2, 1, 1});
eventData.put(AFInAppEventParameterName.PRICE,new int[] {25, 50, 10});
eventData.put(AFInAppEventParameterName.CURRENCY,"USD");
eventData.put(AFInAppEventParameterName.REVENUE,110);
AppsFlyerLib.getInstance().trackEvent(AppsFlyerTestActivity.this, AFInAppEventType.PURCHASE,eventData);
Multiple items are sent onward as an array in postbacks. Currently Facebook and Twitter can't parse array parameters correctly. To help out AppsFlyer sums up the quantity of items (af_quantity) instead of sending it to them as an array (e.g., in the example above Facebook would get af_quantity=4).
Note
Multiple items can be used with the following in-app events:
af_add_to_cart, af_add_to_wishlist, af_tutorial_completion, af_initiated_checkout, af_purchase, af_rate, af_spent_credits, af_content_view, af_travel_booking, af_update
Complex in-app events
Complex In-App events enable sending multiple events in a single API call.
They are useful when you want to see several closely related user actions grouped together, e.g. adding several products to the basket in a single session.
Example:
{
"af_revenue":"50.87",
"af_currency":"USD",
"af_receipt_id":"57601333",
"product":[
{
"af_content_id":"1164_8186",
"af_price":"8.97",
"af_quantity":"1"
},
{
"af_content_id":"1164_8186",
"af_price":"8.97",
"af_quantity":"1"
},
{
"af_content_id":"1164_8186",
"af_price":"8.97",
"af_quantity":"1"
},
{
"af_content_id":"1177_8185",
"af_price":"8.97",
"af_quantity":"1"
},
{
"af_content_id":"0153_9077",
"af_price":"14.99",
"af_quantity":"1"
}
]
}
Warning
Complex In-App events cause postback issues with Facebook and Criteo. If you need the event to be fully mapped with Facebook and Criteo, you should send separate events per user action, e.g. send an Add to cart event per each added item. Using the in-app events raw data you can group these events together.
Recording events offline
- SDK sends the events to AppsFlyer's servers and waits for a response.
- If the SDK doesn’t receive a 200 response, the event is stored in the cache.
- Once the next 200 response is received, the stored event is re-sent to the server.
- If there are multiple events in the cache, they are sent to the server one promptly after another.
Note
SDK’s cache can store up to 40 events, which means that only the first 40 events that happen offline are saved. Everything that comes afterwards until the next 200 response, gets discarded.
The event time that appears in the raw data is the time the event is sent to AppsFlyer after the device goes online again. It is not the actual time that the event takes place.
Event deduplication
AppsFlyer has an in-app event deduplication mechanism. It checks all in-app events to see if there was an identical in-app event that came from the same appsflyer_id less than 10 seconds beforehand. If such an event is found, the mechanism removes the duplicate.
Two events are considered identical if the following fields in both events are the same:
- Event name
- Event value
- App ID
- AppsFlyer ID
Note
Deduplication works only for in-app events which are sent from the SDK.
S2S in-app events don’t get deduplicated.
In this section, we list comprehensive sets of in-app events for several verticals. Each vertical in this section contains carefully selected in-app events that we recommend recording.
To start recording in-app events:
- Select your vertical.
- Select the in-app events that you want to record. We recommend recording all the events listed in your vertical.
- Copy the code snippets for each in-app event and implement in your app where applicable.
If you'd like to find out the most popular in-app events mapped per app size and per vertical, click here.
Gaming
Gaming apps include games such as arcade, strategy, educational games and even gambling. The events that we recommend recording in gaming apps are in-app purchases, sharing on social media and inviting friends. Additional events can be leveling up in a game and completing an in-game tutorial. Here are some examples of how recording these events can benefit you:
- recording in-app purchases can help you understand what offers users purchase the most.
- recording leveling up helps you understand how engaged your users are.
- recording share and invite events helps you understand how many users share and invite other players, and on what social media platforms they do so.
Tip
The events discussed here are also relevant for gaming apps that run on the following platforms:
- Android Smart TV
- Apple TV (tvOS)
- Amazon Fire TV
- Xbox
Login
Event Name: af_login
Purpose
This event can help you understand the retention of your registered users.
Trigger logic
Trigger this event whenever the user logs in.
Recommended attributes
This event can be sent without any additional attributes.
Code Examples
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventLogin withValues: nil];
AppsFlyerTracker.shared().trackEvent(AFEventLogin, withValues: nil);
AppsFlyer.trackRichEvent ("af_login", null);
Complete registration
Event Name: af_complete_registration
Purpose
You can record user registration and compare it with other data to learn more about your users. By recording user registration events you can:
- Learn how many users installed the app but never signed up.
- Learn what signup methods your users prefer.
Trigger logic
The best way to record this event is to trigger it when the user completes the signup process.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | email, facebook | The type of signup method |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerTracker.shared().trackEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompletedRegistrationEvent = new Dictionary<string, string>();
CompletedRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.trackRichEvent ("af_complete_registration", CompletedRegistrationEvent);
Purchase
Event Name: af_purchase
Purpose
Many gaming apps allow users to purchase items, e.g. coins, gems or weapons etc. The Purchase event helps you record in-app purchases made by users. By recording purchases you can:
- Determine the LTV of your users and the ROI of your campaigns across ad networks and ad agencies.
- Determine what offers are most popular with your users.
- Cross-reference campaigns with purchased items in order to optimize campaign targeting.
Trigger logic
To record this event properly, you should trigger it when the user lands in the thank you page after a successful purchase.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 2000 | The estimated revenue from the purchase |
af_currency | string | THB / USD | The currency code |
af_quantity | int | 2 | The number of items purchased |
af_content_id | string | 001, 092 | The id of the item |
order_id | string | 9277 | The order ID |
af_receipt_id | string | 9277 | The receipt ID |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REVENUE, 200);
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "092");
eventValue.put("order_id", "9277");
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "9277");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventPurchase
withValues: @{
AFEventParamRevenue: @200,
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2,
AFEventParamContentId: @"092",
@"order_id": @"9277",
AFEventParamReceiptId: @"9277"
}];
AppsFlyerTracker.shared().trackEvent(AFEventPurchase,
withValues: [
AFEventParamRevenue: 200,
AFEventParamCurrency: "THB",
AFEventParamQuantity: 2,
AFEventParamContentId: "092",
"order_id": "9277",
AFEventParamReceiptId: "9277"
]);
Dictionary<string, string> purchaseEvent = new Dictionary<string, string>();
purchaseEvent.Add("af_revenue", "200");
purchaseEvent.Add("af_currency", "USD");
purchaseEvent.Add("af_quantity", "2");
purchaseEvent.Add("af_content_id", "001");
purchaseEvent.Add("order_id", "9277");
purchaseEvent.Add("af_receipt_id", "9277");
AppsFlyer.trackRichEvent ("af_purchase", purchaseEvent);
Level achieved
Event Name: af_level_achieved
Purpose
One of the main goals of users is to level up in games. Leveling up often unlocks new features and stages in the game and this encourages users to keep playing. The Level Achieved event helps you record user engagement with your app. By recording levels achieved by users you can:
- Determine which campaigns generate the most active users.
- See what type of users are most active and engaged.
- Associate overall user activity with dimensions such as revenue etc.
Trigger logic
To record this event properly, you should trigger it when the user lands on the level completion page.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_level | int | 3 | The level the user achieved |
af_score | int | 500 | The score that is associated with the user's achievement |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.LEVEL, 10);
eventValue.put(AFInAppEventParameterName.SCORE, 500);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.LEVEL_ACHIEVED, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventLevelAchieved
withValues: @{
AFEventParamLevel: @10,
AFEventParamScore: @500
}];
AppsFlyerTracker.shared().trackEvent(AFEventLevelAchieved,
withValues: [
AFEventParamLevel: 3,
AFEventParamScore: 500
]);
Dictionary<string, string> LevelAchievedEvent = new Dictionary<string, string>();
LevelAchievedEvent.Add("af_level", "10");
LevelAchievedEvent.Add("af_score", "500");
AppsFlyer.trackRichEvent ("af_level_achieved", LevelAchievedEvent);
Tutorial Completion
Event Name: af_tutorial_completion
Purpose
Tutorials help your users learn how to better use your app. By recording tutorial completion, you can:
- Learn what topics users might have trouble with.
- Learn what tutorials are not performing well and improve them.
Trigger logic
There are two scenarios in which this event should be triggered:
- When a user completes the tutorial. An event will be sent with an attribute indicating successful tutorial completion.
- When a user starts the tutorial but quits without completing it. When the user quits, an event is sent with an attribute indicating that the user didn't complete the tutorial.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_success | boolean | true | Whether the user completed the tutorial or not |
af_tutorial_id | string | 3 | The ID of the tutorial |
af_content | string | Getting Started | The name of the tutorial |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.SUCCESS, true);
eventValue.put(AFInAppEventParameterName.TUTORIAL_ID, "3");
eventValue.put(AFInAppEventParameterName.CONTENT, "Getting Started");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.TUTORIAL_COMPLETION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventTutorial_completion
withValues: @{
AFEventParamSuccess: @TRUE,
AFEventParamTutorialId: @"3",
AFEventParamContent: @"Getting Started"
}];
AppsFlyerTracker.shared().trackEvent(AFEventTutorial_completion,
withValues: [
AFEventParamSuccess: true,
AFEventParamTutorialId: "3",
AFEventParamContent: "Getting started"
]);
Dictionary<string, string> TutorialCompletiondEvent = new Dictionary<string, string>();
TutorialCompletiondEvent.Add("af_success", "true");
TutorialCompletiondEvent.Add("af_tutorial_id", "3");
TutorialCompletiondEvent.Add("af_tutorial_content", "Getting started");
AppsFlyer.trackRichEvent ("af_tutorial_completion", TutorialCompletiondEvent);
Share
Event Name: af_share
Purpose
Users like to share their achievements in games on social media sites. Sharing creates brand awareness and can drive more users to download and install your app. By recording the Share event you can understand when users are most likely to share the app with their friends.
Tip
The AppsFlyer SDK has dedicated methods for recording shares and invites.
Trigger logic
To properly record this event, you should trigger it when a user successfully posts a share on social media:
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_description | string | New High Score / Level up / Game won | The reason for sharing on social media. Could be a new high score, leveling up, etc. |
platform | string | Facebook, Whatsapp, Email | The platform where the user shares |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.DESCRIPTION, "New High Score");
eventValue.put("platform", "Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.SHARE, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventShare
withValues: @{
AFEventParamDescription: @"New High Score",
@"platform": @"Facebook"
}];
AppsFlyerTracker.shared().trackEvent(AFEventShare,
withValues: [
AFEventParamDescription: "New High Score",
"platform": "Facebook"
]);
Dictionary<string, string> ShareEvent = new Dictionary<string, string>();
ShareEvent.Add("af_description", "New High Score");
ShareEvent.Add("platform", "Facebook");
AppsFlyer.trackRichEvent ("af_share", ShareEvent);
Invite
Event Name: af_invite
Purpose
Users often invite their friends to download and install an app. Many times users want to share the app, and other times they are rewarded for inviting others. You can record invitations using the Invite event. By recording this event you can:
- Learn on what social media sites users usually send invites to friends.
- Learn how many users invited their friends to download and install the app.
Trigger logic
To record this event properly, you should trigger it when the user successfully invited a friend to download and install the app.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_description | string | Try this app | The context of invitation |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.DESCRIPTION, "Try this app");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.INVITE, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventInvite
withValues: @{
AFEventParamDescription: @"Try this app"
}];
AppsFlyerTracker.shared().trackEvent(AFEventInvite, withValues: [
AFEventParamDescription: "Try this app"
]);
Dictionary<string, string> InviteEvent = new Dictionary<string, string>();
InviteEvent.Add("af_description", "Try this app");
AppsFlyer.trackRichEvent ("af_invite", InviteEvent);
Bonus Claimed
Event Name: bonus_claimed
Purpose
By recording the Bonus Claimed event, you can:
- See how many users claimed bonuses that are offered to them.
- Associate claimed bonuses with user activity and engagement.
Trigger logic
To record this event properly, you should trigger it when the user claims a bonus and it gets updated in their account.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
bonus_type | string | coins | The type of bonus that the user claims |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("bouns_type", "coins");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "bonus_claimed", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"bonus_claimed"
withValues: @{
@"bonus_type": @"coins"
}];
AppsFlyerTracker.shared().trackEvent("bonus_claimed", withValues: [
"bouns_type": "coins"
]);
Dictionary<string, string> BonusClaimedEvent = new Dictionary<string, string>();
BonusClaimedEvent.Add("bouns_type", "coins");
AppsFlyer.trackRichEvent ("bonus_type", BonusClaimedEvent);
eCommerce
eCommerce apps allow buyers to easily search for and buy goods online. One of the core features of eCommerce apps is that they allow buyers to compare prices in order to get the best deals. We recommend that you implement event recording in your eCommerce app. recording events can help you gain valuable insights into what people look for and what they buy.
The events that we recommend recording are search, purchase, adding to cart and adding to wishlist. By recording these events you can:
- Highlight the most popular categories.
- See what buyers are searching for.
- Record how many buyers completed checkout.
- Learn how many buyers are recurring buyers and how many are just one-time buyers.
Complete registration
Event Name: af_complete_registration
Purpose
The purpose of the Complete registration event is to let you record how many users signed up after downloading and installing the app. You can also record the signup method i.e. Facebook, email etc.
Trigger logic
Trigger this event after a user successfully registered.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | Facebook, Google, email | The method the user chooses to sign up with |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD,"Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerTracker.shared().trackEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.trackRichEvent("af_complete_registration", CompleteRegistrationEvent);
Login
Event Name: af_login
Purpose
The Login event allows you to record how many users log in to their account. With the login event you can record:
- How many users are active.
- When users are most active.
Trigger logic
Trigger this event when the user successfully logs in.
Recommended attributes
This event can be sent with no additional attributes.
Code Examples
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventLogin withValues: nil];
AppsFlyerTracker.shared().trackEvent(AFEventLogin, withValues: nil);
AppsFlyer.trackRichEvent("af_login", null);
Search
Event Name: af_search
Purpose
By recording Search events you can learn what users are looking for. You can also learn what search results are most relevant for them. Additionally, you can record what search results lead to purchase.
Trigger logic
You should trigger this event in one of two scenarios:
- When the user clicks on the search button.
- When the user lands on the search results page.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_search_string | string | red dress, running shoes | The search term |
af_content_list | array of strings | 001, 092 | The list of content IDs |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.SEARCH_STRING, "red shoes");
eventValue.put(AFInAppEventParameterName.CONTENT_LIST, new String[] {"001", "092"});
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.SEARCH, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventSearch
withValues: @{
AFEventParamSearchString: @"red shoes",
AFEventParamContentList: @[@"001", @"092"]
}];
AppsFlyerTracker.shared().trackEvent(AFEventSearch, withValues: [
AFEventParamSearchString: "red shoes",
AFEventParamContentList: ["001", "092"]
]);
Dictionary<string, string> SearchEvent = new Dictionary<string, string>();
SearchEvent.Add("af_search_string", "red shoes");
SearchEvent.Add("af_content_list", "['001', '092']");
AppsFlyer.trackRichEvent("af_search", SearchEvent);
Content view
Event Name: af_content_view
Purpose
The Content view event can help you record the view rate of specific products. recording this event can help you:
- Correlate product views with product sales.
- Understand what categories are the most popular according to product views.
- See the correlation between buyers currency and the products that they view.
Trigger logic
You should trigger this event when the user views a specific product details page.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 2000 | The product price |
af_content_id | string | 102 | Product ID |
af_content_type | string | shoes | Product category |
af_currency | string | THB, USD | The currency in the product details page |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 2000);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "102";
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "shoes");
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventContentView
withValues: @{
AFEventParamPrice: @2000,
AFEventParamContentId: @"102",
AFEventParamContentType: @"shoes",
AFEventParamCurrency: @"USD"
}];
AppsFlyerTracker.shared().trackEvent(AFEventContentView,
withValues: [
AFEventParamPrice: 2000,
AFEventParamContentId: "102",
AFEventParamContentType: "shoes",
AFEventParamCurrency: "USD"
]);
Dictionary<string, string> ContentViewEvent = new Dictionary<string, string>();
ContentViewEvent.Add("af_price", "2000");
ContentViewEvent.Add("af_content_type", "shoes");
ContentViewEvent.Add("af_currency", "USD");
AppsFlyer.trackRichEvent("af_content_view", ContentViewEvent);
List View
Event Name: af_list_view
Purpose
It is common for eCommerce platforms to have lists that show products by category such as newly added products, related products, recommended products etc. The List View event can help you record what lists buyers view the most.
Trigger logic
Trigger this event when the buyer views a specific list.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_content_type | string | related, recommended, new arrivals | The type of list |
af_content_list | array of strings | 001, 092 | List of content IDs from the category |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "related products");
eventValue.put(AFInAppEventParameterName.CONTENT_LIST, new String[] {"001", "092"});
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "af_list_view", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventListView
withValues: @{
AFEventParamContentType: @"related products",
AFEventParamContentList: @[@"001", @"092"]
}];
AppsFlyerTracker.shared().trackEvent(AFEventListView,
>withValues: [
AFEventParamContentType: "related products",
AFEventParamContentList: ["001", "092"]
]);
Dictionary<string, string> ListViewEvent = new Dictionary<string, string>();
ListViewEvent.Add("af_content_type", "related products");
ListViewEvent.Add("af_content_list", "['001', '092']");
AppsFlyer.trackRichEvent("af_list_view", ListViewEvent);
Add to Wishlist
Event Name: af_add_to_wishlist
Purpose
By recording the Add to Wishlist event, you can record what products and categories buyers add to their wishlists. When you know what products are often added to wishlists, you can then offer these products in sales or discounts and encourage buyers to purchase them. You can also retarget these users according to the products that they added to their wishlist.
Trigger logic
Trigger this event when buyers add items to their wishlist.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 600 | The price of the product |
af_content_id | string | 300 | Product ID |
af_content_type | string | shoes, electronics | Product category |
af_currency | string | GBP | Currency shown in the proudct details page |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 600);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "300");
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "electronics");
eventValue.put(AFInAppEventParameterName.CURRENCY, "GBP");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.ADD_TO_WISH_LIST, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventAddToWishlist
withValues: @{
AFEventParamPrice: @600,
AFEventParamContentId: @"300",
AFEventParamContentType: @"electronics",
AFEventParamCurrency: @"GBP"
}];
AppsFlyerTracker.shared().trackEvent(AFEventAddToWishlist,
withValues: [
AFEventParamPrice: 600,
AFEventParamContentId: "300",
AFEventParamContentType: "electronics",
AFEventParamCurrency: "GBP"
]);
Dictionary<string, string> AddToWishListEvent =
new Dictionary<string, string>();
AddToWishListEvent.Add("af_price", "600");
AddToWishListEvent.Add("af_content_id", "300");
AddToWishListEvent.Add("af_content_type", "electronics");
AddToWishListEvent.Add("af_currency", "GBP");
AppsFlyer.trackRichEvent("af_add_to_wishlist", AddToWishListEvent);
Add to Cart
Event Name: af_add_to_cart
Purpose
The purpose of the Add to Cart event is to record adding products to cart. By recording this event you can:
- See how many products on average buyers add in one purchase.
- See how much time passes between adding two different products.
- See who many buyers abandon their cart.
Trigger logic
Trigger this event when the buyer adds a product to the cart.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 350, 1000 | Product price |
af_content_id | string | 001, 092 | product ID |
af_content_type | string | shirt, shoes | product type |
af_currency | string | THB, USD | Product currency |
af_quantity | float | 2, 5 | How many items of the same product were added to the cart |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 350);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "001");
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "shirt");
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.ADD_TO_CART, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventAddToCart
withValues: @{
AFEventParamPrice: @350,
AFEventParamContentId: @"001",
AFEventParamContentType: @"shirt",
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2
}];
AppsFlyerTracker.shared().trackEvent(AFEventAddToCart, withValues: [
AFEventParamPrice: 350,
AFEventParamContentId: "001",
AFEventParamContentType: "shirt",
AFEventParamCurrency: "USD",
AFEventParamQuantity: 2
]);
Dictionary<string, string> AddToCartEvent = new Dictionary<string, string>();
AddToCartEvent.Add("af_price", "350");
AddToCartEvent.Add("af_content_id", "001");
AddToCartEvent.Add("af_content_type", "shirt");
AddToCartEvent.Add("af_currency", "USD");
AddToCartEvent.Add("af_quantity", "2");
AppsFlyer.trackRichEvent("af_add_to_cart", AddToCartEvent);
Initiated Checkout
Event Name: af_initiated_checkout
Purpose
recording the Initiated Checkout event can help you understand how buyers behave when they proceed to checkout. For example, you can:
- See the average price when buyers checkout and compare it with the average price in the purchase event.
- See if users add or remove products after proceeding to checkout.
Trigger logic
Trigger this event when the buyer initiates the checkout, but didn't complete the check out yet.
Recommended attributes
Tip
If there are several products from different categories, use arrays to send the data.
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 4000 | Total price in the cart |
af_content_id | string or array of strings | 221, 124 | ID of products in the cart |
af_content_type | string or array of strings | shirt, pants | List of product categories |
af_currency | string | THB | Currency in time of checkout |
af_quantity | int or array of ints | 2, 5 | Total items in the cart |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 350);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "221");
// for multiple product categories, set the param value as: new String {"221", "124"}
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "shirt");
// for multiple product categories,, set the param value as: new String {"shirt", "pants"}
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
// for multiple product categories,, set the param value as: new int {2, 5}
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.INITIATED_CHECKOUT, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventInitiatedCheckout
withValues: @{
AFEventParamPrice: @350,
AFEventParamContentId: @"221",
// for multiple product categories, set the param value as: @[@"221", @"124"]
AFEventParamContentType: @"shirt",
// for multiple product categories, set the param value as: @[@"shirt", @"pants"]
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2
// for multiple product categories, set the param value as: @[@2, @5]
}];
AppsFlyerTracker.shared().trackEvent(AFEventInitiatedCheckout,
withValues: [AFEventParamPrice: 350,
AFEventParamContentId: "221",
// for multiple product categories, set the param value as: ["221", "124"]*/
AFEventParamContentType: "shirt",
// for multiple product categories, set the param value as: ["shirt", "pants"] AFEventParamCurrency: "USD",
AFEventParamQuantity: 2
//for multiple product categories, set the param value as: [2, 5]
]);
Dictionary<string, string> InitiatedCheckoutEvent = new Dictionary<string, string>();
InitiatedCheckoutEvent.Add("af_price", "350");
InitiatedCheckoutEvent.Add("af_content_id", "001");
InitiatedCheckoutEvent.Add("af_content_type", "shirt");
InitiatedCheckoutEvent.Add("af_currency", "USD");
InitiatedCheckoutEvent.Add("af_quantity", "2");
AppsFlyer.trackRichEvent ("af_initiated_checkout", InitiatedCheckoutEvent);
Purchase
Event Name: af_purchase
Purpose
The Purchase event is one of the most significant events in eCommerce. recording the Purchase event can tell you a lot about purchase trends in your eCommerce app. By recording the Purchase event you can:
- See how many users overall are actually buyers.
- Record the most active buyers and retarget them deals according to their purchase history.
- Understand what products and categories perform well in term of overall purchases.
- Record revenue generated from purchases across products and categories.
- Record revenue generated across campaigns and media sources.
Trigger logic
Trigger this event when a buyer finishes their purchase but didn't necessarily pay yet.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 1200 | Revenue from purchase |
af_price | float | 4000 | Overall purchase sum |
af_content_id | string | 121, 262 | Item ID |
af_content_type | string | shoes, pants | Item category |
af_currency | string | AUD | Currency |
af_quantity | int | 2, 5 | Number of items in the cart |
af_order_id | string | X123ABC | ID of the order that is generated after purchased. |
af_receipt_id | string | X123ABC | Order ID, but needed for CRITEO & Google AdWords Retargeting integration |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 350);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "221");
// for multiple product categories, set the param value as: // new String {"221", "124"}
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "shirt");
// for multiple product categories,, set the param value as: new String {"shoes", "pants"}
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
// for multiple product categories, set the param value as: new int {2, 5}
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "X123ABC");
eventValue.put("af_order_id", "X123ABC");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventPurchase
withValues: @{
AFEventParamRevenue: @1200,
AFEventParamPrice: @4000,
AFEventParamContentId: @"221",
// for multiple product categories, set the param value as:
// @[@"221", @"124"]
AFEventParamContentType: @"shirt",
// for multiple product categories, set the param value as:
// @[@"shoes", @"pants"]
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2,
// for multiple product categories, set the param value as:
// @[@2, @5]
AFEventParamOrderId: @"X123ABC",
AFEventParamReceiptId: @"X123ABC"
}];
AppsFlyerTracker.shared().trackEvent(AFEventPurchase, withValues: [
AFEventParamRevenue: 1200,
AFEventParamPrice: 4000,
AFEventParamContentId: "221",
// for multiple product categories, set the param value as: ["221", "124"],
AFEventParamContentType: "shirt",
// for multiple product categories, set the param value as: ["shoes", "pants"]
AFEventParamCurrency: "USD",
AFEventParamQuantity: 2,
// for multiple product categories, set the param value as: [2, 5]
AFEventParamOrderId: "X123ABC",
AFEventParamReceiptId: "X123ABC"
]);
Dictionary<string, string> PurchaseEvent = new Dictionary<string, string>();
PurchaseEvent.Add("af_revenue", "1200");
PurchaseEvent.Add("af_price", "4000");
PurchaseEvent.Add("af_content_id", "121");
// for multiple product categories, set the param value as: ["221", "124"]
PurchaseEvent.Add("af_content_type", "shoes");
// for multiple product categories, set the param value as: ["shirt", "pants"]
PurchaseEvent.Add("af_currency", "USD");
PurchaseEvent.Add("af_quantity", "2");
// for multiple product categories, set the param value as: [2, 5]
PurchaseEvent.Add("af_order_id", "X123ABC");
PurchaseEvent.Add("af_receipt_id", "X123ABC");
AppsFlyer.trackRichEvent ("af_purchase", PurchaseEvent);
Completed Purchase
Event Name: completed_purchase
Purpose
recording the Completed Purchase event can help you analyze how purchases are actually paid in full.
Trigger logic
When a user pays for their purchase, the event can be sent using S2S since this event happens in the back-end.
Important!
This event should be sent if payment is done offline i.e. bank transfer or cash on delivery. If you send this event, make sure that the Purchase event ( af_purchase
) doesn't contain the af_revenue
parameter. If you send both events with the af_revenue
parameter, the revenue is doubled.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 4000 | Revenue generated from purchase |
af_order_id | string | X123ABC | Order ID generated from purchase |
af_receipt_id | string | X123ABC | Receipt ID generated for the buyer |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REVENUE, 4000);
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "X123ABC");
eventValue.put("af_order_id" "X123ABC");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "completed_purchase", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"completed_purchase"
withValues: @{
AFEventParamRevenue: @4000,
AFEventParamOrderId: @"X123ABC",
AFEventParamReceiptId: @"X123ABC"
}];
AppsFlyerTracker.shared().trackEvent("completed_purchase", withValues: [
AFEventParamRevenue: 4000,
AFEventParamOrderId: "X123ABC",
AFEventParamReceiptId: "X123ABC"
]);
Dictionary<string, string> CompletedPurchaseEvent = new Dictionary<string, string>();
CompletedPurchaseEvent.Add("af_revenue", "1200");
CompletedPurchaseEvent.Add("af_order_id", "X123ABC");
CompletedPurchaseEvent.Add("af_receipt_id", "X123ABC");
AppsFlyer.trackRichEvent ("completed_purchase", CompletedPurchaseEvent);
Remove From Cart
Event Name: remove_from_cart
Purpose
By recording the Remove From Cart you can:
- See what items buyers remove from their cart.
- See the product categories of items that buyers remove from their cart.
- Compare the data from the Add to Cart event to gain insights into products that don't make it to checkout.
Trigger logic
Trigger this event when a buyer removes an item from the cart.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_content_id | string | 521 | Item or product ID |
af_content_type | string | shoes | Item or product category |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "521");
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "shoes");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "remove_from_cart", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"remove_from_cart"
withValues: @{
AFEventParamContentId: @"521",
AFEventParamContentType: @"shoes",
}];
AppsFlyerTracker.shared().trackEvent("remove_from_cart", withValues: [
AFEventParamContentId: "521",
AFEventParamContentType: "shoes",
]);
Dictionary<string, string> RemoveFromCartEvent = new Dictionary<string, string>();
RemoveFromCartEvent.Add("af_content_id", "521");
RemoveFromCartEvent.Add("af_content_type", "shoes");
AppsFlyer.trackRichEvent ("remove_from_cart", RemoveFromCartEvent);
First Purchase
Event Name: first_purchase
Purpose
This event is the same as the Purchase event. However, unlike the Purchase event, the First Purchase event can be used in order to:
- See how long it takes a new buyer to purchase.
- See what products first-time buyers prefer to purchase.
- See the average price and revenue of first-time purchases.
Trigger logic
Trigger this event when the user completes their first purchase.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 1200 | Revenue from purchase |
af_price | float | 4000 | Overall purchase sum |
af_content_id | string | 121, 262 | Item ID |
af_content_type | string | shoes, pants | Item category |
af_currency | string | AUD | Currency |
af_quantity | int | 2, 5 | Quantity of items in the cart |
af_order_id | string | X123ABC | ID of the order that is generated after purchased. |
af_receipt_id | string | X123ABC | Order ID, but needed for CRITEO & Google AdWords Retargeting integration |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 350);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "221");
// for multiple product categories, set the param value as: new String {"221", "124"}
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "shirt");
// for multiple product categories set the param value as: new String {"shoes", "pants"}
eventValue.put(AFInAppEventParameteName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
// for multiple product categories, set the param value as: new int {2, 5}
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "X123ABC");
eventValue.put("af_order_id", "X123ABC");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "first_purchase", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:("first_purchase")
withValues: @{
AFEventParamRevenue: @1200,
AFEventParamPrice: @4000,
AFEventParamContentId: @"221",
// for multiple product categories, set the param value as: @[@"221", @"124"]
AFEventParamContentType: @"shirt",
// for multiple product categories, set the param value as: @[@"shoes", @"pants"]
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2,
// for multiple product categories, set the param value as: @[@2, @5]
AFEventParamOrderId: @"X123ABC",
AFEventParamReceiptId: @"X123ABC"
}];
AppsFlyerTracker.shared().trackEvent("first_purchase", withValues: [
AFEventParamRevenue: 1200,
AFEventParamPrice: 4000,
AFEventParamContentId: "221",
// for multiple product categories, set the param value as: ["221", "124"]
AFEventParamContentType: "shirt",
// for multiple product categories, set the param value as: ["shoes", "pants"]
AFEventParamCurrency: "USD",
AFEventParamQuantity: 2,
// for multiple product categories, set the param value as: // [2, 5]
AFEventParamOrderId: "X123ABC",
AFEventParamReceiptId: "X123ABC"
]);
Dictionary<string, string> FirstPurchaseEvent = new Dictionary<string, string>();
FirstPurchaseEvent.Add("af_revenue", "1200");
FirstPurchaseEvent.Add("af_price", "4000");
FirstPurchaseEvent.Add("af_content_id", "121");
// for multiple product categories, set the param value as: ["221", "124"]
FirstPurchaseEvent.Add("af_content_type", "shoes");
// for multiple product categories, set the param value as: ["shirt", "pants"]
FirstPurchaseEvent.Add("af_currency", "USD");
FirstPurchaseEvent.Add("af_quantity", "2");
// for multiple product categories, set the param value as: [2, 5]
FirstPurchaseEvent.Add("af_order_id", "X123ABC");
FirstPurchaseEvent.Add("af_receipt_id", "X123ABC");
AppsFlyer.trackRichEvent ("first_purchase", FirstPurchaseEvent);
Entertainment - Streaming
With the growing requirement by users for on-demand content, the streaming applications market has become very competitive. If you manage and run an on-demand content streaming app, it is recommended that you record events in the app.
Tip
The events discussed here are also relevant for streaming apps that run on smart tvs such as:
- Android Smart TV
- Apple TV (tvOS)
- Amazon Fire TV
By recording events in your streaming application, you can:
- See what content users consume.
- Analyze and optimize campaigns according to content demand.
- Measure user engagement and usage.
Event Name: af_complete_registration
Purpose
The purpose of the Complete registration event is to let you record how many users signed up after downloading and installing the app. You can also record the signup method i.e. Facebook, email etc. to learn what signup method users prefer.
Trigger logic
Trigger this event after a user successfully registered.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | Facebook, Google, email | The method the user chooses to sign up with |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerTracker.shared().trackEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.trackRichEvent("af_complete_registration", CompleteRegistrationEvent);
Event Name: af_login
Purpose
The Login event allows you to record how many users log in to their account. With the login event you can record:
- How many users are active.
- When users are most active.
Trigger logic
Trigger this event when the user successfully logs in.
Recommended attributes
This event can be sent with no additional attributes.
Code Examples
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventLogin withValues: nil];
AppsFlyerTracker.shared().trackEvent(AFEventLogin, withValues: nil);
AppsFlyer.trackRichEvent("af_login", null);
Event Name: af_start_trial
Purpose
Many streaming services offer users a trial period to explore premium features. By recording the Start Trial event you can:
- See how many users opt-in for a trial period.
- If the trial is part of a promotion or a collaboration with a partner, you can record what promotion prompted the user to activate the trial period.
Trigger logic
Trigger this event when the user opts-in and activates the trial period.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
trial_method | string | free with new phone, free with carrier, promotion, coupon code | The method to activate the trial |
trial_method_identifier | string |
name of carrier i.e. Vodafone, name of partner, i.e. Facebook, coupon code i.e. TRA123 |
The identifier of the trial method |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("trial_method", "coupon code");
eventValue.put("trial_method_identifier", "TRA123");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.START_TRIAL, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventStartTrial
withValues: @{
@"trial_method": @"coupon code",
@"trial_method_identifier": @"TRA123"
}]
AppsFlyerTracker.shared().trackEvent(AFEventStartTrial,
withValues: [
"trial_method": "coupon code",
"trial_method_identifier": "TRA123"
]);
Dictionary<string, string> SubscriptionTrial = new Dictionary<string, string>();
SubscriptionTrial.Add("trial_method ", "coupon code");
SubscriptionTrial.Add("trial_method_identifier", "TRA123");
AppsFlyer.trackRichEvent("af_start_trial", SubscriptionTrial);
Event Name: af_subscribe
Purpose
Subscription is at the core of streaming services. By recording user subscription events you can:
- See which campaigns bring users that subscribe.
- Compare the number of users in trial against subscribed users.
- Record revenue generated from subscriptions and attribute it to campaigns and media sources.
Trigger logic
Trigger this event in one of two scenarios:
- when the user successfully subscribes.
- When a subscription is renewed.
Tip
Refer to our Recording recording Guide for more information.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
new_subscription | boolean | true / false | Whether the subscription is new or renewed |
af_coupon_code | string | 3MonthsSubscription | The coupon code if one is used during the subscription |
coupon_code_value | string | 10% | How much the coupon deducts from the initial price |
af_revenue | float | 5 | The revenue associated with the subscription |
af_currency | string | USD | The currency of the payment for the subscription |
subscription_method | string | credit card, e-wallet, PayPal | The payment method used in the subscription |
expiration_date | string | 2018/07/18 | The expiry date of the subscription |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("new_subscription", true);
eventValue.put(AFInAppEventParameterName.COUPON_CODE, "3MonthsSubscription");
eventValue.put("coupon_code_value", "10%");
eventValue.put(AFInAppEventParameterName.REVENUE, 5);
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put("subscription_method", "");
eventValue.put("expiration_date", "2018/07/18");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.SUBSCRIBE, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventSubscribe
withValues: @{
@"new_subscription": @TRUE,
AFEventParamCouponCode: @"3MonthsSubscription",
@"coupon_code_value": @"10%",
AFEventParamRevenue: @5,
AFEventParamCurrency: @"USD",
@"subscription_method": @"",
@"expiration_date": @"2018/07/18"
}];
AppsFlyerTracker.shared().trackEvent(AFEventSubscribe,
withValues: [
"new_subscription": true,
AFEventParamCouponCode: "3MonthsSubscription",
"coupon_code_value": "10%",
AFEventParamRevenue: 5,
AFEventParamCurrency: "USD",
"subscription_method": "",
"expiration_date": "2018/07/18"
]);
Dictionary<string, string> Subscription = new Dictionary<string, string>();
Subscription.Add("new_subscription", "true");
Subscription.Add("af_coupon_code", "3MonthsSubscription");
Subscription.Add("coupon_code_value", "10%");
Subscription.Add("af_revenue", "5");
Subscription.Add("af_currency", "USD");
Subscription.Add("subscription_method", "");
Subscription.Add("expiration_date", "2018/07/18");
AppsFlyer.trackRichEvent("af_subscribe", Subscription);
Event Name: media_play
Purpose
recording the Media Play event means recording events in which users play media that you offer. Such media can be videos, music, tv shows, radio shows and more. If you offer more than one type of media, you can record the play ratio between the different media and content types. For example, you can see if users play more music than videos. You can also see if users watch more tv shows than movies. Additionally, by recording the media play event, you can:
- Record media consumption by type and content.
- See the languages of the most popular streamed content.
- See minimum, maximum and average duration of the streamed content.
Trigger logic
Trigger this event after a predefined number (i.e 2 minutes) of streamed content.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_content_type | string | tv show, music | The type of content that is streamed |
af_content_id | string | 092, E34 | The id of the content that is streamed |
af_content | string | Title of content | The title of the content i.e. the song name or the title and episode of a tv show |
media_duration | float | 5 | The running time |
language | string | en-us, fr, es | The language of the content |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "tv show");
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "E34");
eventValue.put(AFInAppEventParameterName.CONTENT, "My Show");
eventValue.put("media_duration", 5);
eventValue.put("language", "en-us");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "media_play", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"media_play"
withValues: @{
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerTracker.shared().trackEvent("media_play",
withValues: [
AFEventParamContentType: "tv show",
AFEventParamContentId: "E34",
AFEventParamContent: "My Show",
"media_duration": 5,
"language": "en-us"
]);
Dictionary<string, string> MediaPlay = new Dictionary<string, string>();
MediaPlay.Add("af_content_type", "tv show");
MediaPlay.Add("af_content_id", "E34");
MediaPlay.Add("af_content", "My show");
MediaPlay.Add("media_duration", "5");
MediaPlay.Add("language", "en-us");
AppsFlyer.trackRichEvent("media_play", MediaPlay);
Event Name: minutes_consumed
Purpose
Minutes consumed is how much of a given content item the user consumes. After the revenue metric, this is the most important metric in the streaming industry. This metric is important because it allows you to estimate users' usage of the service. It also allows you to understand what is the overall usage rate of the service, and what content is the most popular. By recording the Minutes Consumed event minutes you can:
- See which users make extensive use of your service and which are not.
- Understand what media types and content types are popular.
Trigger logic
Trigger this event in one of two scenarios:
- When the user finishes streaming a media item.
- When the user quits streaming a media item.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
minutes_consumed | float | 3 | The actual running time of the media by the user |
af_content_type | string | tv show, music | The type of content that is streamed |
af_content_id | string | 092, E34 | The id of the content that is streamed |
af_content | string | Title of content | The title of the content i.e. the song name or the title and episode of a tv show |
media_duration | float | 5 | The running time |
language | string | en-us, fr, es | The language of the content |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "tv show");
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "E34");
eventValue.put(AFInAppEventParameterName.CONTENT, "My Show");
eventValue.put("media_duration", 5);
eventValue.put("language", "en-us");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),"media_minutes", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"media_minutes"
withValues: @{
@"minutes_consumed": @3,
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerTracker.shared().trackEvent("media_minutes", withValues: [
"minutes_consumed": 3,
AFEventParamContentType: "tv show",
AFEventParamContentId: "E34",
AFEventParamContent: "My Show",
"media_duration": 5,
"language": "en-us"
]);
Dictionary<string, string> MediaMinutes =
new Dictionary<string, string>();
MediaMinutes.Add("minutes_consumed", "3");
MediaMinutes.Add("af_content_type", "tv show");
MediaMinutes.Add("af_content_id", "E34");
MediaMinutes.Add("af_content", "My show");
MediaMinutes.Add("media_duration", "5");
MediaMinutes.Add("language", "en-us");
AppsFlyer.trackRichEvent("media_minutes", MediaMinutes);
Event Name: media_downloaded
Purpose
recording downloaded media can help you highlight user preference. You can record media play and media download and compare the two. You can see what media users prefer to stream and what media they prefer to download.
Trigger logic
Trigger this event when a user starts downloading media.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_content_type | string | tv show, music | The type of content |
af_content_id | string | 092, E34 | The id of the content |
af_content | string | Title of content | The title of the content i.e. the song name or the title and episode of a tv show |
media_duration | float | 5 | The running time |
language | string | en-us, fr, es | The language of the content |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "tv show");
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "E34");
eventValue.put(AFInAppEventParameterName.CONTENT, "My Show");
eventValue.put("media_duration", 5);
eventValue.put("language", "en-us");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "media_downloaded", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"media_downloaded"
withValues: @{
@"minutes_consumed": @3,
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerTracker.shared().trackEvent("media_downloaded",
withValues: [
"minutes_consumed": 3,
AFEventParamContentType: "tv show",
AFEventParamContentId: "E34",
AFEventParamContent: "My Show",
"media_duration": 5,
"language": "en-us"
]);
Dictionary<string, string> MediaDownloaded = new Dictionary<string, string>();
MediaDownloaded.Add("minutes_consumed", "3");
MediaDownloaded.Add("af_content_type", "tv show");
MediaDownloaded.Add("af_content_id", "E34");
MediaDownloaded.Add("af_content", "My show");
MediaDownloaded.Add("media_duration", "5");
MediaDownloaded.Add("language", "en-us");
AppsFlyer.trackRichEvent("media_downloaded", MediaDownloaded);
Event Name: media_saved
Purpose
recording saved media can help you highlight user preference.
Trigger logic
Trigger this event whenever media is saved onto the user's device.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_content_type | string | tv show, music | The type of content |
af_content_id | string | 092, E34 | The id of the content |
af_content | string | Title of content | The title of the content i.e. the song name or the title and episode of a tv show |
media_duration | float | 5 | The running time |
language | string | en-us, fr, es | The language of the content |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "tv show");
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "E34");
eventValue.put(AFInAppEventParameterName.CONTENT, "My Show");
eventValue.put("media_duration", 5);
eventValue.put("language", "en-us");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "media_saved", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"media_saved"
withValues: @{
@"minutes_consumed": @3,
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerTracker.shared().trackEvent("media_saved",
withValues: [
"minutes_consumed": 3,
AFEventParamContentType: "tv show",
AFEventParamContentId: "E34",
AFEventParamContent: "My Show",
"media_duration": 5,
"language": "en-us"]);
Dictionary<string, string> MediaSaved = new Dictionary<string, string>();
MediaSaved.Add("minutes_consumed", "3");
MediaSaved.Add("af_content_type", "tv show");
MediaSaved.Add("af_content_id", "E34");
MediaSaved.Add("af_content", "My show");
MediaSaved.Add("media_duration", "5");
MediaSaed.Add("language", "en-us");
AppsFlyer.trackRichEvent("media_saved", MediaSaved);
Fintech - P2P Lending
P2P (peer-to-peer) lending is a new way for individuals and businesses to lend and borrow money from one another.
It is recommended that you record events in your P2P Lending app:
- You can record the activity of individual lenders and borrowers.
- You can learn what type of loans people offer as opposed to what loans borrowers are interested in.
- You can gather metrics about the average, minimum and maximum sum of loans.
- You can record loan acceptance and rejection rates.
With such data gathered from event recording, you can highlight trustworthy borrowers and offer them better interest rates. Similarly, you can see who the most active lenders are and offer them lower fees. In addition, once you know what type of loans are most popular with your users, you can launch marketing campaigns that target such audiences.
Event Name: registration_submitted
Purpose
Since P2P lending is susceptible to abuse, users must verify their identity first. They do so by submitting a registration request. recording the Registration Submitted event can help you:
- Record how many users register but never verify their account.
- See the correlation between registration method (email, Facebook, Google) and verification rates.
Trigger logic
Trigger this event after the user submits a request to register to your P2P service.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | email, Facebook, Google | What type of method or social sign up the user chose |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "registration_submitted", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"registration_submitted"
withValues: @{
AFEventParamRegistrationMethod: @"Facebook",
}];
AppsFlyerTracker.shared().trackEvent("registration_submitted",
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> RegistrationSubmitted = new Dictionary<string, string>();
RegistrationSubmitted.Add("af_registration_method", "Facebook");
AppsFlyer.trackRichEvent("registration_submitted", RegistrationSubmitted);
Event Name: af_complete_registration
Purpose
recording the Complete registration event can help you see how many users actually verify their identity after registering. You can attribute these users to campaigns and see what campaigns generate active users.
Trigger logic
Trigger this event when the user's registration is approved.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | What type of method or social sign up the user chooses |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerTracker.shared().trackEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistration = new Dictionary<string, string>();
CompleteRegistration.Add("af_registration_method", "Facebook");
AppsFlyer.trackRichEvent("af_complete_registration", CompleteRegistration);
Event Name: fill_loan_form_<FORM_NAME>
Purpose
Borrowers need to fill in several forms in order to request a loan. You can record the forms that are filled by a potential borrower in order to see the drop rate. Apart from the drop rate, you can also retarget borrowers who quit one form away from completing their loan application. When you send the event, include the form name in the event name.
Trigger logic
Trigger this event whenever a borrower submits a form.
Recommended attributes
You can send this event without additional attributes.
Note
It is highly recommended that you associate loans with lenders. To do so, make sure to set the customer user id. Setting the customer user id is your way to match lenders with users of your app as they appear in AppsFlyer. By setting the customer user id you make sure that any event is sent with the customer user id.
Code Examples
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "fill_loan_form_FORM_NAME", null);
[[AppsFlyerTracker sharedTracker] trackEvent:@"fill_loan_formFORM_NAME"
withValues: nil];
AppsFlyerTracker.shared().trackEvent("fill_loan_form_FORM_NAME",
withValues: nil);
AppsFlyer.trackRichEvent("fill_loan_form_FORM_NAME", null);
Event Name: submit_loan_application
Purpose
The purpose of this event is to help you record loan applications. By recording the Submit Loan Application event you can:
- Record the overall number of loan applications in your app.
- Learn about the maximum, minimum and average amount in loan applications.
- See the type of loans people apply for.
Trigger logic
Trigger this event when the user successfully submits a loan application.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The id of the loan |
loan_amount | float | 1000 | The amount requested |
loan_type | string | 3 months | The loan period |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("loan_id", "1735102");
eventValue.put("loam_amount", 1000);
eventValue.put("loan_type", "3 months");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),"submit_loan_application", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"submit_loan_application"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @1000,
@"loan_type": @"3 months"
}];
AppsFlyerTracker.shared().trackEvent("submit_loan_applications",
withValues: [
"loan_id": "1735102",
"loan_amount": 1000,
"loan_type": "3 months"
]);
Dictionary<string, string> SubmitLoanApplication = new Dictionary<string, string>();
SubmitLoanApplication.Add("loan_id", "1735102");
SubmitLoanApplication.Add("loan_amount", "1000");
SubmitLoanApplication.Add("loan_type", "3 months");
AppsFlyer.trackRichEvent("submit_loan_application", SubmitLoanApplication);
Event Name: loan_accepted
Purpose
By recording the Loan Accepted event, you can learn about trends in loans and other metrics:
- You can see what type of loans are accepted.
- You can see the amount requested in loans that are accepted.
- You can see what lenders accept the most loans, what types and what amounts.
Trigger logic
Trigger this event when a loan is accepted.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The id of the loan |
loan_amount | float | 1000 | The amount requested |
loan_type | string | 3 months | The loan period |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("loan_id", "1735102");
eventValue.put("loam_amount", 1000);
eventValue.put("loan_type", "3 months");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),"loan_accepted" , eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"loan_accepted"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @1000,
@"loan_type": @"3 months"
}];
AppsFlyerTracker.shared().trackEvent("loan_accepted",
withValues: [
"loan_id": "1735102",
"loan_amount": 1000,
"loan_type": "3 months"
]);
Dictionary<string, string> LoanAccepted = new Dictionary<string, string>();
LoanAccepted.Add("loan_id", "1735102");
LoanAccepted.Add("loan_amount", "1000");
LoanAccepted.Add("loan_type", "3 months");
AppsFlyer.trackRichEvent("loan_accepted", LoanAccepted);
Event Name: loan_rejected
Purpose
recording the Loan Rejected event can help you understand the reasons why loans get rejected. You can see the correlation between the amount and loan period and rejection rates. You can also retarget users whose loan gets rejected and suggest them to take a smaller loan.
Trigger logic
Trigger this event when a lender rejects a loan.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
load_id | string | 1735102 | The id of the loan |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("loan_id", "1735102");
eventValue.put("loam_amount", 1000);
eventValue.put("loan_type", "3 months");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),loan_rejected" , eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"loan_rejected"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @1000,
@"loan_type": @"3 months"
}];
AppsFlyerTracker.shared().trackEvent("loan_rejected", withValues: [
"loan_id": "1735102",
"loan_amount": 1000,
"loan_type": "3 months"
]);
Dictionary<string, string> LoanRejected = new Dictionary<string, string>();
LoanRejected.Add("loan_id", "1735102");
LoanRejected.Add("loan_amount", "1000");
LoanRejected.Add("loan_type", "3 months");
AppsFlyer.trackRichEvent("loan_rejected", LoanRejected);
Event Name: payment
Purpose
recording the Payment event can help you mark borrowers as trustworthy. Trustworthy borrowers are those that follow their obligation to cover their loans. You can attribute borrowers to campaigns and understand which campaigns generated trustworthy borrowers. recording this event can also help you gather data about the minimum, maximum and average amount of payments.
Trigger logic
Trigger this event whenever a user makes a payment for their loan.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The id of the loan |
payment_amount | float | 100 | The amount paid |
payment_id | string | AE12SF | The id of the payment |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("loan_id", "1735102");
eventValue.put("payment_amount", 100);
eventValue.put("payment_id", "AE12SF");
AppsFlyerLib.getInstance().trackEvent(
getApplicationContext(),
"payment" , eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"payment"
withValues: @{
@"loan_id": @"1735102",
@"payment_amount": @100,
@"payment_id": @"AE12SF"
}];
AppsFlyerTracker.shared().trackEvent("payment",
withValues: [
"loan_id": "1735102",
"payment_amount": 100,
"payment_id": "AE12SF"
]);
Dictionary<string, string> Payment = new Dictionary<string, string>();
Payment.Add("loan_id", "1735102");
Payment.Add("payment_amount", "100");
Payment.Add("payment_id", "AE12SF");
AppsFlyer.trackRichEvent("payment", Payment);
Event Name: payment_completed
Purpose
recording the Payment Completed event can help you highlight borrowers who follow their obligation to cover a loan. You can also re-target such borrowers and offer them lower interest fee or other promotions.
Trigger logic
Trigger this event when a loan is fully paid back.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The id of the loan |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("loan_id", "1735102");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),"payment_completed" , eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"payment_completed"
withValues: @{
@"loan_id": @"1735102"
}];
AppsFlyerTracker.shared().trackEvent("payment_completed",
withValues: [
"loan_id": "1735102"
]);
Dictionary<string, string> PaymentCompleted = new Dictionary<string, string>();
PaymentCompleted.Add("loan_id", "1735102");
AppsFlyer.trackRichEvent("payment_completed", PaymentCompleted);
Navigation - Ride Hailing Apps
Ride-hailing has become very popular recently, especially in urban areas where most residents don't own a car. By recording and analyzing in-app events you can learn a lot about:
- How passengers and drivers interact.
- Countries where more people use your ride-hailing service.
- Metrics about price, rides and ride distance.
Complete registration
Event Name: af_complete_registration
Purpose
recording the Complete registration event can give you insights about your users. By recording the Complete registration event you can record :
- Learn what sign up method your users prefer (Google, Facebook, Email).
- Understand how many users actually sign up after downloading and installing the app.
- See registration trends across countries to determine the countries whose users are most likely to use your app.
Trigger logic
Trigger this event when the user successfully signs up.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | The platform or method through which the user signs up | |
country_code | string | 66 | The country's code (phone code) |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "shoes");
eventValue.put("country_code", "66");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook",
@"country_code": @"66",
}];
AppsFlyerTracker.shared().trackEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook",
"country_code": "66"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
CompleteRegistrationEvent.Add("country_code", "66");
AppsFlyer.trackRichEvent("af_complete_registration", CompleteRegistrationEvent);
Add payment info
Event Name: af_add_payment_info
Purpose
recording the Add payment info event can help you categorize users. You can:
- Learn how long it takes a user to add their payment info.
- What payment methods are most popular (credit card, e-Wallets).
- Setup campaigns and collaboration with popular payment method providers.
Trigger logic
Trigger this event when the user successfully adds payment info in their account.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_success | boolean | true | If adding payment method is successfull or not |
credit_card_type | string | Visa, Mastercard | Credit card type (optional) |
payment_method_type | string | credit card, e-wallet | The type of payment method |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.SUCCESS, true);
eventValue.put("credit_card_type", "Visa");
eventValue.put("payment_method_type", true);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.ADD_PAYMENT_INFO, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventAddPaymentInfo
withValues: @{
AFEventParamSuccess: @TRUE,
@"credit_card_type": @"Visa",
@"payment_method_type": @"credit card"
}];
AppsFlyerTracker.shared().trackEvent(AFEventAddPaymentInfo, withValues: [
AFEventParamSuccess: true,
"credit_card_type": "Visa",
"payment_method_type": "credit card"
]);
Dictionary<string, string> AddPaymentInfoEvent = new Dictionary<string, string>();
AddPaymentInfoEvent.Add("af_success", "true");
AddPaymentInfoEvent.Add("credit_card_type", "Visa");
AddPaymentInfoEvent.Add("payment_method_type", "credit card");
AppsFlyer.trackRichEvent("af_add_payment_info", AddPaymentInfoEvent);
Ride booking requested
Event Name: ride_booking_requested
Purpose
The Ride booking requested event is one out of four other ride-booking related events. These are discussed below. By recording this event you can:
- Learn about popular destinations.
- Learn about trends, where people ride to and from where.
- See the average distance of a ride.
- See what cities, regions, and countries most users come from.
In addition, recording this event alongside the other three booking related events can help you record successful transactions. You can record successful transactions and compare them with unsuccessful transactions. For example, you can see how many ride bookings are requested and how many ride bookings are completed or canceled.
Trigger logic
Trigger this event when the passenger created a ride booking request.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 22.4 | Quoted price for the ride |
af_currency | string | SGD | Currency |
af_destination_a | string | Plaza Singapura | Point of departure |
af_destination_b | string | Marina Bay Sands | Point of arrival |
distance | float | 5.2 | The distance between the two destinations |
af_content_type | string | Taxi | Type of transportation |
payment_method_type | string | credit card, e-wallet | The type of payment method |
af_city | string | Singapore | The city where the ride is booked |
af_region | string | SFA | The region where the ride is booked |
af_country | string | Singapore | The country where the ride is booked |
order_id | string | 135790 | Order ID |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 22.4);
eventValue.put(AFInAppEventParameterName.CURRENCY, "SGD");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "Plaza Singapura");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Marina Bay Sands");
eventValue.put("distance", 5.2);
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "Taxi");
eventValue.put("payment_method_type", "credit card");
eventValue.put("notes", "Taxi stand");
eventValue.put(AFInAppEventParameterName.CITY, "Singapore");
eventValue.put(AFInAppEventParameterName.REGION, "SFA");
eventValue.put(AFInAppEventParameterName.COUNTRY, "Singapore");
eventValue.put("af_order_id", "135790");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "ride_booking_requested", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"ride_booking_requested"
withValues: @{
AFEventParamPrice: @22.4,
AFEventParamCurrency: @"SGD",
AFEventParamDestinationA: @"Plaza Singapura",
AFEventParamDestinationB: @"Marina Bay Sands",
@"distance": @5.2,
AFEventParamContentType: @"Taxi",
@"payment_method_type": @"credit card",
@"notes": @"Taxi stand",
AFEventParamCity: @"Singapore",
AFEventParamRegion: @"SFA",
AFEventParamCountry: @"Singapore",
AFEventParamOrderId: @"135790"
}];
AppsFlyerTracker.shared().trackEvent("ride_booking_requested",
withValues: [
AFEventParamPrice: 22.4,
AFEventParamCurrency: "SGD",
AFEventParamDestinationA: "Plaza Singapura",
AFEventParamDestinationB: "Marina Bay Sands",
"distance": 5.2,
AFEventParamContentType: "Taxi",
"payment_method_type": "credit card",
"notes": "Taxi stand",
AFEventParamCity: "Singapore",
AFEventParamRegion: "SFA",
AFEventParamCountry: "Singapore",
AFEventParamOrderId: "135790"
]);
Dictionary<string, string> RideBookingRequestedEvent = new Dictionary<string, string>();
RideBookingRequestedEvent.Add("af_price", "22.4");
RideBookingRequestedEvent.Add("af_currency", "SGD");
RideBookingRequestedEvent.Add("af_destination_a", "Plaza Singapura");
RideBookingRequestedEvent.Add("af_destination_b", "Marina Bay Sands");
RideBookingRequestedEvent.Add("distance", "5.2");
RideBookingRequestedEvent.Add("af_content_type", "Taxi");
RideBookingRequestedEvent.Add("payment_method_type", "credit card");
RideBookingRequestedEvent.Add("notes", "Taxi stand");
RideBookingRequestedEvent.Add("af_city", "Singapore");
RideBookingRequestedEvent.Add("af_region", "SFA");
RideBookingRequestedEvent.Add("af_country", "Singapore");
RideBookingRequestedEvent.Add("af_order_id", "135790");
AppsFlyer.trackRichEvent("ride_booking_requested", RideBookingRequestedEvent);
Ride Booking Confirmed
Event Name: ride_booking_confirmed
Purpose
The Ride Booking Confirmed event is one out of four other ride-booking related events. By recording this event you can:
- Learn who the most active drivers are.
- See what destinations are common among drivers.
- See the average and overall ride prices for each driver.
In addition, recording this event alongside the other three booking related events can help you better understand driver activity. You can see which drivers confirm the most ride booking requests, which drivers choose short rides as opposed to long rides etc.
Trigger logic
Trigger this event when the booking is accepted by a driver.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 22.4 | Quoted price for the ride |
af_currency | string | SGD | Currency |
af_destination_a | string | Plaza Singapura | Point of departure |
af_destination_b | string | Marina Bay Sands | Point of arrival |
distance | float | 5.2 | The distance between the two destinations |
af_content_type | string | Taxi | Type of transportation |
driver_id | string | 1706 | The id of the driver who confirmed doing the ride |
payment_method_type | string | credit card, e-wallet | The type of payment method |
af_city | string | Singapore | The city where the ride is booked |
af_region | string | SFA | The region where the ride is booked |
af_country | string | Singapore | The country where the ride is booked |
af_order_id | string | 135790 | Order ID |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 22.4);
eventValue.put(AFInAppEventParameterName.CURRENCY, "SGD");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "Plaza Singapura");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Marina Bay Sands");
eventValue.put("distance", 5.2);
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "Taxi");
eventValue.put("driver_id", "1706");
eventValue.put("payment_method_type", "credit card");
eventValue.put("notes", "Taxi stand");
eventValue.put(AFInAppEventParameterName.CITY, "Singapore");
eventValue.put(AFInAppEventParameterName.REGION, "SFA");
eventValue.put(AFInAppEventParameterName.COUNTRY, "Singapore");
eventValue.put("af_order_id", "135790");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "ride_booking_confirmed", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"ride_booking_confirmed"
withValues: @{
AFEventParamPrice: @22.4,
AFEventParamCurrency: @"SGD",
AFEventParamDestinationA: @"Plaza Singapura",
AFEventParamDestinationB: @"Marina Bay Sands",
@"distance": @5.2,
AFEventParamContentType: @"Taxi",
@"driver_id": @"1706",
@"payment_method_type": @"credit card",
@"notes": @"Taxi stand",
AFEventParamCity: @"Singapore",
AFEventParamRegion: @"SFA",
AFEventParamCountry: @"Singapore",
AFEventParamOrderId: @"135790"
}];
AppsFlyerTracker.shared().trackEvent("ride_booking_confirmed",
withValues: [
AFEventParamPrice: 22.4,
AFEventParamCurrency: "SGD",
AFEventParamDestinationA: "Plaza Singapura",
AFEventParamDestinationB: "Marina Bay Sands",
"distance": 5.2,
AFEventParamContentType: "Taxi",
"driver_id": "1706",
"payment_method_type": "credit card",
"notes": "Taxi stand",
AFEventParamCity: "Singapore",
AFEventParamRegion: "SFA",
AFEventParamCountry: "Singapore",
AFEventParamOrderId: "135790"
]);
Dictionary<string, string> RideBookingConfirmedEvent = new Dictionary<string, string>();
RideBookingConfirmedEvent.Add("af_price", "22.4");
RideBookingConfirmedEvent.Add("af_currency", "SGD");
RideBookingConfirmedEvent.Add("af_destination_a", "Plaza Singapura");
RideBookingConfirmedEvent.Add("af_destination_b", "Marina Bay Sands");
RideBookingConfirmedEvent.Add("distance", "5.2");
RideBookingConfirmedEvent.Add("af_content_type", "Taxi");
RideBookingConfirmedEvent.Add("driver_id", "1706");
RideBookingConfirmedEvent.Add("payment_method_type", "credit card");
RideBookingConfirmedEvent.Add("notes", "Taxi stand");
RideBookingConfirmedEvent.Add("af_city", "Singapore");
RideBookingConfirmedEvent.Add("af_region", "SFA");
RideBookingConfirmedEvent.Add("af_country", "Singapore");
RideBookingConfirmedEvent.Add("af_order_id", "135790");
AppsFlyer.trackRichEvent("ride_booking_confirmed", RideBookingConfirmedEvent);
Ride booking cancelled
Event Name: ride_booking_cancelled
Purpose
The Ride booking cancelled event is one out of four other ride-booking related events. By recording this event you can:
- Log drivers or passengers that constantly cancel.
- Learn how many rides are canceled.
- Correlate cancellation rate with attributes such as price, destination, distance, cities etc.
- Learn the reasons why a ride is canceled.
Trigger logic
Trigger this event when the booking is canceled.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 22.4 | Quoted price for the ride |
af_currency | string | SGD | Currency |
af_destination_a | string | Plaza Singapura | Point of departure |
af_destination_b | string | Marina Bay Sands | Point of arrival |
distance | float | 5.2 | The distance between the two destinations |
af_content_type | string | Taxi | Type of transportation |
driver_id | string | 1706 | The id of the driver who confirmed doing the ride |
cancelation_reason | string | price is too high, driver didn't show up, passenger didn't show up | The reason the ride is canceled |
payment_method_type | string | credit card, e-wallet | The type of payment method |
af_city | string | Singapore | The city where the ride is booked |
af_region | string | SFA | The region where the ride is booked |
af_country | string | Singapore | The country where the ride is booked |
order_id | string | 135790 | Order ID |
canceled_by | string | Passenger | Whether the ride is canceled by the passenger or driver |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 22.4);
eventValue.put(AFInAppEventParameterName.CURRENCY, "SGD");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "Plaza Singapura");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Marina Bay Sands");
eventValue.put("distance", 5.2);
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "Taxi");
eventValue.put("driver_id", "1706");
eventValue.put("cancellation_reason", "driver didn't show up");
eventValue.put("payment_method_type", "credit card");
eventValue.put("notes", "Taxi stand");
eventValue.put(AFInAppEventParameterName.CITY, "Singapore");
eventValue.put(AFInAppEventParameterName.REGION, "SFA");
eventValue.put(AFInAppEventParameterName.COUNTRY, "Singapore");
eventValue.put("af_order_id", "135790");
eventValue.put("canceled_by", "passenger");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "ride_booking_canceled", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"ride_booking_canceled"
withValues: @{
AFEventParamPrice: @22.4,
AFEventParamCurrency: @"SGD",
AFEventParamDestinationA: @"Plaza Singapura",
AFEventParamDestinationB: @"Marina Bay Sands",
@"distance": @5.2,
AFEventParamContentType: @"Taxi",
@"driver_id": @"1706",
@"cancelation_reason": @"driver didn't show up",
@"payment_method_type": @"credit card",
@"notes": @"Taxi stand",
AFEventParamCity: @"Singapore",
AFEventParamRegion: @"SFA",
AFEventParamCountry: @"Singapore",
AFEventParamOrderId: @"135790",
@"canceled_by": @"passenger"
}];
AppsFlyerTracker.shared().trackEvent("ride_booking_canceled",
withValues: [
AFEventParamPrice: 22.4,
AFEventParamCurrency: "SGD",
AFEventParamDestinationA: "Plaza Singapura",
AFEventParamDestinationB: "Marina Bay Sands",
"distance": 5.2,
AFEventParamContentType: "Taxi",
"driver_id": "1706",
"cancelation_reason": "driver didn't show up",
"payment_method_type": "credit card",
"notes": "Taxi stand",
AFEventParamCity: "Singapore",
AFEventParamRegion: "SFA",
AFEventParamCountry: "Singapore",
AFEventParamOrderId: "135790",
"canceled_by": "passenger"
]);
Dictionary<string, string> RideBookingCanceledEvent = new Dictionary<string, string>();
RideBookingCanceledEvent.Add("af_price", "22.4");
RideBookingCanceledEvent.Add("af_currency", "SGD");
RideBookingCanceledEvent.Add("af_destination_a", "Plaza Singapura");
RideBookingCanceledEvent.Add("af_destination_b", "Marina Bay Sands");
RideBookingCanceledEvent.Add("distance", "5.2");
RideBookingCanceledEvent.Add("af_content_type", "Taxi");
RideBookingCanceledEvent.Add("driver_id", "1706");
RideBookingCanceledEvent.Add("cancelation_reason", "driver didn't show up");
RideBookingCanceledEvent.Add("payment_method_type", "credit card");
RideBookingCanceledEvent.Add("notes", "Taxi stand");
RideBookingCanceledEvent.Add("af_city", "Singapore");
RideBookingCanceledEvent.Add("af_region", "SFA");
RideBookingCanceledEvent.Add("af_country", "Singapore");
RideBookingCanceledEvent.Add("af_order_id", "135790");
RideBookingCanceledEvent.Add("canceled_by", "passenger");
AppsFlyer.trackRichEvent("ride_booking_cancelled", RideBookingCanceledEvent);
Ride booking completed
Event Name: ride_booking_completed
Purpose
The Ride booking completed event is one out of four other ride-booking related events. By recording this event you can:
- Learn about passenger spending and driver earnings.
- Correlate completed rides with attributes such as destination, distance, payment type, driver ID etc.
- See the average and overall distance for drivers and passengers.
- Compare completed rides with canceled ones.
- Log and record the score of drivers.
Trigger logic
Trigger this event when the journey is complete.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 22.4 | Quoted price for the ride |
af_currency | string | SGD | Currency |
af_destination_a | string | Plaza Singapura | Point of departure |
af_destination_b | string | Marina Bay Sands | Point of arrival |
distance | float | 5.2 | The distance between the two destinations |
af_content_type | string | Taxi | Type of transportation |
driver_id | string | 1706 | The id of the driver who confirmed doing the ride |
payment_method_type | string | credit card, e-wallet | The type of payment method |
af_city | string | Singapore | The city where the ride is booked |
af_region | string | SFA | The region where the ride is booked |
af_country | string | Singapore | The country where the ride is booked |
order_id | string | 135790 | Order ID |
credits_earned | int | 248 | The credits that the passenger earned for completing a ride |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 22.4);
eventValue.put(AFInAppEventParameterName.CURRENCY, "SGD");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "Plaza Singapura");
eventValue.put(AFInAppEventParameterName.DESTINATION_B,"Marina Bay Sands");
eventValue.put("distance", 5.2);
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "Taxi");
eventValue.put("driver_id", "1706");
eventValue.put("payment_method_type", "credit card");
eventValue.put("notes", "Taxi stand");
eventValue.put(AFInAppEventParameterName.CITY, "Singapore");
eventValue.put(AFInAppEventParameterName.REGION, "SFA");
eventValue.put(AFInAppEventParameterName.COUNTRY, "Singapore");
eventValue.put("af_order_id", "135790");
eventValue.put("credits_earned", 248);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "ride_booking_completed" , eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"ride_booking_completed"
withValues: @{
AFEventParamPrice: @22.4,
AFEventParamCurrency: @"SGD",
AFEventParamDestinationA: @"Plaza Singapura",
AFEventParamDestinationB: @"Marina Bay Sands",
@"distance": @5.2,
AFEventParamContentType: @"Taxi",
@"driver_id": @"1706",
@"payment_method_type": @"credit card",
@"notes": @"Taxi stand",
AFEventParamCity: @"Singapore",
AFEventParamRegion: @"SFA",
AFEventParamCountry: @"Singapore",
AFEventParamOrderId: @"135790",
@"credits_earned": @248
}];
AppsFlyerTracker.shared().trackEvent("ride_booking_completed",
withValues: [
AFEventParamPrice: 22.4,
AFEventParamCurrency: "SGD",
AFEventParamDestinationA: "Plaza Singapura",
AFEventParamDestinationB: "Marina Bay Sands",
distance": 5.2,
AFEventParamContentType: "Taxi",
"driver_id": "1706",
"payment_method_type": "credit card",
"notes": "Taxi stand",
AFEventParamCity: "Singapore",
AFEventParamRegion: "SFA",
AFEventParamCountry: "Singapore",
AFEventParamOrderId: "135790",
"credits_earned": 248
]);
Dictionary<string, string> RideBookingCompletedEvent = new Dictionary<string, string>();
RideBookingCompletedEvent.Add("af_price", "22.4");
RideBookingCompletedEvent.Add("af_currency", "SGD");
RideBookingCompletedEvent.Add("af_destination_a", "Plaza Singapura");
RideBookingCompletedEvent.Add("af_destination_b", "Marina Bay Sands");
RideBookingCompletedEvent.Add("distance", "5.2");
RideBookingCompletedEvent.Add("af_content_type", "Taxi");
RideBookingCompletedEvent.Add("driver_id", "1706");
RideBookingCompletedEvent.Add("payment_method_type", "credit card");
RideBookingCompletedEvent.Add("notes", "Taxi stand");
RideBookingCompletedEvent.Add("af_city", "Singapore");
RideBookingCompletedEvent.Add("af_region", "SFA");
RideBookingCompletedEvent.Add("af_country", "Singapore");
RideBookingCompletedEvent.Add("af_order_id", "135790");
AppsFlyer.trackRichEvent("ride_booking_completed", RideBookingCompletedEvent);
Spent Credits
Event Name: spent_credits
Purpose
The Ride booking completed event discussed above has an attribute called credits_earned. This attribute logs the credits that the passenger earns for each ride. The passenger can then trade these credits for vouchers and discounts. By recording these events you can:
- See how many passenger trade credits for vouchers.
- See what sort of vouchers and discounts passengers prefer.
Trigger logic
Trigger this event when a passenger spends credits.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_content | string | Single Movie Ticket | The type of voucher or discount |
credits_used | int | 1000 | How many credits used |
credits_remaining | int | 2090 | How many credits left in the account |
invoice_id | string | KO215123SD | The invoice ID of the invoice that is created for spending credits |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT, "Single movie ticket");
eventValue.put("credits_used", 1000);
eventValue.put("invoice_id", "");
eventValue.put("credits_remaining", "KO215123SD");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "spent_credits" , eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"spent_credits"
withValues: @{
AFEventParamContent: @"Single movie ticket",
@"credits_used": @1000,
@"credits_remaining": @2090,
@"invoice_id": @"KO215123SD"
}];
AppsFlyerTracker.shared().trackEvent("spent_credits",
withValues: [
AFEventParamContent: "Single movie ticket",
"credits_used": 1000,
"credits_remaining": 2090,
"invoice_id": "KO215123SD"
]);
Dictionary<string, string> CreditsSpent = new Dictionary<string, string>();
CreditsSpent.Add("af_content", "Single movie ticket");
CreditsSpent.Add("credits_used", "1000");
CreditsSpent.Add("credits_remaining", "2090");
CreditsSpent.Add("invoice_id", "KO215123SD");
AppsFlyer.trackRichEvent("af_content_view", CreditsSpent);
Travel - Flight Booking
Flight Booking apps allow travelers to easily book flights while choosing from the best offers. The events that we recommend recording are booking a flight, searching for flights, and viewing offers. recording these events helps analyze user preferences and purchases. For example, by analyzing the data coming from events you can:
- Learn about popular destinations.
- Analyze seasonal trends.
- Learn about popular airlines that users prefer to travel with.
Travel booking
Event Name: af_travel_booking
Purpose
The ability to book flights is the core function of the app. By recording this event with all its attributes, you can gain insights into:
- Popular destinations.
- Popular airlines.
- Seasonal trends.
Trigger logic
Send this event when the user lands in the thank you page after successfully booking a flight.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 647 | Revenue associated with booking |
af_currency | string | SGD | The currency code |
af_price | float | 674 | The price |
af_content_id | string | ODIRNH | The ID of the flight offer |
af_departing_departure_date | string | 2018-06-21 | Departure date |
af_returning_departure_date | string | 2018-06-26 | Return date |
af_destination_a | string | BKK | First destination |
af_destination_b | string | SYD | Second destination (if applicable) |
airline_code | string | KLM | The code of the airline company |
af_class | string | economy | The class the flight is booked to |
purchase_method | string | credit card | Credit card, PayPal, etc. |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REVENUE, 647);
eventValue.put(AFInAppEventParameterName.CURRENCY, "SGD");
eventValue.put(AFInAppEventParameterName.PRICE, 674);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "ODIRNH");
eventValue.put(AFInAppEventParameterName.DEPARTING_DEPARTURE_DATE, "2018-06-21");
eventValue.put(AFInAppEventParameterName.RETURNING_DEPARTURE_DATE, "2018-06-26");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "BKK");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "SYD");
eventValue.put("airline_code", "KLM");
eventValue.put(AFInAppEventParameterName.CLASS, "economy");
eventValue.put("purchase_method", "credit card");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.TRAVEL_BOOKING, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventTravelBooking
withValues: @{
AFEventParamRevenue: @647,
AFEventParamCurrency: @"SGD",
AFEventParamPrice: @674,
AFEventParamContentId: @"ODIRNH",
AFEventParamDepartingDepartureDate: @"2018-21-06",
AFEventParamReturningDepartureDate: @"2018-26-06",
AFEventParamDestinationA: @"BKK",
AFEventParamDestinationB: @"SYD",
@"airline_code": @"KLM",
AFEventParamClass: @"economy",
@"purchase_method": @"credit card"
}];
AppsFlyerTracker.shared().trackEvent(AFEventTravelBooking,
withValues: [
AFEventParamRevenue: 647,
AFEventParamCurrency: "SGD",
AFEventParamPrice: 674,
AFEventParamContentId: "ODIRNH",
AFEventParamDepartingDepartureDate: "2018-21-06",
AFEventParamReturningDepartureDate: "2018-26-06",
AFEventParamDestinationA: "BKK",
AFEventParamDestinationB: "SYD",
"airline_code": "KLM",
AFEventParamClass: "economy",
"purchase_method": "credit card"
]);
Dictionary<string, string> TravelBookingEvent = new Dictionary<string, string>();
TravelBookingEvent.Add("af_revenue", "647");
TravelBookingEvent.Add("af_currency", "SGD");
TravelBookingEvent.Add("af_price", "974");
TravelBookingEvent.Add("af_content_id", "ODIRNH");
TravelBookingEvent.Add("af_departing_departure_date", "2018-06-21");
TravelBookingEvent.Add("af_returning_departure_date", "2018-06-26");
TravelBookingEvent.Add("af_destination_a", "BKK");
TravelBookingEvent.Add("af_destination_b", "SYD");
TravelBookingEvent.Add("airline_code", "KLM");
TravelBookingEvent.Add("af_class", "economy");
TravelBookingEvent.Add("purchase_method", "credit card");
AppsFlyer.trackRichEvent ("af_travel_booking", TravelBookingEvent);
Content view
Event Name: af_content_view
Purpose
After performing a search, users click on search results that they find relevant. recording the content that the users view in search results can help you:
- Understand what flight offers users find most appealing.
- Understand if search results are relevant to search queries.
Trigger logic
It is best to trigger this event when a user clicks a search result.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_departing_departure_date | string | 2018-06-21 | Departure date |
af_returning_departure_date | string | 2018-06-26 | Return date |
af_destination_a | string | BKK | First destination |
af_destination_b | string | SYD | second destination (if applicable) |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.DEPARTING_DEPARTURE_DATE, "2018-06-21");
eventValue.put(AFInAppEventParameterName.RETURNING_DEPARTURE_DATE, "2018-06-26");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "BKK");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "SYD");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventContentView
withValues: @{
AFEventParamDepartingDepartureDate: @"2018-21-06",
AFEventParamReturningDepartureDate: @"2018-26-06",
AFEventParamDestinationA: @"BKK",
AFEventParamDestinationB: @"SYD"
}];
AppsFlyerTracker.shared().trackEvent(AFEventContentView, withValues: [
AFEventParamDepartingDepartureDate: "2018-21-06",
AFEventParamReturningDepartureDate: "2018-26-06",
AFEventParamDestinationA: "BKK",
AFEventParamDestinationA: "SYD"
]);
Dictionary<string, string> ContentViewEvent = new Dictionary<string, string>();
ContentViewEvent.Add("af_departing_departure_date", "2018-06-21");
ContentViewEvent.Add("af_returning_departure_date", "2018-06-26");
ContentViewEvent.Add("af_destination_a", "BKK");
ContentViewEvent.Add("af_destination_b", "SYD");
AppsFlyer.trackRichEvent ("af_content_view", ContentViewEvent);
Search
Event Name: af_search
Purpose
flight booking apps let users search for flights and deals. One way of gaining insights into user preferences is to record the search parameters. By recording the search event and its attributes, you can:
- Learn what users are mostly looking for.
- Understand which destinations are most popular.
- See how many users travel with kids.
- See what time of the year users prefer or plan to travel.
Trigger logic
Trigger this event when the user clicks on the search button, after filling in the search form.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_num_children | int | 0 | How many children will be travelling |
af_destination_a | string | BKK | First destination |
af_destination_b | string | SYD | Second destination (if relevant) |
af_departing_departure_date | string | 2018-06-21 | Departure date |
af_returning_departure_date | string | 2018-06-26 | Return date |
af_num_infants | int | 0 | How many infants will be traveling |
af_num_adults | int | 1 | How many adults will be traveling |
Code Examples
Map<String, Object> eventValue = new HashMap<String,
eventValue.put(AFInAppEventParameterName.NUM_CHILDREN, 0);
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "BKK");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "SYD");
eventValue.put(AFInAppEventParameterName.DEPARTING_DEPARTURE_DATE, "2018-06-21");
eventValue.put(AFInAppEventParameterName.RETURNING_DEPARTURE_DATE, "2018-06-26");
eventValue.put(AFInAppEventParameterName.NUM_INFANTS, 0);
eventValue.put(AFInAppEventParameterName.NUM_ADULTS, 1);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.SEARCH, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventSearch
withValues: @{
AFEventParamNumChildren: @0,
AFEventParamDestinationA: @"BKK",
AFEventParamDestinationB: @"SYD",
AFEventParamDepartingDepartureDate: @"2018-21-06",
AFEventParamReturningDepartureDate: @"2018-26-06",
AFEventParamNumInfants: @0,
AFEventParamNumAdults: @1
}];
AppsFlyerTracker.shared().trackEvent(AFEventSearch, withValues: [
AFEventParamNumChildren: 0,
AFEventParamDestinationA: "BKK",
AFEventParamDestinationB: "SYD",
AFEventParamDepartingDepartureDate: "2018-21-06",
AFEventParamReturningDepartureDate: "2018-26-06",
AFEventParamNumInfants: 0,
AFEventParamNumAdults: 1
]);
Dictionary<string, string> SearchEvent = new Dictionary<string, string>();
SearchEvent.Add("af_num_children", "0");
SearchEvent.Add("af_destination_a", "BKK");
SearchEvent.Add("af_destination_b", "SYD");
SearchEvent.Add("af_departing_departure_date", "2018-06-21");
SearchEvent.Add("af_returning_departure_date", "2018-06-26");
SearchEvent.Add("af_num_infants", "0");
SearchEvent.Add("af_num_adults", "0");
AppsFlyer.trackRichEvent ("af_search", SearchEvent);
Add payment info
Event Name: af_add_payment_info
Purpose
This event can help you record successful and unsuccessful attempts at adding payment info when booking a flight.
Trigger logic
Trigger this event when a user clicks on the book a flight button.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_success | boolean | true | Whether adding payment method is successful or not |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.SUCCESS, true);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.ADD_PAYMENT_INFO, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventAddPaymentInfo
withValues: @{
AFEventParamSuccess: @TRUE
}];
AppsFlyerTracker.shared().trackEvent(AFEventAddPaymentInfo,
withValues: [
AFEventParamSuccess: true
]);
Dictionary<string, string> AddPaymentInfoEvent = new Dictionary<string, string>();
AddPaymentInfoEvent.Add("af_success", "true");
AppsFlyer.trackRichEvent ("af_add_payment_info", AddPaymentInfoEvent);
Travel - Hotel Booking
By recording in-app events in your hotel booking app, you can see what campaigns and media sources bring users that actually book vacations. In addition, you can see which campaigns and media source bring the users that book the most and generate more revenue. You can attribute preferences such as hotel score, season, country and number of kids to users that come from certain media sources. In attributing user preferences to media sources, you are able to optimize campaigns in media sources by targeting user preferences.
Event Name: af_complete_registration
Purpose
You can record user registration and compare it with other data to learn more about your users. By recording user registration events you can:
- Learn how many users installed the app but never signed up.
- Learn what signup methods your users prefer.
- See what media sources bring users that actually signup.
Trigger logic
The best way to record this event is to trigger it when the user completes the signup process.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_registration_method | string | email, facebook | The type of signup method |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerTracker.shared().trackEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompletedRegistrationEvent = new Dictionary<string, string>();
CompletedRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.trackRichEvent ("af_complete_registration", CompletedRegistrationEvent);
Event Name: af_login
Purpose
This event can help you record the retention of your registered users.
Trigger logic
Trigger this event whenever the user logs in or opens the app.
Recommended attributes
This event can be sent without any additional attributes.
Code Examples
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(),
AFInAppEventType.LOGIN, null);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventLogin
withValues: nil
];
AppsFlyerTracker.shared().trackEvent(AFEventLogin, withValues: nil);
AppsFlyer.trackRichEvent ("af_login", null);
Event Name: af_search
Purpose
The purpose of this event is to let you know what users are searching for. When you know what users are searching for, you can offer them better deals and promotions. In addition, you can see what users of certain geographical locations are searching for and target them accordingly across media sources.
Trigger logic
Trigger this event when the user performs a search.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_date_a | string | 2018/07/26 | Check-in date |
af_date_b | string | 2018/08/01 | Check-out date |
af_destination_a | string | London | User's location |
af_destination_b | string | Madrid | Location of hotel |
af_num_adults | float | 2 | Number of guests |
af_num_children | float | 0 | Number of children |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.DATE_A, "2018/07/26");
eventValue.put(AFInAppEventParameterName.DATE_B, "2018/08/01");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "London");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Madrid");
eventValue.put(AFInAppEventParameterName.NUM_ADULTS, 2);
eventValue.put(AFInAppEventParameterName.NUM_CHILDREN, 0);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.SEARCH, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventSearch
withValues: @{
AFEventParamDateA: @"2018/07/26",
AFEventParamDateB: @"2018/08/01",
AFEventParamDestinationA: @"London",
AFEventParamDestinationB: @"Madrid",
AFEventParamNumAdults: @2,
AFEventParamNumChildren: @0
}];
AppsFlyerTracker.shared().trackEvent(AFEventSearch, withValues: [
AFEventParamDateA: "2018/07/26",
AFEventParamDateB: "2018/08/01",
AFEventParamDestinationA: "London",
AFEventParamDestinationB: "Madrid",
AFEventParamNumAdults: 2,
AFEventParamNumChildren: 0
]);
Dictionary<string, string> Search =
new Dictionary<string, string>();
Search.Add("af_date_a", "2018/07/26");
Search.Add("af_date_b", "2018/08/01");
Search.Add("af_destination_a", "London");
Search.Add("af_destination_b", "Madrid");
Search.Add("af_num_adults", "2");
Search.Add("af_num_children", "0");
AppsFlyer.trackRichEvent("af_add_to_wish_list", Search);
Event Name: af_content_view
Purpose
The purpose of this event is to show you what hotels users are viewing. You can see what property type users are looking for and what their preferences are in terms of season and location. You can then retarget these users in ads and promotions. Moreover, you can see which users view and then book as opposed to users who just view. For those who actually book, you can see which media sources bring them. For those who just view, you can retarget them.
Trigger logic
Trigger this event when the user is viewing a property.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 674 | List price of the hotel |
af_content_id | string | ODIRNH | The id of the hotel |
af_date_a | string | 2018/07/26 | Check-in date |
af_date_b | string | 2018/08/01 | Check-out date |
af_destination_a | string | London | User's location |
af_destination_b | string | Madrid | Location of hotel |
af_class | string | Deluxe | Room type |
af_num_adults | float | 2 | Number of guests |
af_num_children | float | 0 | Number of children |
af_hotel_score | float | 9.6 | Hotel score by reviews |
af_preferred_star_ratings | float | 5 | Preferred hotel star rating |
af_preferred_neighborhoods | string | Centro | The area whee the hotel is located |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CURRENCY, "GBP");
eventValue.put(AFInAppEventParameterName.PRICE, 674);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "ODIRNH");
eventValue.put(AFInAppEventParameterName.DATE_A, "2018/07/26");
eventValue.put(AFInAppEventParameterName.DATE_B, "2018/08/01");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "London");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Madrid");
eventValue.put(AFInAppEventParameterName.CLASS, "Deluxe");
eventValue.put(AFInAppEventParameterName.NUM_ADULTS, 2);
eventValue.put(AFInAppEventParameterName.NUM_CHILDREN, 0);
eventValue.put(AFInAppEventParameterName.HOTEL_SCORE, 9.6);
eventValue.put(AFInAppEventParameterName.PREFERRED_STAR_RATINGS, 5);
eventValue.put(AFInAppEventParameterName.PREFERRED_NEIGHBORHOODS, "Centro");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventContentView
withValues: @{
AFEventParamCurrency: @"GBP",
AFEventParamPrice: @674,
AFEventParamContentId: @"ODIRNH",
AFEventParamDateA: @"2018/07/26",
AFEventParamDateB: @"2018/08/01",
AFEventParamDestinationA: @"London",
AFEventParamDestinationB: @"Madrid",
AFEventParamClass: @"Deluxe",
AFEventParamNumAdults: @2,
AFEventParamNumChildren: @0,
AFEventParamHotelScore: @9.6,
AFEventParamPreferredStarRatings: @5,
AFEventParamPreferredNeighborhoods: @"Centro"
}];
AppsFlyerTracker.shared().trackEvent(AFEventContentView, withValues: [
AFEventParamCurrency: "GBP",
AFEventParamPrice: 674,
AFEventParamContentId: "ODIRNH",
AFEventParamDateA: "2018/07/26",
AFEventParamDateB: "2018/08/01",
AFEventParamDestinationA: "London",
AFEventParamDestinationB: "Madrid",
AFEventParamClass: "Deluxe",
AFEventParamNumAdults: 2,
AFEventParamNumChildren: 0,
AFEventParamHotelScore: 9.6,
AFEventParamPreferredStarRatings: 5,
AFEventParamPreferredNeighborhoods: "Centro"
]);
Dictionary<string, string> ContentView =
new Dictionary<string, string>();
ContentView.Add("af_currency", "GBP");
ContentView.Add("af_price", "674");
ContentView.Add("af_content_id", "ODIRNH");
ContentView.Add("af_date_a", "2018/07/26");
ContentView.Add("af_date_b", "2018/08/01");
ContentView.Add("af_destination_a", "London");
ContentView.Add("af_destination_b", "Madrid");
ContentView.Add("af_class", "Deluxe");
ContentView.Add("af_num_adults", "2");
ContentView.Add("af_num_children", "0");
ContentView.Add("af_hotel_score", "9.6");
ContentView.Add("af_preferred_star_ratings", "5");
ContentView.Add("af_preferred_neighborhoods", "Centro");
AppsFlyer.trackRichEvent("af_content_view", ContentView);
Event Name: af_add_to_wishlist
Purpose
The Add to Wish List event indicates hotels and destinations that users wish to book. By recording this event you can gain insight into what users want. If you know that some users are looking for specific hotels, in specific regions and of specific scores and ratings, you can target and retarget these users.
Trigger logic
Trigger this event when a user adds a listing to their wish list.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 674 | List price of the hotel |
af_content_id | string | ODIRNH | The id of the hotel |
af_date_a | string | 2018/07/26 | Check-in date |
af_date_b | string | 2018/08/01 | Check-out date |
af_destination_a | string | London | User's location |
af_destination_b | string | Madrid | Location of hotel |
af_class | string | Deluxe | Room type |
af_num_adults | float | 2 | Number of guests |
af_num_children | float | 0 | Number of children |
af_hotel_score | float | 9.6 | Hotel score by reviews |
af_preferred_star_ratings | float | 5 | Preferred hotel star rating |
af_preferred_neighborhoods | string | Centro | The area whee the hotel is located |
purchase_method | string | Credit card | The purchase method |
af_coupon_code | string | SUM2018 | Promo code or loyalty reward points |
property_type | string | Hotel | The type of property |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CURRENCY, "GBP");
eventValue.put(AFInAppEventParameterName.PRICE, 674);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "ODIRNH");
eventValue.put(AFInAppEventParameterName.DATE_A, "2018/07/26");
eventValue.put(AFInAppEventParameterName.DATE_B, "2018/08/01");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "London");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Madrid");
eventValue.put(AFInAppEventParameterName.CLASS, "Deluxe");
eventValue.put(AFInAppEventParameterName.NUM_ADULTS, 2);
eventValue.put(AFInAppEventParameterName.NUM_CHILDREN, 0);
eventValue.put(AFInAppEventParameterName.HOTEL_SCORE, 9.6);
eventValue.put(AFInAppEventParameterName.PREFERRED_STAR_RATINGS, 5);
eventValue.put(AFInAppEventParameterName.PREFERRED_NEIGHBORHOODS, "Centro");
eventValue.put("purchase_method", "credit card");
eventValue.put(AFInAppEventParameterName.COUPON_CODE, "SUM2018");
eventValue.put("property_type", "hotel");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.ADD_TO_WISH_LIST, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventAddToWishlist
withValues: @{
AFEventParamCurrency: @"GBP",
AFEventParamPrice: @674,
AFEventParamContentId: @"ODIRNH",
AFEventParamDateA: @"2018/07/26",
AFEventParamDateB: @"2018/08/01",
AFEventParamDestinationA: @"London",
AFEventParamDestinationB: @"Madrid",
AFEventParamClass: @"Deluxe",
AFEventParamNumAdults: @2,
AFEventParamNumChildren: @0,
AFEventParamHotelScore: @9.6,
AFEventParamPreferredStarRatings: @5,
AFEventParamPreferredNeighborhoods: @"Centro",
@"purchase_method": @"credit card",
AFEventParamCouponCode: @"SUM2018",
@"property_type": @"hotel"
}];
AppsFlyerTracker.shared().trackEvent(AFEventAddToWishlist, withValues: [
AFEventParamCurrency: "GBP",
AFEventParamPrice: 674,
AFEventParamContentId: "ODIRNH",
AFEventParamDateA: "2018/07/26",
AFEventParamDateB: "2018/08/01",
AFEventParamDestinationA: "London",
AFEventParamDestinationB: "Madrid",
AFEventParamClass: "Deluxe",
AFEventParamNumAdults: 2,
AFEventParamNumChildren: 0,
AFEventParamHotelScore: 9.6,
AFEventParamPreferredStarRatings: 5,
AFEventParamPreferredNeighborhoods: "Centro",
"purchase_method": "credit card",
AFEventParamCouponCode: "SUM2018",
"property_type": "hotel"
]);
Dictionary<string, string> AddToWishList =
new Dictionary<string, string>();
AddToWishList.Add("af_currency", "GBP");
AddToWishList.Add("af_price", "674");
AddToWishList.Add("af_content_id", "ODIRNH");
AddToWishList.Add("af_date_a", "2018/07/26");
AddToWishList.Add("af_date_b", "2018/08/01");
AddToWishList.Add("af_destination_a", "London");
AddToWishList.Add("af_destination_b", "Madrid");
AddToWishList.Add("af_class", "Deluxe");
AddToWishList.Add("af_num_adults", "2");
AddToWishList.Add("af_num_children", "0");
AddToWishList.Add("af_hotel_score", "9.6");
AddToWishList.Add("af_preferred_star_ratings", "5");
AddToWishList.Add("af_preferred_neighborhoods", "Centro");
AddToWishList.Add("purchase_method", "credit card");
AddToWishList.Add("af_coupon_code", "SUM2018");
AddToWishList.Add("af_property_type", "hotel");
AppsFlyer.trackRichEvent("af_add_to_wish_list", AddToWishList);
Event Name: af_initiated_checkout
Purpose
The purpose of this event is to allow you to record how many users initiate checkout. Additionally, you can see what purchase method they use to checkout (credit card, e-wallet) and target accordingly. You can also see what users don't finish the checkout process and retarget them.
Trigger logic
Trigger this event when the user adds their credit card information or connects their e-wallet.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_price | float | 674 | List price of the hotel |
af_content_id | string | ODIRNH | The id of the hotel |
af_date_a | string | 2018/07/26 | Check-in date |
af_date_b | string | 2018/08/01 | Check-out date |
af_destination_a | string | London | User's location |
af_destination_b | string | Madrid | Location of hotel |
af_class | string | Deluxe | Room type |
af_num_adults | float | 2 | Number of guests |
af_num_children | float | 0 | Number of children |
af_hotel_score | float | 9.6 | Hotel score by reviews |
af_preferred_star_ratings | float | 5 | Preferred hotel star rating |
af_preferred_neighborhoods | string | Centro | The area whee the hotel is located |
purchase_method | string | Credit card | The purchase method |
af_coupon_code | string | SUM2018 | Promo code or loyalty reward points |
property_type | string | Hotel | The type of property |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CURRENCY, "GBP");
eventValue.put(AFInAppEventParameterName.PRICE, 674);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "ODIRNH");
eventValue.put(AFInAppEventParameterName.DATE_A, "2018/07/26");
eventValue.put(AFInAppEventParameterName.DATE_B, "2018/08/01");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "London");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Madrid");
eventValue.put(AFInAppEventParameterName.CLASS, "Deluxe");
eventValue.put(AFInAppEventParameterName.NUM_ADULTS, 2);
eventValue.put(AFInAppEventParameterName.NUM_CHILDREN, 0);
eventValue.put(AFInAppEventParameterName.HOTEL_SCORE, 9.6);
eventValue.put(AFInAppEventParameterName.PREFERRED_STAR_RATINGS, 5);
eventValue.put(AFInAppEventParameterName.PREFERRED_NEIGHBORHOODS, "Centro");
eventValue.put("purchase_method", "credit card");
eventValue.put(AFInAppEventParameterName.COUPON_CODE, "SUM2018");
eventValue.put("property_type", "hotel");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.INITIATED_CHECKOUT, eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:AFEventInitiatedCheckout
withValues: @{
AFEventParamCurrency: @"GBP",
AFEventParamPrice: @674,
AFEventParamContentId: @"ODIRNH",
AFEventParamDateA: @"2018/07/26",
AFEventParamDateB: @"2018/08/01",
AFEventParamDestinationA: @"London",
AFEventParamDestinationB: @"Madrid",
AFEventParamClass: @"Deluxe",
AFEventParamNumAdults: @2,
AFEventParamNumChildren: @0,
AFEventParamHotelScore: @9.6,
AFEventParamPreferredStarRatings: @5,
AFEventParamPreferredNeighborhoods: @"Centro",
@"purchase_method": @"credit card",
AFEventParamCouponCode: @"SUM2018",
@"property_type": @"hotel"
}];
AppsFlyerTracker.shared().trackEvent(AFEventInitiatedCheckout, withValues: [
AFEventParamCurrency: "GBP",
AFEventParamPrice: 674,
AFEventParamContentId: "ODIRNH",
AFEventParamDateA: "2018/07/26",
AFEventParamDateB: "2018/08/01",
AFEventParamDestinationA: "London",
AFEventParamDestinationB: "Madrid",
AFEventParamClass: "Deluxe",
AFEventParamNumAdults: 2,
AFEventParamNumChildren: 0,
AFEventParamHotelScore: 9.6,
AFEventParamPreferredStarRatings: 5,
AFEventParamPreferredNeighborhoods: "Centro",
"purchase_method": "credit card",
AFEventParamCouponCode: "SUM2018",
"property_type": "hotel"
]);
Dictionary<string, string> InitiatedCheckout =
new Dictionary<string, string>();
InitiatedCheckout.Add("af_currency", "GBP");
InitiatedCheckout.Add("af_price", "674");
InitiatedCheckout.Add("af_content_id", "ODIRNH");
InitiatedCheckout.Add("af_date_a", "2018/07/26");
InitiatedCheckout.Add("af_date_b", "2018/08/01");
InitiatedCheckout.Add("af_destination_a", "London");
InitiatedCheckout.Add("af_destination_b", "Madrid");
InitiatedCheckout.Add("af_class", "Deluxe");
InitiatedCheckout.Add("af_num_adults", "2");
InitiatedCheckout.Add("af_num_children", "0");
InitiatedCheckout.Add("af_hotel_score", "9.6");
InitiatedCheckout.Add("af_preferred_star_ratings", "5");
InitiatedCheckout.Add("af_preferred_neighborhoods", "Centro");
InitiatedCheckout.Add("purchase_method", "credit card");
InitiatedCheckout.Add("af_coupon_code", "SUM2018");
InitiatedCheckout.Add("af_property_type", "hotel");
AppsFlyer.trackRichEvent("af_initiated_chekcout", InitiatedCheckout);
Event Name: travel_booking
Purpose
The purpose of the Travel booking event is to allow you to see the overall booking rate in your app. In addition, by recording this event you can:
- Record revenue generated from booking.
- See how many users book hotels with kids.
- Understand season trends.
- See what hotels are popular among users.
Trigger logic
Trigger this event when the user reaches the thank you page after booking a hotel.
Recommended attributes
Parameter Name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 647 | Revenue from booking |
af_currency | string | GBP | Currency code |
af_price | float | 674 | List price of the hotel |
af_content_id | string | ODIRNH | The id of the hotel |
af_date_a | string | 2018/07/26 | Check-in date |
af_date_b | string | 2018/08/01 | Check-out date |
af_destination_a | string | London | User's location |
af_destination_b | string | Madrid | Location of hotel |
af_class | string | Deluxe | Room type |
af_num_adults | float | 2 | Number of guests |
af_num_children | float | 0 | Number of children |
af_hotel_score | float | 9.6 | Hotel score by reviews |
af_preferred_star_ratings | float | 5 | Preferred hotel star rating |
af_preferred_neighborhoods | string | Centro | The area whee the hotel is located |
purchase_method | string | Credit card | The purchase method |
af_coupon_code | string | SUM2018 | Promo code or loyalty reward points |
property_type | string | Hotel | The type of property |
new_booking | boolean | true | User's first booking |
Code Examples
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REVENUE, 647);
eventValue.put(AFInAppEventParameterName.CURRENCY, "GBP");
eventValue.put(AFInAppEventParameterName.PRICE, 674);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "ODIRNH");
eventValue.put(AFInAppEventParameterName.DATE_A, "2018/07/26");
eventValue.put(AFInAppEventParameterName.DATE_B, "2018/08/01");
eventValue.put(AFInAppEventParameterName.DESTINATION_A, "London");
eventValue.put(AFInAppEventParameterName.DESTINATION_B, "Madrid");
eventValue.put(AFInAppEventParameterName.CLASS, "Deluxe");
eventValue.put(AFInAppEventParameterName.NUM_ADULTS, 2);
eventValue.put(AFInAppEventParameterName.NUM_CHILDREN, 0);
eventValue.put(AFInAppEventParameterName.HOTEL_SCORE, 9.6);
eventValue.put(AFInAppEventParameterName.PREFERRED_STAR_RATINGS, 5);
eventValue.put(AFInAppEventParameterName.PREFERRED_NEIGHBORHOODS, "Centro");
eventValue.put("purchase_method", "credit card");
eventValue.put(AFInAppEventParameterName.COUPON_CODE, "SUM2018");
eventValue.put("property_type", "hotel");
eventValue.put("new_booking", true);
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), "travel_booking", eventValue);
[[AppsFlyerTracker sharedTracker] trackEvent:@"travel_booking"
withValues: @{
AFEventParamRevenue: @647,
AFEventParamCurrency: @"GBP",
AFEventParamPrice: @674,
AFEventParamContentId: @"ODIRNH",
AFEventParamDateA: @"2018/07/26",
AFEventParamDateB: @"2018/08/01",
AFEventParamDestinationA: @"London",
AFEventParamDestinationB: @"Madrid",
AFEventParamClass: @"Deluxe",
AFEventParamNumAdults: @2,
AFEventParamNumChildren: @0,
AFEventParamHotelScore: @9.6,
AFEventParamPreferredStarRatings: @5,
AFEventParamPreferredNeighborhoods: @"Centro",
@"purchase_method": @"credit card",
AFEventParamCouponCode: @"SUM2018",
@"property_type": @"hotel",
@"new_booking": @TRUE
}];
AppsFlyerTracker.shared().trackEvent("travel_booking", withValues: [
AFEventParamRevenue: 647,
AFEventParamCurrency: "GBP",
AFEventParamPrice: 674,
AFEventParamContentId: "ODIRNH",
AFEventParamDateA: "2018/07/26",
AFEventParamDateB: "2018/08/01",
AFEventParamDestinationA: "London",
AFEventParamDestinationB: "Madrid",
AFEventParamClass: "Deluxe",
AFEventParamNumAdults: 2,
AFEventParamNumChildren: 0,
AFEventParamHotelScore: 9.6,
AFEventParamPreferredStarRatings: 5,
AFEventParamPreferredNeighborhoods: "Centro",
"purchase_method": "credit card",
AFEventParamCouponCode: "SUM2018",
"property_type": "hotel",
"new_booking": true
]);
Dictionary<string, string> TravelBooking =
new Dictionary<string, string>();
TravelBooking.Add("af_revenue", "647");
TravelBooking.Add("af_currency", "GBP");
TravelBooking.Add("af_price", "674");
TravelBooking.Add("af_content_id", "ODIRNH");
TravelBooking.Add("af_date_a", "2018/07/26");
TravelBooking.Add("af_date_b", "2018/08/01");
TravelBooking.Add("af_destination_a", "London");
TravelBooking.Add("af_destination_b", "Madrid");
TravelBooking.Add("af_class", "Deluxe");
TravelBooking.Add("af_num_adults", "2");
TravelBooking.Add("af_num_children", "0");
TravelBooking.Add("af_hotel_score", "9.6");
TravelBooking.Add("af_preferred_star_ratings", "5");
TravelBooking.Add("af_preferred_neighborhoods", "Centro");
TravelBooking.Add("purchase_method", "credit card");
TravelBooking.Add("af_coupon_code", "SUM2018");
TravelBooking.Add("af_property_type", "hotel");
TravelBooking.Add("af_new_booking", "true");
AppsFlyer.trackRichEvent("travel_booking", TravelBooking);