At a glance: Record post-install events and attribute them to the originating media source by sending SDK or S2S rich events to AppsFlyer.
Why record rich in-app events?
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 recommended that you do so. We also recommend defining and using the same in-app event names and structures across all platforms, for better raw data alignment.
Respecting the privacy of your users
- AppsFlyer values and respects the privacy of you and your app users.
- We don't collect nor accept personally identifiable information (PII).
- To ensure the privacy of your users, don't populate in-app event values with information that can directly identify them (for example, email address, name, identity number, and, in some locations, postal code).
The logEvent 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 in the raw data. However, in aggregate reports (for example, Overview, Events) they can be displayed as a single event. Therefore, we recommend using only lower-case event and parameter names.
The length of event values is limited to 1000 characters. Don't exceed this limit. We may truncate it if you do so.
Syntax:
public static void logEvent(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) logEvent:(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
Hybrid apps, that combine native views and HTML content, can also record in-app events. However, because the SDK can only send events from the native side, developers have to forward all event data to native code. See our guide on in-app events for hybrid apps for instructions.
Caution
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.
- The following parameters, as part of the rich in-app events value, are only available in the raw data reports. Raw data is a premium feature.
- If you include the referring URL as an event value, it must be URL encoded.
Note
Refer to the Verticals tab in this article for code snippets per vertical, for Android (Java), iOS (Obj-C and Swift), and Unity.
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 name constant (Android): AFInAppEventType.LEVEL_ACHIEVED
Event name constant (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 fields: af_level, af_score
Field 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 name constant (Android): AFInAppEventType.ADD_PAYMENT_INFO
Event name constant (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 fields: af_success
Field 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 name constant (Android): AFInAppEventType.ADD_TO_CART
Event name constant (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 fields: af_price, af_content_type, af_content_id, af_content, af_currency, af_quantity
Field 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 name constant (Android): AFInAppEventType.ADD_TO_WISH_LIST
Event name constant (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
Snapchat: ADD_TO_WISHLIST
Recommended fields: af_price, af_content_type, af_content_id, af_content, af_currency, af_quantity
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_price | _valueToSum | price_micro* | - | Price | price |
af_content_type | fb_content_type | content_type | - | item category | item_category |
af_content_id | fb_content_id | content_id | - | item_id | item_ids |
af_content | fb_content | - | - | - | - |
af_currency | fb_currency | price_currency | - | currency_code | currency |
af_quantity | - | number_items | - | quantity | number_items |
*To report an event containing multiple items, click here.
Complete Registration
Event Name:af_complete_registration
Description: Used to record user registration methods
Event name constant (Android): AFInAppEventType.COMPLETE_REGISTRATION
Event name constant (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 fields: af_registration_method
Field 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 name constant (Android): AFInAppEventType.TUTORIAL_COMPLETION
Event name constant (iOS): AFEventTutorial_completion
Facebook Mapped Event: fb_mobile_tutorial_completion
Twitter Mapped Event: TUTORIAL_COMPLETE
Criteo Mapped Event: None
Google Ads: tutorial_complete
Snapchat: COMPLETE_TUTORIAL
Recommended fields: af_success, af_content_id, af_content
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_success | fb_success | - | - | success | success |
af_content_id | fb_content_id | content_id | - | item_id | item_ids |
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 name constant (Android): AFInAppEventType.INITIATED_CHECKOUT
Event name constant (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 fields: af_price, af_content_type, af_content_id, af_content, af_quantity, af_payment_info_available, af_currency
Field 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 name constant (Android): AFInAppEventType.PURCHASE
Event name constant (iOS): AFEventPurchase
Facebook Mapped Event: fb_mobile_purchase
Twitter Mapped Event: PURCHASE
Criteo Mapped Event: transactionConfirmation
Google Ads: in_app_purchase
Snapchat: PURCHASE
Recommended fields: af_revenue, af_content_type, af_content_id, af_content, af_price, af_quantity, af_currency, af_order_id
Field 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_price |
- | 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 the AppsFlyer platform. It also counts negative revenue, from cancellations or refunds.
**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 name constant (Android): AFInAppEventType.SUBSCRIBE
Event name constant (iOS): AFEventSubscribe
Facebook Mapped Event: Subscribe
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Snapchat: SUBSCRIBE
Recommended fields: af_revenue, af_currency
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_revenue |
_valueToSum |
- |
- |
- |
price |
af_currency |
fb_currency |
- |
- |
- |
currency |
af_subscription_id |
subscription_id |
- |
- |
- |
- |
Start Trial
Event Name: af_start_trial
Description: Used to record the start of a free trial of a product
Event name constant (Android): AFInAppEventType.START_TRIAL
Event name constant (iOS): AFEventStartTrial
Facebook Mapped Event: StartTrial
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Snapchat: START_TRIAL
Recommended fields: af_price, af_currency
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_price |
_valueToSum |
- |
- |
- |
price |
af_currency |
fb_currency |
- |
- |
- |
currency |
af_subscription_id |
subscription_id |
- |
- |
- |
- |
Rate
Event Name: af_rate
Description: Used to record app/item rating events.
Event name constant (Android): AFInAppEventType.RATE
Event name constant (iOS): AFEventRate
Facebook Mapped Event: fb_mobile_rate
Twitter Mapped Event: RATED
Criteo Mapped Event: None
Google Ads: submit_rating
Snapchat: RATE
Recommended fields: af_rating_value, af_content_type, af_content_id, af_content, af_max_rating_value
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_rating_value |
_valueToSum |
price_micro |
- |
value |
- |
af_content_type |
fb_content_type |
content_type |
- |
content_type |
item_category |
af_content_id |
fb_content_id |
content_id |
- |
content_id |
item_ids |
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 name constant (Android): AFInAppEventType.SEARCH
Event name constant (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 fields: af_content_type, af_search_string, af_success
Field 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 name constant (Android): AFInAppEventType.SPENT_CREDIT
Event name constant (iOS): AFEventSpentCredits
Facebook Mapped Event: fb_mobile_spent_credits
Twitter Mapped Event: SPENT_CREDITS
Criteo Mapped Event: transactionConfirmation
Google Ads: spend_virtual_currency
Snapchat: SPENT_CREDITS
Recommended fields: af_price, af_content_type, af_content_id, af_content
Field 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 |
item_id |
item_id |
item_ids |
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 name constant (Android): AFInAppEventType.ACHIEVEMENT_UNLOCKED
Event name constant (iOS): AFEventAchievementUnlocked
Facebook Mapped Event: fb_mobile_achievement_unlocked
Twitter Mapped Event: ACHIEVEMENT_UNLOCKED
Criteo Mapped Event: achievement
Google Ads: unlock_achievement
Snapchat: ACHIEVEMENT_UNLOCKED
Recommended fields: af_description
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_description |
fb_description |
description |
ui_achievement |
description |
description |
Content View
Event: af_content_view
Description: Used to record content view events
Event name constant (Android): AFInAppEventType.CONTENT_VIEW
Event name constant (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 fields: af_price, af_content_type, af_content_id, af_content, af_currency
Field 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 name constant (Android): use the string "af_list_view" instead:
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "af_list_view", eventValue);
Event name constant (iOS): AFEventListView
Facebook Mapped Event:
Twitter Mapped Event:
Criteo Mapped Event: viewListing
Google Ads: view_item_list
Snapchat: LIST_VIEW
Recommended fields: af_content_type, af_content_list
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_content_type |
- |
- |
- |
item_Category |
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 name constant (Android): AFInAppEventType.AD_CLICK
Event name constant (iOS): AFEventAdClick
Facebook Mapped Event: AdClick
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Snapchat: AD_CLICK
Recommended fields: af_adrev_ad_type
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_adrev_ad_type |
ad_type |
- |
- |
- |
- |
af_currency |
fb_currency |
- |
- |
- |
currency |
Ad view
Event Name: af_ad_view
Description: Used to record ad views of ads displayed in the app
Event name constant (Android): AFInAppEventType.AD_VIEW
Event name constant (iOS): AFEventAdView
Facebook Mapped Event: AdImpression
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: None
Snapchat: AD_VIEW
Recommended fields: af_adrev_ad_type
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_adrev_ad_type |
ad_type |
- |
- |
- |
- |
af_currency |
fb_currency |
- |
- |
- |
currency |
Travel booking
Event Name: af_travel_booking
Description: Used to record travel booking events (and associate revenue to them)
Event name constant (Android): AFInAppEventType.TRAVEL_BOOKING
Event name constant (iOS): AFEventTravelBooking
Facebook Mapped Event: fb_mobile_purchase
Twitter Mapped Event: PURCHASE
Criteo Mapped Event: transactionConfirmation
Google Ads: ecommerce_purchase
Snapchat: RESERVE
Recommended fields: 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
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_revenue* |
_valueToSum |
price_micro** |
price*** |
value |
price |
af_customer_user_id |
- |
- |
cid |
customer_user_ |
- |
af_content_type |
fb_content_type |
content_type |
- |
item_category |
item_category |
af_content_id |
fb_content_id |
content_id |
- |
item_id |
item_ids |
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 | transaction_id |
Share
Event Name: af_share
Description: Used to record sharing events
Event name constant (Android): AFInAppEventType.SHARE
Event name constant (iOS): AFEventShare
Facebook Mapped Event: None
Twitter Mapped Event: SHARE
Criteo Mapped Event: None
Google Ads: share
Snapchat: SHARE
Recommended fields: af_description
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_description |
- |
description |
- |
description |
description |
Invite
Event Name: af_invite
Description: Used to record invite (social) events
Event name constant (Android): AFInAppEventType.INVITE
Event name constant (iOS): AFEventInvite
Facebook Mapped Event: None
Twitter Mapped Event: INVITE
Criteo Mapped Event: None
Google Ads: invite
Snapchat: INVITE
Recommended fields: None
Field mapping:
AppsFlyer | Criteo | Google Ads | Snapchat | ||
---|---|---|---|---|---|
af_description |
- |
description |
- |
description |
description |
Login
Event Name: af_login
Description: Used to record user login events
Event name constant (Android): AFInAppEventType.LOGIN
Event name constant (iOS): AFEventLogin
Facebook Mapped Event: None
Twitter Mapped Event: LOGIN
Criteo Mapped Event: None
Google Ads: login
Recommended fields: None
Re-engage
Event Name: af_re_engage
Description: Used to record user re-engagement events
Event name constant (Android): AFInAppEventType.RE_ENGAGE
Event name constant (iOS): AFEventReEngage
Facebook Mapped Event: None
Twitter Mapped Event: RE_ENGAGE
Criteo Mapped Event: None
Google Ads: custom_event
Recommended fields: None
Field 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 name constant (Android): AFInAppEventType.OPENED_FROM_PUSH_NOTIFICATION
Event name constant (iOS): AFEventOpenedFromPushNotification
Facebook Mapped Event: None
Twitter Mapped Event: None
Criteo Mapped Event: None
Google Ads: notification_open
Recommended fields: None
Update
Event Name: af_update
Description: Used to record update events
Event name constant (Android): AFInAppEventType.UPDATE
Event name constant (iOS): AFEventUpdate
Facebook Mapped Event: None
Twitter Mapped Event: UPDATE
Criteo Mapped Event: None
Google Ads: app_update
Recommended fields: af_content_id
Field 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, which 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 (00:00:00) |
EVENT_END |
af_event_end |
Unixtime (00:00:00) |
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 |
Viewing rich in-app events data
- Your in-app event name, as well as revenue, appears in the Dashboard Overview page and Events page.
- Additional parameter values appear in the Raw data in-app events report. Raw data is a premium feature.
Revenue parameter
You can send revenue values with any parameter name and event. However, to register the revenue (including negative revenue) in the AppsFlyer 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.
Personally identifiable information
Personally identifiable information (PII) is information that can be used to identify or trace the identity of an individual (name, national identity number, social security number) alone, or when combined with other identifying information that is linked to the individual date and place of birth.
AppsFlyer respects user privacy regulations and does not collect user PII.
Do not send PII in event values.
Note
AppsFlyer collects the IP address of devices during engagements. In some jurisdictions or use scenarios, the IP address may be regarded as PII. We use the IP address to derive the broad geographic location (city, district level) of the device but not the specific address. If needed, you can select to mask IP addresses so that they don't appear in raw data reports.
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().logEvent(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 (for example, 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 (for example, 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"
}
]
}
Caution
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 (for example, 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 the AppsFlyer) 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 afterward, until the next 200 responses, 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 that 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 them 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
- Windows mobile devices
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 fields
This event can be sent without any additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompletedRegistrationEvent = new Dictionary<string, string>();
CompletedRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent ("af_complete_registration", CompletedRegistrationEvent);
Purchase
Event Name: af_purchase
Purpose
Many gaming apps allow users to purchase items (for example, 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 on the thank you page after a successful purchase.
Recommended fields
Field 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 |
af_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(AFInAppEventParameterName.ORDER_ID, "9277");
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "9277");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(),AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventPurchase
withValues: @{
AFEventParamRevenue: @200,
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2,
AFEventParamContentId: @"092",
AFEventParamOrderId: @"9277",
AFEventParamReceiptId: @"9277"
}];
AppsFlyerLib.shared().logEvent(AFEventPurchase,
withValues: [
AFEventParamRevenue: 200,
AFEventParamCurrency: "THB",
AFEventParamQuantity: 2,
AFEventParamContentId: "092",
AFEventParamOrderId: "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("af_order_id", "9277");
purchaseEvent.Add("af_receipt_id", "9277");
AppsFlyer.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.LEVEL_ACHIEVED, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventLevelAchieved
withValues: @{
AFEventParamLevel: @10,
AFEventParamScore: @500
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 a field indicating successful tutorial completion.
- When a user starts the tutorial but quits without completing it. When the user quits, an event is sent with a field indicating that the user didn't complete the tutorial.
Recommended fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.TUTORIAL_COMPLETION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventTutorial_completion
withValues: @{
AFEventParamSuccess: @TRUE,
AFEventParamTutorialId: @"3",
AFEventParamContent: @"Getting Started"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.SHARE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventShare
withValues: @{
AFEventParamDescription: @"New High Score",
@"platform": @"Facebook"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.INVITE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventInvite
withValues: @{
AFEventParamDescription: @"Try this app"
}];
AppsFlyerLib.shared().logEvent(AFEventInvite, withValues: [
AFEventParamDescription: "Try this app"
]);
Dictionary<string, string> InviteEvent = new Dictionary<string, string>();
InviteEvent.Add("af_description", "Try this app");
AppsFlyer.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), "bonus_claimed", eventValue);
[[AppsFlyerLib shared] logEvent:@"bonus_claimed"
withValues: @{
@"bonus_type": @"coins"
}];
AppsFlyerLib.shared().logEvent("bonus_claimed", withValues: [
"bouns_type": "coins"
]);
Dictionary<string, string> BonusClaimedEvent = new Dictionary<string, string>();
BonusClaimedEvent.Add("bouns_type", "coins");
AppsFlyer.sendEvent ("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 (for example, Facebook, email, etc.)
Trigger logic
Trigger this event after a user successfully registered.
Recommended fields
Field 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().logEvent(getApplicationContext(),AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent("af_complete_registration", CompleteRegistrationEvent);
Login
Event Name: af_login
Purpose
The Login event allows you to record how many users log in to their accounts. 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 fields
This event can be sent with no additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.SEARCH, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventSearch
withValues: @{
AFEventParamSearchString: @"red shoes",
AFEventParamContentList: @[@"001", @"092"]
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 fields
Field 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 on 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().logEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventContentView
withValues: @{
AFEventParamPrice: @2000,
AFEventParamContentId: @"102",
AFEventParamContentType: @"shoes",
AFEventParamCurrency: @"USD"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 fields
Field 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().logEvent(getApplicationContext(), "af_list_view", eventValue);
[[AppsFlyerLib shared] logEvent:AFEventListView
withValues: @{
AFEventParamContentType: @"related products",
AFEventParamContentList: @[@"001", @"092"]
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 fields
Field 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 on 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().logEvent(getApplicationContext(), AFInAppEventType.ADD_TO_WISH_LIST, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventAddToWishlist
withValues: @{
AFEventParamPrice: @600,
AFEventParamContentId: @"300",
AFEventParamContentType: @"electronics",
AFEventParamCurrency: @"GBP"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 the 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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.ADD_TO_CART, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventAddToCart
withValues: @{
AFEventParamPrice: @350,
AFEventParamContentId: @"001",
AFEventParamContentType: @"shirt",
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 check out 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 checkout yet.
Recommended fields
Tip
If there are several products from different categories, use arrays to send the data.
Field 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().logEvent(getApplicationContext(), AFInAppEventType.INITIATED_CHECKOUT, eventValue);
[[AppsFlyerLib shared] logEvent: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]
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 terms 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 fields
Field 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 the purchase. |
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().logEvent(getApplicationContext(), AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerLib shared] logEvent: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"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 (for example, 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 fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 4000 | Revenue generated from the purchase |
af_order_id | string | X123ABC | Order ID generated from the 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().logEvent(getApplicationContext(), "completed_purchase", eventValue);
[[AppsFlyerLib shared] logEvent:@"completed_purchase"
withValues: @{
AFEventParamRevenue: @4000,
AFEventParamOrderId: @"X123ABC",
AFEventParamReceiptId: @"X123ABC"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent ("completed_purchase", CompletedPurchaseEvent);
Remove from cart
Event Name: remove_from_cart
Purpose
By recording 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 fields
Field 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().logEvent(getApplicationContext(), "remove_from_cart", eventValue);
[[AppsFlyerLib shared] logEvent:@"remove_from_cart"
withValues: @{
AFEventParamContentId: @"521",
AFEventParamContentType: @"shoes",
}];
AppsFlyerLib.shared().logEvent("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.sendEvent ("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 fields
Field 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 the purchase. |
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().logEvent(getApplicationContext(), "first_purchase", eventValue);
[[AppsFlyerLib shared] logEvent:("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"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent ("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.
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 (for example, Facebook, email, etc.) to learn what signup method users prefer.
Trigger logic
Trigger this event after a user successfully registered.
Recommended fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent("af_complete_registration", CompleteRegistrationEvent);
Login
Event Name: af_login
Purpose
The Login event allows you to record how many users log in to their accounts. 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 fields
This event can be sent with no additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent("af_login", null);
Start trial
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 fields
Field name | Type | Example of Value | Description |
---|---|---|---|
trial_method | string | free with a new phone, free with a carrier, promotion, coupon code | The method to activate the trial |
trial_method_identifier | string |
name of carrier (for example, Vodafone) name of the partner (for example, Facebook) coupon code (for example, 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().logEvent(getApplicationContext(), AFInAppEventType.START_TRIAL, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventStartTrial
withValues: @{
@"trial_method": @"coupon code",
@"trial_method_identifier": @"TRA123"
}]
AppsFlyerLib.shared().logEvent(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.sendEvent("af_start_trial", SubscriptionTrial);
Subscription
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 a 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
See our Subscription attribution guide for more information.
Recommended fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.SUBSCRIBE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventSubscribe
withValues: @{
@"new_subscription": @TRUE,
AFEventParamCouponCode: @"3MonthsSubscription",
@"coupon_code_value": @"10%",
AFEventParamRevenue: @5,
AFEventParamCurrency: @"USD",
@"subscription_method": @"",
@"expiration_date": @"2018/07/18"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("af_subscribe", Subscription);
Media play
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 (for example, 2 minutes) of streamed content.
Recommended fields
Field 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 (for example, 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().logEvent(getApplicationContext(), "media_play", eventValue);
[[AppsFlyerLib shared] logEvent:@"media_play"
withValues: @{
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("media_play", MediaPlay);
Media minutes
Event Name: media_minutes
Purpose
Media minutes 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 Media minutes (using the parameter minutes_consumed) 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 fields
Field 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 (for example, 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().logEvent(getApplicationContext(),"media_minutes", eventValue);
[[AppsFlyerLib shared] logEvent:@"media_minutes"
withValues: @{
@"minutes_consumed": @3,
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("media_minutes", MediaMinutes);
Media downloaded
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 fields
Field 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 (for example, 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 |
eCode 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().logEvent(getApplicationContext(), "media_downloaded", eventValue);
[[AppsFlyerLib shared] logEvent:@"media_downloaded"
withValues: @{
@"minutes_consumed": @3,
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("media_downloaded", MediaDownloaded);
Media saved
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 fields
Field 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 (for example, 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().logEvent(getApplicationContext(), "media_saved", eventValue);
[[AppsFlyerLib shared] logEvent:@"media_saved"
withValues: @{
@"minutes_consumed": @3,
AFEventParamContentType: @"tv show",
AFEventParamContentId: @"E34",
AFEventParamContent: @"My Show",
@"duration": @5,
@"langague": @"en-us"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("media_saved", MediaSaved);
Finance: banking
Finance and banking apps provide users with the ability to perform a wide range of financial-related objectives, including signing up for new credit cards or applying for loans. The in-app events that we recommend recording in finance/banking apps include account openings, credit card applications, and loan applications. Here are some examples of how recording these events can benefit you:
- Recording in-app account applications helps you understand what account users want the most and gives you ideas for retargeting.
- Recording credit card applications helps you understand what benefits users look for in a credit card.
- Recording loan applications helps you understand what users need financial assistance for and how much assistance they want.
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 fields
This event can be sent without any additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent ("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 fields
Field 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.registration_method, "Facebook");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.complete_registration, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompletedRegistrationEvent = new Dictionary<string, string>();
CompletedRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent ("af_complete_registration", CompletedRegistrationEvent);
Registration verified
Event Name: registration_verified
Purpose
You can record a registration accepted and compare it with other data to learn more about your users. For example, by recording registration verified events, you can learn how many users sign up but aren't accepted.
Trigger logic
The best way to record this event is to trigger it when the registration is verified.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
submit_registration | string | email, facebook | The type of signup method verified. Do not fill with personally identifiable information (PII). |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("submit_registration", "facebook");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "registration_verified", eventValue);
[[AppsFlyerLib shared] logEvent:@"registration_verified"
withValues: @{
@"submit_registartion": @"facebook"
}];
AppsFlyerLib.shared().logEvent("registration_verified",
withValues: [
"submit_registration": "facebook"
])
Dictionary<string, string> RegistrationVerifiedEvent = new Dictionary<string, string>();
RegistrationVerifiedEvent.Add("submit_registration", "facebook");
AppsFlyer.sendEvent ("registration_verified", RegistrationVerifiedEvent);
Submit account application
Event Name: submit_account_application
Purpose
You can record an account application and compare it with other data to learn more about your users. For example, by recording user registration events you can learn how many users sign up but do not apply to open an account.
Trigger logic
The best way to record this event is to trigger it when the user completes the account application process.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
account_type | string | savings | The type of account applied for. |
application_method | string | app | Where the application was made. |
PII_type | string | passport | Type of ID used during application. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("account_type", "savings");
eventValue.put("application_method", "app");
eventValue.put("PII_type", "passport");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "submit_account_application", eventValue);
[[AppsFlyerLib shared] logEvent:@"submit_account_application"
withValues: @{
@"account_type": @"savings",
@"application_method": @"app",
@"PII_type": @"passport"
}];
AppsFlyerLib.shared().logEvent("submit_account_application",
withValues: [
"account_type": "savings",
"application_method": "app",
"PII_type": "passport"
])
Dictionary<string, string> SubmitAccountApplicationEvent = new Dictionary<string, string>();
SubmitAccountApplicationEvent.Add("account_type", "savings");
SubmitAccountApplicationEvent.Add("application_method", "app");
SubmitAccountApplicationEvent.Add("PII_type", "passport");
AppsFlyer.sendEvent ("submit_account_applicationn", SubmitAccountApplicationEvent);
Open account success
Event Name: open_account_success
Purpose
You can record account applications that were accepted and compare them with other data to learn more about your users. For example, by recording successful account applications you can learn how many users apply for accounts but aren't accepted, and try to improve the funnel or retarget those users later.
Trigger logic
The best way to record this event is to trigger it when the user application is accepted and the account is opened.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
account_type | string | savings | The type of account opened. |
application_method | string | app | Where the application was made. |
PII_type | string | identification card | Type of ID used during application. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("account_type", "savings");
eventValue.put("application_method", "app");
eventValue.put("PII_type", "identification card");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "open_account_suucess", eventValue);
[[AppsFlyerLib shared] logEvent:@"open_account_success"
withValues: @{
@"account_type": @"savings",
@"application_method": @"app",
@"PII_type": @"identification card"
}];
AppsFlyerLib.shared().logEvent("open_account_success",
withValues: [
"account_type": "savings",
"application_method": "app",
"PII_type": "identification card"
])
Dictionary<string, string> OpenAccountSuccessEvent = new Dictionary<string, string>();
OpenAccountSuccessEventEvent.Add("account_type", "savings");
OpenAccountSuccessEventEvent.Add("application_method", "app");
OpenAccountSuccessEventEvent.Add("PII_type", "identification_card");
AppsFlyer.sendEvent ("open_account_success", OpenAccountSuccessEvent);
Open account rejected
Event Name: open_account_rejected
Purpose
You can record account applications that were rejected and compare them with other data to learn more about your users. For example, by recording unsuccessful account applications you can learn how many users apply for accounts but aren't accepted, and try to improve the funnel or retarget those users later.
Trigger logic
The best way to record this event is to trigger it when the user completes the signup process.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
account_type | string | savings | The type of account applied for. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("account_type", "savings");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "open_account_rejected", eventValue);
[[AppsFlyerLib shared] logEvent:@"open_account_rejected"
withValues: @{
@"account_type": @"savings"
}];
AppsFlyerLib.shared().logEvent("open_account_rejected",
withValues: [
"account_type": "savings"
])
Dictionary<string, string> OpenAccountRejectedEvent = new Dictionary<string, string>();
OpenAccountRejectedEvent.Add("account_type", "savings");
AppsFlyer.sendEvent ("open_account_rejected", OpenAccountRejectedEvent);
Credit card application
Event Name: submit_credit_card_application
Purpose
You can record an application for a credit card and compare it with other data to learn more about your users. For example, by recording user credit card applications, you can learn how many users apply but are not accepted, and use this information to improve your funnel or retarget them later.
Trigger logic
To record this event properly, you should trigger it when the user submits an application for a new credit card.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
credit_card_type | string | gold card | The type of credit card applied for. |
application_method | string | app | Where the application was made. |
PII_type | string | passport | Type of ID used during application. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("credit_card_type", "gold card");
eventValue.put("application_method", "app");
eventValue.put("PII_type", "passport");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "submit_credit_card_application", eventValue);
[[AppsFlyerLib shared] logEvent:@"submit_credit_card_application"
withValues: @{
@"credit_card_type": @"gold_card",
@"application_method": @"app",
@"PII_type": @"passport"
}];
AppsFlyerLib.shared().logEvent("submit_credit_card_application",
withValues: [
"credit_card_type": "gold_card",
"application_method": "app",
"PII_type": "passport"
])
Dictionary<string, string> SubmitCreditCardApplicationEvent = new Dictionary<string, string>();
SubmitCreditCardApplicationEvent.Add("credit_card_type", "gold_card");
SubmitCreditCardApplicationEvent.Add("application_method", "app");
SubmitCreditCardApplicationEvent.Add("PII_type", "passport");
AppsFlyer.sendEvent ("submit_credit_card_application", SubmitCreditCardApplicationEvent);
Credit card application success
Event Name: credit_card_application_success
Purpose
You can record an accepted credit card application and compare it with other data to learn more about your users. For example, by recording successful credit card applications, you can learn how many users apply but are not accepted, and use this information to improve your funnel or retarget the accepted users for other credit cards.
Trigger logic
To record this event properly, you should trigger it when the user's credit card application is accepted.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
credit_card_type | string | gold card | The type of credit card applied for. |
application_method | string | app | Where the application was made. |
PII_type | string | identification card | Type of ID used during application. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("credit_card_type", gold card);
eventValue.put("application_method", app);
eventValue.put("PII_type", identification card);
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "credit_card_application_success", eventValue);
[[AppsFlyerLib shared] logEvent:@"credit_card_application_success"
withValues: @{
@"credit_card_type": @"gold card",
@"application_method": @"app",
@"PII_type": @"identification card"
}];
AppsFlyerLib.shared().logEvent("credit_card_application_success",
withValues: [
"credit_card_type": "gold card",
"application_method": "app",
"PII_type": "identification card"
])
Dictionary<string, string> CreditCardApplicationSuccessEvent = new Dictionary<string, string>();
CreditCardApplicationSuccessEvent.Add("redit_card_type", "gold card");
CreditCardApplicationSuccessEvent.Add("application_method", "app");
CreditCardApplicationSuccessEvent.Add("PII_type", "identificationcard");
AppsFlyer.sendEvent ("credit_card_application_success", CreditCardApplicationSuccessEvent);
Credit card application rejected
Event Name: credit_card_application_rejected
Purpose
You can record a rejected credit card application and compare it with other data to learn more about your users. For example, by recording unsuccessful credit card applications, you can learn how many users apply but are not accepted, and use this information to improve your funnel or retarget the users for other credit cards.
Trigger logic
To record this event properly, you should trigger it when the user's credit card application is rejected.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
credit_card_type | string | gold card | The type of credit card applied for. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("credit_card_type", "gold card");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "credit_card_application_rejected", eventValue);
[[AppsFlyerLib shared] logEvent: @"credit_card_application_rejected"
withValues: @{
"credit_card_type: @"gold card"
}];
AppsFlyerLib.shared().logEvent("credit_card_application_rejected",
withValues: [
"credit_card_type: "gold card"
])
Dictionary<string, string> CreditCardApplicationRejectedEvent = new Dictionary<string, string>();
CreditCardApplicationRejectedEvent.Add("credit_card_type", "gold card");
AppsFlyer.sendEvent ("credit_card_application_rejected", CreditCardApplicationRejectedEvent);
Credit card activation
Event Name: credit_card_activation
Purpose
You can record when a user activates their new credit card and compare it with other data to learn more about your users. For example, by recording credit card activations, you can learn how many users get a credit card but do not bother activating it, and use this information to improve your funnel or retarget the users.
Trigger logic
To properly record this event, you should trigger it when a user activates their new credit card.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
credit_card_type | string | gold card | The type of credit card applied for. |
application_method | string | app | Where the application was made. |
PII_type | string | identification card | Type of ID used during application. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("credit_card_type", gold card);
eventValue.put("application_method", app);
eventValue.put("PII_type", identification card);
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "credit_card_activation", eventValue);
[[AppsFlyerLib shared] logEvent: @"credit_card_activation"
withValues: @{
@"credit_card_type": @"gold card",
@"application_method: @"app",
@"PII_type": @"identification card"
}];
AppsFlyerLib.shared().logEvent("credit_card_activation",
withValues: [
"credit_card_type": "gold card",
"application_method": "app",
"PII_type": "identification card"
])
Dictionary<string, string> CreditCardActivationEvent = new Dictionary<string, string>();
CreditCardActivationEvent.Add("credit_card_type", "gold card");
CreditCardActivationEvent.Add(application_method", "app");
CreditCardActivationEvent.Add(PII_type", "identification_card");
AppsFlyer.sendEvent ("credit_card_activation", CreditCardActivationEvent);
Submit loan application
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 fields
Field name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The ID of the loan |
loan_type | string | housing | The purpose of the loan. |
loan_amount | float | 1000 | The amount requested. |
loan_period | string | 3 months | The loan period. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("loan_id", "1735102");
eventValue.put("loan_type", "housing");
eventValue.put("loam_amount", "1000");
eventValue.put("loan_period", "3 months");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(),"submit_loan_application", eventValue);
[[AppsFlyerLib shared] logEvent: @"submit_loan_application"
withValues: @{
@"loan_id": @"1735102",
@"loan_type": @"housing",
@"loan_amount": @"1000",
@"loan_period": @"3 months"
}];
AppsFlyerLib.shared().logEvent("submit_loan_application",
withValues: [
"loan_id": "1735102",
"loan_type": "housing",
"loan_amount": "1000",
"loan_period": "3 months"
])
Dictionary<string, string> SubmitLoanApplication = new Dictionary<string, string>();
SubmitLoanApplication.Add("loan_id", "1735102");
SubmitLoanApplication.Add("loan_type", "housing");
SubmitLoanApplication.Add("loan_amount", "1000");
SubmitLoanApplication.Add("loan_period", "3 months");
AppsFlyer.sendEvent("submit_loan_application", SubmitLoanApplication);
Loan accepted
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 fields
Field name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The ID of the loan |
loan_type | string | housing | The purpose of the loan. |
loan_amount | float | 1000 | The amount requested. |
loan_period | 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().logEvent(getApplicationContext(),"loan_accepted" , eventValue);
[[AppsFlyerLib shared] logEvent: @"loan_accepted"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @"1000",
@"loan_type": @"3 months"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("loan_accepted", LoanAccepted);
Loan rejected
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 fields
Field name | Type | Example of Value | Description |
---|---|---|---|
loan_id | string | 1735102 | The id of the loan |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("loan_id", "1735102");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "loan_rejected" , eventValue);
[[AppsFlyerLib shared] logEvent:@"loan_rejected"
withValues: @{
@"loan_id": @"1735102",
}];
AppsFlyerLib.shared().logEvent("loan_rejected",
withValues: [
"loan_id": "1735102",
]);
Dictionary<string, string> LoanRejected = new Dictionary<string, string>();
LoanRejected.Add("loan_id", "1735102");
AppsFlyer.sendEvent("loan_rejected", LoanRejected);
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.
Registration submitted
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 fields
Field 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().logEvent(getApplicationContext(), "registration_submitted", eventValue);
[[AppsFlyerLib shared] logEvent:@"registration_submitted"
withValues: @{
AFEventParamRegistrationMethod: @"Facebook",
}];
AppsFlyerLib.shared().logEvent("registration_submitted",
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> RegistrationSubmitted = new Dictionary<string, string>();
RegistrationSubmitted.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent("registration_submitted", RegistrationSubmitted);
Complete registration
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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistration = new Dictionary<string, string>();
CompleteRegistration.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent("af_complete_registration", CompleteRegistration);
Fill loan form
Event Name: fill_loan_form_<FORM_NAME>
Purpose
Borrowers must 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 fields
You can send this event without additional fields.
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().logEvent(getApplicationContext(), "fill_loan_form_FORM_NAME", null);
[[AppsFlyerLib shared] logEvent:@"fill_loan_formFORM_NAME"
withValues: nil];
AppsFlyerLib.shared().logEvent("fill_loan_form_FORM_NAME",
withValues: nil);
AppsFlyer.sendEvent("fill_loan_form_FORM_NAME", null);
Submit loan application
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 fields
Field 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().logEvent(getApplicationContext(),"submit_loan_application", eventValue);
[[AppsFlyerLib shared] logEvent:@"submit_loan_application"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @1000,
@"loan_type": @"3 months"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("submit_loan_application", SubmitLoanApplication);
Loan accepted
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 fields
Field 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().logEvent(getApplicationContext(),"loan_accepted" , eventValue);
[[AppsFlyerLib shared] logEvent:@"loan_accepted"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @1000,
@"loan_type": @"3 months"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("loan_accepted", LoanAccepted);
Loan rejected
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 fields
Field 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().logEvent(getApplicationContext(),loan_rejected" , eventValue);
[[AppsFlyerLib shared] logEvent:@"loan_rejected"
withValues: @{
@"loan_id": @"1735102",
@"loan_amount": @1000,
@"loan_type": @"3 months"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("loan_rejected", LoanRejected);
Payment
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 fields
Field 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().logEvent(
getApplicationContext(),
"payment" , eventValue);
[[AppsFlyerLib shared] logEvent:@"payment"
withValues: @{
@"loan_id": @"1735102",
@"payment_amount": @100,
@"payment_id": @"AE12SF"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("payment", Payment);
Payment completed
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 retarget such borrowers and offer them lower interest fees or other promotions.
Trigger logic
Trigger this event when a loan is fully paid back.
Recommended fields
Field 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().logEvent(getApplicationContext(),"payment_completed" , eventValue);
[[AppsFlyerLib shared] logEvent:@"payment_completed"
withValues: @{
@"loan_id": @"1735102"
}];
AppsFlyerLib.shared().logEvent("payment_completed",
withValues: [
"loan_id": "1735102"
]);
Dictionary<string, string> PaymentCompleted = new Dictionary<string, string>();
PaymentCompleted.Add("loan_id", "1735102");
AppsFlyer.sendEvent("payment_completed", PaymentCompleted);
Online education
Online education apps enable users to learn remotely. The in-app events that we recommend recording in online education apps include registration, tutorials and courses completed, and certificates received. Here are some examples of how recording these events can benefit you:
- Recording in-app registrations helps you understand what courses users want the most and gives you ideas for targeting.
- Recording tutorials completed helps you understand which users can be retargeted and reminded that they have additional tutorials to complete a course.
- Recording certificates received helps you understand which courses and certificates are the most in-demand.
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 fields
This event can be sent without any additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent ("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 fields
Field 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<>();
eventValue.put(AFInAppEventParameterName.registration_method, "Facebook");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.complete_registration, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent ("af_complete_registration", CompleteRegistrationEvent);
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 a field indicating successful tutorial completion.
- When a user starts the tutorial but quits without completing it. When the user quits, an event is sent with a field indicating that the user didn't complete the tutorial.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_success | boolean | yes | Whether the user completed the tutorial or not |
af_tutorial_id | string | 3 | The ID of the tutorial |
af_content | string | algebra | The name of the tutorial |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put(AFInAppEventParameterName.SUCCESS, yes);
eventValue.put(AFInAppEventParameterName.TUTORIAL_ID, "3");
eventValue.put(AFInAppEventParameterName.CONTENT, "algebra");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.TUTORIAL_COMPLETION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventTutorial_completion
withValues: @{
AFEventParamSuccess: @YES,
AFEventParamTutorialId: @"3",
AFEventParamContent: @"algebra"
}];
AppsFlyerLib.shared().logEvent(AFEventTutorial_completion,
withValues: [
AFEventParamSuccess: YES,
AFEventParamTutorialId: "3",
AFEventParamContent: "algebra"
]);
Dictionary<string, string> TutorialCompletiondEvent = new Dictionary<string, string>();
TutorialCompletiondEvent.Add("af_success", "yes");
TutorialCompletiondEvent.Add("af_tutorial_id", "3");
TutorialCompletiondEvent.Add("af_tutorial_content", "algebra");
AppsFlyer.sendEvent ("af_tutorial_completion", TutorialCompletiondEvent);
Complete exercise
Event Name: complete_excercise
Purpose
You can record exercises completed and compare them with other data to learn more about your users. For example, by recording exercise completion events you can learn how many users start but do not finish an exercise.
Trigger logic
The best way to record this event is to trigger it when the user completes an exercise.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
course_name | string | algebra | The name of the course. |
exercise_name | string | 2 | The name of the exercise. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("course_name", "algebra");
eventValue.put("exercise_name", "2");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "complete_exercise", eventValue);
[[AppsFlyerLib shared] logEvent:@"complete_exercise"
withValues: @{
@"course_name": @"algebra",
@"exercise_name": @"2"
}];
AppsFlyerLib.shared().logEvent("complete_exercise",withValues:
["course_name": "algebra","exercise_name": "2" ])
Dictionary<string, string> CompleteExerciseEvent = new Dictionary<string, string>();
CompleteExerciseEvent.Add("course_name", "algebra");
CompleteExerciseEvent.Add("exercise_name", "2");
AppsFlyer.sendEvent ("complete_exercise", CompleteExerciseEvent);
Course completed
Event Name: course_completed
Purpose
You can record course_completed and compare it with other data to learn more about your users. For example, by recording course completion events you can learn how many users start but do not finish a course.
Trigger logic
The best way to record this event is to trigger it when the user completes a course.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
course_name | string | algebra | The name of the course. |
course_completed | string | yes | Whether the course was completed. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("course_name", "algebra");
eventValue.put("course_completed", "yes");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "course_completed", eventValue);
[AppsFlyerLib shared] logEvent:@"course_completed" withValues:@{
@"course_name": @"algebra",
@"course_completed": @"yes"}];
ApAppsFlyerLib.shared().logEvent("course_completed", withValues:
[ "course_name": "algebra",
"course_completed": "yes"])
Dictionary<string, string> CourseCompletedEvent = new Dictionary<string, string>();
CourseCompletedEvent.Add("course_name", "algebra");
CourseCompletedEvent.Add("course_completed", "yes");
AppsFlyer.sendEvent ("course_completed
", CourseCompletedEvent);
Certificate issued
Event Name: certificate_issued
Purpose
You can record certificate_issued and compare it with other data to learn more about your users. For example, by recording certificates issued events you can learn how many users finish a course and retarget them for the next one.
Trigger logic
The best way to record this event is to trigger it when the user is issued a certificate.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
course_name | string | algebra | The name of the course. |
certificate_received | string | yes | Whether the certificate was issued. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("course_name", "algebra");
eventValue.put("certificate_received", "yes");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "certificate issued", eventValue);
[[AppsFlyerLib shared] logEvent:@"course_completed" withValues: @{
@"course_name": @"algebra",
@"certificate_received": @"yes"}];
AppsFlyerLib.shared().logEvent("certificate issued", withValues:
[ "course_name": "algebra",
"certificate_received": "yes"])
Dictionary<string, string> CertificateIssuedEvent = new Dictionary<string, string>();
CertificateIssuedEvent.Add("course_name", "algebra");
CertificateIssuedEvent.Add("certificate_received", "yes");
AppsFlyer.sendEvent ("certificate issued
", CertificateIssuedEvent);
Purchase
Event Name: af_purchase
Purpose
Many online education apps allow users to purchase items (for example, courses, software, or school paraphernalia). 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 on the thank you page after a successful purchase.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 200 | The estimated revenue from the purchase |
af_currency | string | USD | The currency code |
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<>();
eventValue.put(AFInAppEventParameterName.REVENUE, 200);
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "092");
eventValue.put("order_id", "9277");
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "9277");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(),AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventPurchase
withValues: @{
AFEventParamRevenue: @200,
AFEventParamCurrency: @"USD",
AFEventParamContentId: @"092",
@"order_id": @"9277",
AFEventParamReceiptId: @"9277"
}];
AppsFlyerLib.shared().logEvent(AFEventPurchase,
withValues: [
AFEventParamRevenue: 200,
AFEventParamCurrency: "USD",
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_content_id", "001");
purchaseEvent.Add("order_id", "9277");
purchaseEvent.Add("af_receipt_id", "9277");
AppsFlyer.sendEvent ("af_purchase", purchaseEvent);
Navigation: ride-hailing
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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook",
@"country_code": @"66",
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 to their account.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_success | boolean | true | If adding payment method is successful 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().logEvent(getApplicationContext(), AFInAppEventType.ADD_PAYMENT_INFO, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventAddPaymentInfo
withValues: @{
AFEventParamSuccess: @TRUE,
@"credit_card_type": @"Visa",
@"payment_method_type": @"credit card"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("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 fields
Field 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().logEvent(getApplicationContext(), "ride_booking_requested", eventValue);
[[AppsFlyerLib shared] logEvent:@"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"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("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 fields
Field 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().logEvent(getApplicationContext(), "ride_booking_confirmed", eventValue);
[[AppsFlyerLib shared] logEvent:@"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"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("ride_booking_confirmed", RideBookingConfirmedEvent);
Ride booking canceled
Event Name: ride_booking_canceled
Purpose
The Ride booking canceled 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, and so on.
- Learn the reasons why a ride is canceled.
Trigger logic
Trigger this event when the booking is canceled.
Recommended fields
Field 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().logEvent(getApplicationContext(), "ride_booking_canceled", eventValue);
[[AppsFlyerLib shared] logEvent:@"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"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("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, and so on.
- 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 fields
Field 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().logEvent(getApplicationContext(), "ride_booking_completed" , eventValue);
[[AppsFlyerLib shared] logEvent:@"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
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("ride_booking_completed", RideBookingCompletedEvent);
Spent credits
Event Name: spent_credits
Purpose
The Ride booking completed event discussed above has a field called credits_earned
. This field 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 fields
Field 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().logEvent(getApplicationContext(), "spent_credits" , eventValue);
[[AppsFlyerLib shared] logEvent:@"spent_credits"
withValues: @{
AFEventParamContent: @"Single movie ticket",
@"credits_used": @1000,
@"credits_remaining": @2090,
@"invoice_id": @"KO215123SD"
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("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 fields, you can gain insights into:
- Popular destinations
- Popular airlines
- Seasonal trends
Trigger logic
Send this event when the user lands on the thank you page after successfully booking a flight.
Recommended fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.TRAVEL_BOOKING, eventValue);
[[AppsFlyerLib shared] logEvent: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"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventContentView
withValues: @{
AFEventParamDepartingDepartureDate: @"2018-21-06",
AFEventParamReturningDepartureDate: @"2018-26-06",
AFEventParamDestinationA: @"BKK",
AFEventParamDestinationB: @"SYD"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 fields, 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 fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_num_children | int | 0 | How many children will be traveling |
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().logEvent(getApplicationContext(), AFInAppEventType.SEARCH, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventSearch
withValues: @{
AFEventParamNumChildren: @0,
AFEventParamDestinationA: @"BKK",
AFEventParamDestinationB: @"SYD",
AFEventParamDepartingDepartureDate: @"2018-21-06",
AFEventParamReturningDepartureDate: @"2018-26-06",
AFEventParamNumInfants: @0,
AFEventParamNumAdults: @1
}];
AppsFlyerLib.shared().logEvent(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.sendEvent ("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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.ADD_PAYMENT_INFO, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventAddPaymentInfo
withValues: @{
AFEventParamSuccess: @TRUE
}];
AppsFlyerLib.shared().logEvent(AFEventAddPaymentInfo,
withValues: [
AFEventParamSuccess: true
]);
Dictionary<string, string> AddPaymentInfoEvent = new Dictionary<string, string>();
AddPaymentInfoEvent.Add("af_success", "true");
AppsFlyer.sendEvent ("af_add_payment_info", AddPaymentInfoEvent);
First purchase
Event Name: first_purchase
Purpose
This event is the same as a Purchase event. However, unlike a Purchase event, the First Purchase event can be used in order to:
- See how long it takes a new buyer to purchase.
- See what flights 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 fields
Field 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 | flight | Item category |
af_currency | string | AUD | Currency |
af_quantity | int | 1 | Quantity of items in the cart |
af_order_id | string | X123ABC | ID of the order that is generated after purchase. |
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, "flight");
// for multiple product categories set the param value as: new String {"flight", "meal"}
eventValue.put(AFInAppEventParameteName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
// for multiple product categories, set the param value as: new int {1}
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "X123ABC");
eventValue.put("af_order_id", "X123ABC");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "first_purchase", eventValue);
[[AppsFlyerLib shared] logEvent:("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: @[@"flight" , @"meal"]
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2,
// for multiple product categories, set the param value as: @[@1]
AFEventParamOrderId: @"X123ABC",
AFEventParamReceiptId: @"X123ABC"
}];
AppsFlyerLib.shared().logEvent("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: ["flight", "meal"]
AFEventParamCurrency: "USD",
AFEventParamQuantity: 2,
// for multiple product categories, set the param value as: // [1]
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: ["flight", "meal"]
FirstPurchaseEvent.Add("af_currency", "USD");
FirstPurchaseEvent.Add("af_quantity", "2");
// for multiple product categories, set the param value as: [1]
FirstPurchaseEvent.Add("af_order_id", "X123ABC");
FirstPurchaseEvent.Add("af_receipt_id", "X123ABC");
AppsFlyer.sendEvent ("first_purchase", FirstPurchaseEvent);
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 sources 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.
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.
- 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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompletedRegistrationEvent = new Dictionary<string, string>();
CompletedRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent ("af_complete_registration", CompletedRegistrationEvent);
Login
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 fields
This event can be sent without any additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(),
AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin
withValues: nil
];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent ("af_login", null);
Search
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 fields
Field 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().logEvent(getApplicationContext(), AFInAppEventType.SEARCH, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventSearch
withValues: @{
AFEventParamDateA: @"2018/07/26",
AFEventParamDateB: @"2018/08/01",
AFEventParamDestinationA: @"London",
AFEventParamDestinationB: @"Madrid",
AFEventParamNumAdults: @2,
AFEventParamNumChildren: @0
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("af_add_to_wish_list", Search);
Content view
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 fields
Field 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 where 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().logEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
[[AppsFlyerLib shared] logEvent: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"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("af_content_view", ContentView);
Add to wish list
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 fields
Field 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 where 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().logEvent(getApplicationContext(), AFInAppEventType.ADD_TO_WISH_LIST, eventValue);
[[AppsFlyerLib shared] logEvent: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"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("af_add_to_wish_list", AddToWishList);
Initiated Checkout
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 check out (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 fields
Field 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 where 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().logEvent(getApplicationContext(), AFInAppEventType.INITIATED_CHECKOUT, eventValue);
[[AppsFlyerLib shared] logEvent: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"
}];
AppsFlyerLib.shared().logEvent(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.sendEvent("af_initiated_chekcout", InitiatedCheckout);
Travel booking
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 fields
Field 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 where 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().logEvent(getApplicationContext(), "travel_booking", eventValue);
[[AppsFlyerLib shared] logEvent:@"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
}];
AppsFlyerLib.shared().logEvent("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.sendEvent("travel_booking", TravelBooking);
First purchase
Event Name: first_purchase
Purpose
This event is the same as a Purchase event. However, unlike a 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 fields
Field 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 | hotel | Item category |
af_currency | string | AUD | Currency |
af_quantity | int | 1 | Quantity of items in the cart |
af_order_id | string | X123ABC | ID of the order that is generated after purchase. |
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, "hotel");
// for multiple product categories set the param value as: new String {"hotel", "meals"}
eventValue.put(AFInAppEventParameteName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.QUANTITY, 2);
// for multiple product categories, set the param value as: new int {1}
eventValue.put(AFInAppEventParameterName.RECEIPT_ID, "X123ABC");
eventValue.put("af_order_id", "X123ABC");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "first_purchase", eventValue);
[[AppsFlyerLib shared] logEvent:("first_purchase")
withValues: @{
AFEventParamRevenue: @1200,
AFEventParamPrice: @4000,
AFEventParamContentId: @"221",
// for multiple product categories, set the param value as: @[@"221", @"124"]
AFEventParamContentType: @"hotel",
// for multiple product categories, set the param value as: @[@"hotel", @"meals"]
AFEventParamCurrency: @"USD",
AFEventParamQuantity: @2,
// for multiple product categories, set the param value as: @[@1]
AFEventParamOrderId: @"X123ABC",
AFEventParamReceiptId: @"X123ABC"
}];
AppsFlyerLib.shared().logEvent("first_purchase", withValues: [
AFEventParamRevenue: 1200,
AFEventParamPrice: 4000,
AFEventParamContentId: "221",
// for multiple product categories, set the param value as: ["221", "124"]
AFEventParamContentType: "hotel",
// for multiple product categories, set the param value as: ["hotel", "meals"]
AFEventParamCurrency: "USD",
AFEventParamQuantity: 2,
// for multiple product categories, set the param value as: // [1]
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", "hotel");
// for multiple product categories, set the param value as: ["hotel", "meals"]
FirstPurchaseEvent.Add("af_currency", "USD");
FirstPurchaseEvent.Add("af_quantity", "2");
// for multiple product categories, set the param value as: [1]
FirstPurchaseEvent.Add("af_order_id", "X123ABC");
FirstPurchaseEvent.Add("af_receipt_id", "X123ABC");
AppsFlyer.sendEvent ("first_purchase", FirstPurchaseEvent);
Healthcare
Healthcare apps enable users to purchase health insurance, make appointments, receive medical advice, etc. The in-app events that we recommend recording in healthcare apps include purchases and bookings. Here are some examples of how recording these events can benefit you:
- Recording purchases helps you understand which medications are the most necessary and in-demand.
- Recording insurance plans helps you understand what packages users are interested in.
- Recording bookings helps you understand which medical issues users are most concerned about.
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 fields
This event can be sent without any additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent ("af_login", null);
Complete registration
Event Name: 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 fields
Field 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<>();
eventValue.put(AFInAppEventParameterName.REGISTRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent ("af_complete_registration", CompleteRegistrationEvent);
Confirmed appointment
Event Name: confirmed_appointment
Purpose
You can record when a user makes any sort of appointment. This can help you, for example, since when you record appointment confirmation events, you can send these users retargeting ads and reminders for regular checkups and future appointments.
Trigger logic
The best way to record this event is to trigger it when the user makes an appointment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
doctor name | string | Robert James | Name of the doctor |
appointment number | string | 001 | Number of the appointment |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("doctor name", "Robert James");
eventValue.put("appointment number", "001");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "confirmed_appointment", eventValue);
[[AppsFlyerLib shared] logEvent:@"confirmed_appointment" withValues: @{
@"doctor name": @"Robert James",
@"appointment number": @"001"}];
AppsFlyerLib.shared().logEvent("confirmed_appointment", withValues:
[ "doctor name": "Robert James",
"appointment number": "001"])
Dictionary<string, string> ConfirmedAppointmentEvent= new Dictionary<string, string>();
ConfirmedAppointmentEvent.Add("doctor name", "Robert James");
ConfirmedAppointmentEvent.Add("appointment number", "001");
AppsFlyer.sendEvent ("confirmed_appointment", ConfirmedAppointmentEvent);
Canceled appointment
Event Name: canceled_appointment
Purpose
You can record when a user cancels an appointment. This can help you, for example, since when you record appointment cancellation events, you can send these users retargeting ads to reschedule their appointments.
Trigger logic
The best way to record this event is to trigger it when the user cancels an appointment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
doctor name | string | Robert James | Name of the doctor |
appointment number | string | 001 | Number of the appointment |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("doctor name", "Robert James");
eventValue.put("appointment number", "001");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "canceled_appointment", eventValue);
[[AppsFlyerLib shared] logEvent:@"canceled_appointment" withValues: @{
@"doctor name": @"Robert James",
@"appointment number": @"001"}];
AppsFlyerLib.shared().logEvent("canceled_appointment", withValues:
[ "doctor name": "Robert James",
"appointment number": "001"])
Dictionary<string, string> CanceledAppointmentEvent= new Dictionary<string, string>();
CanceledAppointmentEvent.Add("doctor name", "Robert James");
CanceledAppointmentEvent.Add("appointment number", "001");
AppsFlyer.sendEvent ("canceled_appointment", CanceledAppointmentEvent);
Doctor first booking
Event Name: doctor_first_booking
Purpose
You can record when a user booked their first appointment. This can help you, for example, since when you record first appointment events, you can send these users promos/retargeting ads.
Trigger logic
The best way to record this event is to trigger it when the user makes their first appointment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
doctor name | string | Robert James | Name of the doctor |
specialty | string | neurology | Medical specialty |
duration | string | 30 min chat | Amount of time of the appointment |
price | string | 50 | Price of the appointment |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("doctor name", "Robert James");
eventValue.put("specialty", "neurology");
eventValue.put("duration", "30 min chat");
eventValue.put("price", "50");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "doctor_first_booking", eventValue);
[[AppsFlyerLib shared] logEvent:@"doctor_first_booking" withValues: @{
@"doctor name": @"Robert James",
@"specialty": @"neurology",
@"duration": @"30 min chat",
@"price": @"50"}];
AppsFlyerLib.shared().logEvent("doctor_first_booking", withValues:
[ "doctor name": "Robert James",
"specialty": "neurology",
"duration": "30 min chat",
"price": "50"])
Dictionary<string, string> DoctorFirstBookingEvent= new Dictionary<string, string>();
DoctorFirstBookingEvent.Add("doctor name", "Robert James");
DoctorFirstBookingEvent.Add("appointment number", "001");
DoctorFirstBookingEvent.Add("duration", "30 min chat");
DoctorFirstBookingEvent.Add("price", "50");
AppsFlyer.sendEvent ("doctor_first_booking", DoctorFirstBookingEvent);
Lab first appointment
Event Name: lab_first_appointment
Purpose
You can record when a user booked their first lab appointment. This can help you, for example, since when you record first appointment events, you can send these users promos/retargeting ads.
Trigger logic
The best way to record this event is to trigger it when the user makes their first appointment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
lab selection | string | full body checkup | Name of the lab type |
quantity | string | 2 | Amount ordered |
price | string | 500 | Price of the lab |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("lab selection", "full body checkup");
eventValue.put("quantity", "2");
eventValue.put("price", "500");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "lab_first_appointment", eventValue);
[[AppsFlyerLib shared] logEvent:@"lab_first_appointment" withValues: @{
@"lab_selection": @"full body checkup",
@"quantity": @"2",
@"price": @"500"}];
AppsFlyerLib.shared().logEvent("lab_first_appointment", withValues:
[ "lab selection": "full body checkup",
"quantity": "2",
"price": "500"])
Dictionary<string, string> LabFirstAppointmentEvent= new Dictionary<string, string>();
LabFirstAppointmentEvent.Add("lab selection", "full body checkup");
LabFirstAppointmentEvent.Add("quantity", "2");
LabFirstAppointmentEvent.Add("price", "500");
AppsFlyer.sendEvent ("lab_first_appointment", LabFirstAppointmentEvent);
Pharmacy first purchase
Event Name: pharmacy_first_purchase
Purpose
You can record when a user makes their first pharmaceutical purchase. This can help you, for example, since when you record first purchase events, you can send these users promos/retargeting ads.
Trigger logic
The best way to record this event is to trigger it when the user makes their first purchase.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
medicine name | string | rhinos | Name of the medicine |
quantity | string | 1 | Amount ordered |
price | string | 10 | Price of the medicine |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("medicine name", "rhinos");
eventValue.put("quantity", "1");
eventValue.put("price", "10");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "pharmacy_first_purchase", eventValue);
[[AppsFlyerLib shared] logEvent:@"pharmacy_first_purchase" withValues: @{
@"medicine name": @"rhinos",
@"quantity": @"1",
@"price": @"10"}];
AppsFlyerLib.shared().logEvent("pharmacy_first_purchase", withValues:
[ "medicine name": "rhinos",
"quantity": "1",
"price": "10"])
Dictionary<string, string> PharmacyFirstPurchaseEvent= new Dictionary<string, string>();
PharmacyFirstPurchaseEvent.Add("medicine name", "rhinos");
PharmacyFirstPurchaseEvent.Add("quantity", "1");
PharmacyFirstPurchaseEvent.Add("price", "10");
AppsFlyer.sendEvent ("pharmacy_first_purchase", PharmacyFirstPurchaseEvent);
Doctor booking
Event Name: doctor_booking
Purpose
You can record when a user books an in-person appointment with a doctor. This can help you, for example, since when you record these appointment events, it tells you more about your user needs and interests.
Trigger logic
The best way to record this event is to trigger it when the user schedules an in-person appointment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
doctor name | string | Robert James | Name of the doctor |
specialty | string | neurology | Medical specialty |
duration | string | 30 min chat | Amount of time of the appointment |
price | string | 50 | Price of the appointment |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("doctor name", "Robert James");
eventValue.put("specialty", "neurology");
eventValue.put("duration", "30 min chat");
eventValue.put("price", "50");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "doctor_booking", eventValue);
[[AppsFlyerLib shared] logEvent:@"doctor_booking" withValues: @{
@"doctor name": @"Robert James",
@"specialty": @"neurology",
@"duration": @"30 min chat",
@"price": @"50"}];
AppsFlyerLib.shared().logEvent("doctor_booking", withValues:
[ "doctor name": "Robert James",
"specialty": "neurology",
"duration": "30 min chat",
"price": "50"])
Dictionary<string, string> DoctorBookingEvent= new Dictionary<string, string>();
DoctorBookingEvent.Add("doctor name", "Robert James");
DoctorBookingEvent.Add("appointment number", "001");
DoctorBookingEvent.Add("duration", "30 min chat");
DoctorBookingEvent.Add("price", "50");
AppsFlyer.sendEvent ("doctor_booking", DoctorBookingEvent);
Chat doctor
Event Name: chat_doctor
Purpose
If your app lets users schedule live chats with a doctor, you can record when a user booked such a chat. This can help you, for example, since when you record these booking events, it tells you more about your user needs and interests.
Trigger logic
The best way to record this event is to trigger it when the user makes a booking.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
doctor name | string | Robert James | Name of the doctor |
specialty | string | neurology | Medical specialty |
duration | string | 30 min chat | Amount of time of the appointment |
price | string | 50 | Price of the appointment |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("doctor name", "Robert James");
eventValue.put("specialty", "neurology");
eventValue.put("duration", "30 min chat");
eventValue.put("price", "50");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "chat_doctor", eventValue);
[[AppsFlyerLib shared] logEvent:@"chat_doctor" withValues: @{
@"doctor name": @"Robert James",
@"specialty": @"neurology",
@"duration": @"30 min chat",
@"price": @"50"}];
AppsFlyerLib.shared().logEvent("chat_doctor", withValues:
[ "doctor name": "Robert James",
"specialty": "neurology",
"duration": "30 min chat",
"price": "50"])
Dictionary<string, string> ChatDoctorEvent= new Dictionary<string, string>();
ChatDoctorEvent.Add("doctor name", "Robert James");
ChatDoctorEvent.Add("appointment number", "001");
ChatDoctorEvent.Add("duration", "30 min chat");
ChatDoctorEvent.Add("price", "50");
AppsFlyer.sendEvent ("chat_doctor", ChatDoctorEvent);
Lab appointment
Event Name: lab_appointment
Purpose
You can record when a user booked a lab appointment. This can help you, for example, since when you record appointment events, you can send these users promos/retargeting ads.
Trigger logic
The best way to record this event is to trigger it when the user makes a lab appointment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
lab selection | string | full body checkup | Name of the lab type |
quantity | string | 2 | Amount ordered |
price | string | 500 | Price of the lab |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("lab selection", "full body checkup");
eventValue.put("quantity", "2");
eventValue.put("price", "500");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "lab_appointment", eventValue);
[[AppsFlyerLib shared] logEvent:@"lab_appointment" withValues: @{
@"lab_selection": @"full body checkup",
@"quantity": @"2",
@"price": @"500"}];
AppsFlyerLib.shared().logEvent("lab_appointment", withValues:
[ "lab selection": "full body checkup",
"quantity": "2",
"price": "500"])
Dictionary<string, string> LabAppointmentEvent= new Dictionary<string, string>();
LabAppointmentEvent.Add("lab selection", "full body checkup");
LabAppointmentEvent.Add("quantity", "2");
LabAppointmentEvent.Add("price", "500");
AppsFlyer.sendEvent ("lab_appointment", LabAppointmentEvent);
Pharmacy purchase
Event Name: pharmacy_purchase
Purpose
You can record when a user makes a pharmaceutical purchase. This can help you, for example, since when you record purchase events, you can send these users promos/retargeting ads.
Trigger logic
The best way to record this event is to trigger it when the user makes a pharmaceutical purchase.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
medicine name | string | rhinos | Name of the medicine |
quantity | string | 1 | Amount ordered |
price | string | 10 | Price of the medicine |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("medicine name", "rhinos");
eventValue.put("quantity", "1");
eventValue.put("price", "10");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "pharmacy_purchase", eventValue);
[[AppsFlyerLib shared] logEvent:@"pharmacy_purchase" withValues: @{
@"medicine name": @"rhinos",
@"quantity": @"1",
@"price": @"10"}];
AppsFlyerLib.shared().logEvent("pharmacy_purchase", withValues:
[ "medicine name": "rhinos",
"quantity": "1",
"price": "10"])
Dictionary<string, string> PharmacyPurchaseEvent= new Dictionary<string, string>();
PharmacyPurchaseEvent.Add("medicine name", "rhinos");
PharmacyPurchaseEvent.Add("quantity", "1");
PharmacyPurchaseEvent.Add("price", "10");
AppsFlyer.sendEvent ("pharmacy_purchase", PharmacyPurchaseEvent);
Add to cart
Event Name: add_to_cart
Purpose
You can record when a user adds a medication to their shopping cart. This can help you, for example, since when you record add-to-cart events, you can send these users promos/reminders to checkout and complete the purchase.
Trigger logic
The best way to record this event is to trigger it when the user adds a product to their shopping cart.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
medicine name | string | rhinos | Name of the medicine |
quantity | string | 1 | Amount ordered |
price | string | 10 | Price of the medicine |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("medicine name", "rhinos");
eventValue.put("quantity", "1");
eventValue.put("price", "10");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "add_to_cart", eventValue);
[[AppsFlyerLib shared] logEvent:@"add_to_cart" withValues: @{
@"medicine name": @"rhinos",
@"quantity": @"1",
@"price": @"10"}];
AppsFlyerLib.shared().logEvent("add_to_cart", withValues:
[ "medicine name": "rhinos",
"quantity": "1",
"price": "10"])
Dictionary<string, string> AddToCartEvent= new Dictionary<string, string>();
AddToCartEvent.Add("medicine name", "rhinos");
AddToCartEvent.Add("quantity", "1");
AddToCartEvent.Add("price", "10");
AppsFlyer.sendEvent ("add_to_cart", AddToCartEvent);
Insurance membership
Event Name: insurance_membership
Purpose
If your app partners with an insurer to provide insurance options, you can record when a user registers for insurance. This can help you, for example, since when you record insurance membership registration events, you learn more about your users and can retarget them accordingly.
Trigger logic
The best way to record this event is to trigger it when the user gets an insurance membership.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
insurance name | string | DavidShield | Name of the insurance company |
insurance type | string | premium | Type of insurance plan |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("insurance name", "DavidShield");
eventValue.put("insurance type", "premium");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "insurance_membership", eventValue);
[[AppsFlyerLib shared] logEvent:@"insurance_membership" withValues: @{
@"insurance name": @"DavidShield",
@"insurance type": @"premium"}];
AppsFlyerLib.shared().logEvent("insurance_membership", withValues:
[ "insurance name": "DavidShield",
"insurance type": "premium"])
Dictionary<string, string> InsuranceMembershipEvent= new Dictionary<string, string>();
InsuranceMembershipEvent.Add("insurance name", "DavidShield");
InsuranceMembershipEvent.Add("insurance type", "premium");
AppsFlyer.sendEvent ("insurance_membership", InsuranceMembershipEvent);
Receipt issuance
Event Name: receipt_issuance
Purpose
Record when your users receive receipts. Users with a receipt can potentially claim the cost of the doctor's appointment, lab, or medicine from an insurer. And this can help you, for example, since when you record receipt issuance events, you use the data for retargeting campaigns about personal insurance coverage.
Trigger logic
The best way to record this event is to trigger it when the user gets a receipt.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
app name | string | Healthcare App | Name of your app |
doctor name | string | Robert James | Name of the doctor |
consultation description | string | fever | Description of the health condition |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("app name", "Healthcare App");
eventValue.put("doctor name", "Robert James");
eventValue.put("consultation description", "fever");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "receipt_issuance", eventValue);
[[AppsFlyerLib shared] logEvent:@"receipt_issuance" withValues: @{
@"app name": @"Healthcare App",
@"doctor name": @"Robert James",
@"consultation description": @"fever"}];
AppsFlyerLib.shared().logEvent("receipt_issuance", withValues:
[ "app name": "Healthcare App",
"insurance name": "Robert James",
"insurance type": "fever"])
Dictionary<string, string> ReceiptIssuanceEvent= new Dictionary<string, string>();
ReceiptIssuanceEvent.Add("app name", "Healthcare App");
ReceiptIssuanceEvent.Add("doctor name", "Robert James");
ReceiptIssuanceEvent.Add("consultation description", "fever");
AppsFlyer.sendEvent ("receipt_issuance", ReceiptIssuanceEvent);
Purchase
Event Name: af_purchase
Purpose
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 on the thank you page after a successful purchase.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 50 | The revenue from the purchase |
af_currency | string | USD | The currency code |
af_content_type | string | lab | The name of the purchase |
af_order_id | string | 9277 | The order ID |
payment_method_type | string | credit card, local | Payment method |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put(AFInAppEventParameterName.REVENUE, 50);
eventValue.put(AFInAppEventParameterName.CURRENCY, "USD");
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "lab");
eventValue.put("AFInAppEventParameterName.ORDER_ID", "9277");
eventValue.put("payment_method_type", "credit card");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(),AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventPurchase
withValues: @{
AFEventParamRevenue: @50,
AFEventParamCurrency: @"USD",
AFEventParamContentType: @"lab",
AFEventParamContentTypeOrderId: @"9277",
@"payment_method_type": @"credit card"
}];
AppsFlyerLib.shared().logEvent(AFEventPurchase,
withValues: [
AFEventParamRevenue: 50,
AFEventParamCurrency: "USD",
AFEventParamContentType: "lab",
AFEventParamContentTypeOrderId: "9277",
"payment_method_type": "credit card",
]);
Dictionary<string, string> purchaseEvent = new Dictionary<string, string>();
purchaseEvent.Add("af_revenue", "50");
purchaseEvent.Add("af_currency", "USD");
purchaseEvent.Add("af_content_type", "lab");
purchaseEvent.Add("af_order_id", "9277");
purchaseEvent.Add("payment_method_type", "credit card");
AppsFlyer.sendEvent ("af_purchase", purchaseEvent);
Top-up success
Event Name: af_top_up_success
Purpose
Top-up funds can be used to buy any package or service offered inside the app. You can record user top-ups and compare it with other data to learn more about your users. By recording user top-up events you can:
- Learn what amounts people are willing to deposit into their accounts.
- Use the top-up amounts to target users with customized campaigns within their top-up budgets.
Trigger logic
To record this event properly, you should trigger it when the user completes the top-up.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | string | 2000 | The amount of the top-up |
top_up_id | string | 397 | The ID of the top-up |
payment_method_type | string | credit card, local payment | Payment method used |
Code Examples
Map<String, Object> eventValue = new HashMap<>();eventValue.put(AFInAppEventParameterName.REVENUE, 2000); eventValue.put("TOP_UP_ID", "397"); eventValue.put("PAYMENT_METHOD_TYPE", "creditcard");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.AF_TOP_UP_SUCCESS, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventTopUpSuccess
withValues: @{
AFEventParamRevenue: @2000,
@"top_up_id": @"397",
@"payment_method_type": @"credit card"
}];
AppsFlyerLib.shared().logEvent(AFEventTopUpSuccess,
withValues: [
AFEventParamRevenue: 2000,
"top_up_id": "397",
"payment_method_type": "credit card",
]);
Dictionary<string, string> TopUpSuccessEvent = new Dictionary<string, string>();
TopUpSuccessEvent.Add("af_revenue", "2000");
TopUpSuccessEvent.Add("top_up_id", "397");
TopUpSuccessEvent.Add("payment_method_type", "credit card");
AppsFlyer.sendEvent ("af_top_up_success", TopUpSuccessEvent);
Telecommunication
Telecommunication apps enable users to purchase and manage cell phone plans, data plans, etc. The in-app events that we recommend recording in telecommunication apps include purchases, top-ups, and subscriptions. Here are some examples of how recording these events can benefit you:
- Recording purchases helps you understand which gateway plans are most popular.
- Recording top-ups helps you understand what products or packages users can afford.
- Recording subscriptions helps you understand which plans are most likely to get long-term commitments from customers.
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 fields
This event can be sent without any additional fields.
Code Examples
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.LOGIN, null);
[[AppsFlyerLib shared] logEvent:AFEventLogin withValues: nil];
AppsFlyerLib.shared().logEvent(AFEventLogin, withValues: nil);
AppsFlyer.sendEvent ("af_login", null);
Purchase
Event Name: af_purchase
Purpose
Many telecommunications apps allow users to purchase items, (for example, extra data). 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 on the thank you page after a successful purchase.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | float | 2000 | The estimated revenue from the purchase |
af_currency | string | THB | The currency code |
af_content_type | string | 5G | The name of the package bought. |
af_order_id | string | 9277 | The order ID |
payment_method_type | string | credit card, local payment | Type of payment method |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put(AFInAppEventParameterName.REVENUE, 2000);
eventValue.put(AFInAppEventParameterName.CURRENCY, "THB");
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "5G");
eventValue.put("AFInAppEventParameterName.ORDER_ID", "9277");
eventValue.put("payment_method_type", "credit_card");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(),AFInAppEventType.PURCHASE, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventPurchase
withValues: @{
AFEventParamRevenue: @2000,
AFEventParamCurrency: @"THB",
AFEventParamContentType: @"5G",
AFEventParamContentTypeOrderId: @"9277",
@"payment_method_type": @"credit_card"
}];
AppsFlyerLib.shared().logEvent(AFEventPurchase,
withValues: [
AFEventParamRevenue: 2000,
AFEventParamCurrency: "THB",
AFEventParamContentType: "5G",
AFEventParamContentTypeOrderId: "9277",
"payment_method_type": "credit_card",
]);
Dictionary<string, string> purchaseEvent = new Dictionary<string, string>();
purchaseEvent.Add("af_revenue", "2000");
purchaseEvent.Add("af_currency", "THB");
purchaseEvent.Add("af_content_type", "5G");
purchaseEvent.Add("af_order_id", "9277");
purchaseEvent.Add("payment_method_type", "credit_card");
AppsFlyer.sendEvent ("af_purchase", purchaseEvent);
Complete registration
Event Name: 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 fields
Field 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<>();
eventValue.put(AFInAppEventParameterName.REGISTRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventCompleteRegistration
withValues: @{
AFEventParamRegistrationMethod: @"Facebook"
}];
AppsFlyerLib.shared().logEvent(AFEventCompleteRegistration,
withValues: [
AFEventParamRegistrationMethod: "Facebook"
]);
Dictionary<string, string> CompleteRegistrationEvent = new Dictionary<string, string>();
CompleteRegistrationEvent.Add("af_registration_method", "Facebook");
AppsFlyer.sendEvent ("af_complete_registration", CompleteRegistrationEvent);
Top-up success
Event Name: af_top_up_success
Purpose
Top-up funds can be used to buy any package or any other service offered inside the app. You can record user top-ups and compare them with other data to learn more about your users. By recording user top-up events you can:
- Learn what amounts people are willing to deposit into their accounts.
- Use the top-up amounts to target users with customized campaigns within their top-up budgets.
Trigger logic
To record this event properly, you should trigger it when the user completes the top-up.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_revenue | string | 2000 | The amount of the top-up |
top_up_id | string | 397 | The ID of the top-up |
payment_method_type | string | credit card, local payment | Payment method used |
Code Examples
Map<String, Object> eventValue = new HashMap<>();eventValue.put(AFInAppEventParameterName.REVENUE, 2000); eventValue.put("TOP_UP_ID", "397"); eventValue.put("PAYMENT_METHOD_TYPE", "credit_card");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.AF_TOP_UP_SUCCESS, eventValue);
[[AppsFlyerLib shared] logEvent:AFEventTopUpSuccess
withValues: @{
AFEventParamRevenue: @2000,
@"top_up_id": @"397",
@"payment_method_type": @"credit_card"
}];
AppsFlyerLib.shared().logEvent(AFEventTopUpSuccess, tele
withValues: [
AFEventParamRevenue: 2000,
"top_up_id": "397",
"payment_method_type": "credit_card",
]);
Dictionary<string, string> TopUpSuccessEvent = new Dictionary<string, string>();
TopUpSuccessEvent.Add("af_revenue", "2000");
TopUpSuccessEvent.Add("top_up_id", "397");
TopUpSuccessEvent.Add("payment_method_type", "credit_card");
AppsFlyer.sendEvent ("af_top_up_success", TopUpSuccessEvent);
Top-up unsuccessful
Event Name: af_top_up_unsuccessful
Purpose
You can record unsuccessful top-up events and compare them with other data to learn more about your users. For example, by recording unsuccessful top-ups you can learn how many users try to top-up but fail.
Trigger logic
The best way to record this event is to trigger it when the user tries to top up but the action fails.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
error_reason | string | exceeded_daily_limit | The reason for the top-up failure. |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("error_reason", "exceeded_daily_limit");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "af_top_up_unsuccessful", eventValue);
[[AppsFlyerLib shared] logEvent:@"af_top_up_unsuccessful" withValues: @{
@"error_reason": @"exceeded_daily_limit"}];
AppsFlyerLib.shared().logEvent("af_top_up_unsuccessful",withValues:
["error_reason": "exceeded_daily_limit" ])
Dictionary<string, string> TopUpUnsuccessfulEvent = new Dictionary<string, string>();
ErrorReasonEvent.Add("error_reason", "exceeded_daily_limit");
AppsFlyer.sendEvent ("af_top_up_unsuccessful
", TopUpUnsuccessfulEvent);
Subscription complete
Event Name: af_subscription_complete
Purpose
By recording user subscription events you can:
- See which campaigns bring users that subscribe
- Compare the number of subscribed users against unsubscribed 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
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
af_subscription_type | string | Monthly 30 GB | Type of subscription |
af_revenue | string | 555 | Amount of the subscription |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("af_subscription_type", "Monthly 30 GB");
eventValue.put("af_revenue", "555");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "af_subscription_complete", eventValue);
[AppsFlyerLib shared] logEvent:@"af_subscription_complete" withValues:@{
@"af_subscription_type": @"Monthly 30 GB",
@"af_revenue": @"555"}];
ApAppsFlyerLib.shared().logEvent("af_subscription_complete", withValues:
[ "af_subscription_type": "Monthly 30 GB",
"af_revenue": "555"])
Dictionary<string, string> SubscriptionCompleteEvent = new Dictionary<string, string>();
SubscriptionCompleteEvent.Add("af_subscription_type", "Monthly 30 GB");
SubscriptionCompleteEvent.Add("af_revenue", "555");
AppsFlyer.sendEvent ("af_subscription_complete", SubscriptionCompleteEvent);
Select package
Event Name: select_package
Purpose
You can record when a user decides to buy a package but has not made the payment yet. This can help you, for example, since when you record package selection events, you can send these users retargeting ads and reminders to complete their subscriptions.
Trigger logic
The best way to record this event is to trigger it when the user selects a package but has not completed payment.
Recommended fields
Field name | Type | Example of Value | Description |
---|---|---|---|
price | string | 50000 | The price of the subscription |
af_content_type | string | Data 5 GB | Whether the certificate was issued |
Code Examples
Map<String, Object> eventValue = new HashMap<>();
eventValue.put("price", "50000");
eventValue.put("af_content_type ", "Data 5 GB ");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), "select_package", eventValue);
[[AppsFlyerLib shared] logEvent:@"select_package" withValues: @{
@"price": @"50000",
@"af_content_type ": @"Data 5 GB "}];
AppsFlyerLib.shared().logEvent("select_package", withValues:
[ "price": "50000",
"af_content_type ": "Data 5 GB "])
Dictionary<string, string> SelectPackageEvent= new Dictionary<string, string>();
SelectPackageEvent.Add("price", "50000");
SelectPackageEvent.Add("af_content_type ", "Data 5 GB ");
AppsFlyer.sendEvent ("select_package", SelectPackageEvent);