Recommended flight booking app events

At a glance: Measure the quality of your users throughout their user journey by recording these suggested in-app events for your flight booking app.

InApp_Events_flight.png Flight booking

Flight booking apps allow travelers to easily book flights while choosing from the best offers. The typical events that we suggest recording are booking a flight, searching for flights, and viewing offers. 

Recording events can help you:

  • Learn about popular destinations
  • Analyze seasonal trends
  • Learn about popular airlines that users prefer to travel with

 Important!

  • Make sure to read the instructions for marketers about implementing in-app events.
  • To streamline the implementation process, download a CSV file that includes all of the typical in-app events described in this article, and then modify the events according to your business needs. Once complete, share the file with your developer.
  • For each recommended event included in this article, there are code samples for iOS, Android, and Unity developers.
  • Detailed instructions for your developer can be found in the AppsFlyer developer hub.

For more information about recording in-app events, see the Rich in-app events guide.

Flowchart_for_recommended_events flight_booking_app_user_journey

Recommended structures for predefined events

The following section provides a list of event structures that are typical to the flight booking vertical. Each structure includes a predefined event name and the suggested event parameters to use. Note that in-app events can include any event parameters that meet your business needs.

Complete registration (af_complete_registration)

Purpose

Learn how many users installed the app and completed the signup process, what signup methods your users prefer.

Trigger

When the user completes the signup process

Event parameters

Field name Description Example value
af_registration_method Type of signup method email, Facebook

Code examples

Android iOS - Objective C iOS - Swift Unity
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REGSITRATION_METHOD, "Facebook");
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.COMPLETE_REGISTRATION, eventValue);

Login (af_login)

Purpose

Understand the retention of your registered users

Trigger 

When the user successfully logs in

Event parameters

Can be sent without any additional parameters

Code examples

Android iOS - Objective C iOS - Swift Unity
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), 
AFInAppEventType.LOGIN, null);

Travel booking (af_travel_booking)

Purpose

The ability to book flights is the core function of the app. This event can help you determine:

  • Popular destinations
  • Popular airlines
  • Seasonal trends

Trigger 

When the user lands on the thank you page after successfully booking a flight

Event parameters

Name Description Example value
af_revenue Revenue associated with booking 647.99
af_currency Currency code SGD
af_price Price 674
af_content_id ID of the flight offer ODIRNH
af_departing_departure_date Departure date 2018-06-21
af_returning_departure_date Return date 2018-06-26
af_destination_a First destination BKK
af_destination_b Second destination (if applicable) SYD
airline_code Code of the airline company KLM
af_class Class the flight is booked to economy
purchase_method Method used for the purchase credit card

Code examples

Android iOS - Objective C iOS - Swift Unity
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REVENUE, 647.99);
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);

Content view (af_content_view)

Purpose

This event can help you determine:

  • What flight offers users find most appealing
  • Whether search results are relevant to search queries

Trigger 

When a user clicks a search result

Event parameters

Name Description Example value
af_departing_departure_date Departure date 2018-06-21
af_returning_departure_date Return date 2018-06-26
af_destination_a First destination BKK
af_destination_b Second destination (if applicable) SYD

Code examples

Android iOS - Objective C iOS - Swift Unity
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);

Search (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. This event can help you:

  • Learn what users are 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

After the user fills in the search form and clicks the search button 

Event parameters

Name Description Example value
af_num_children Number of children that are traveling 0
af_destination_a First destination BKK
af_destination_b Second destination (if relevant) SYD
af_departing_departure_date Departure date 2018-06-21
af_returning_departure_date Return date 2018-06-26
af_num_infants Number of infants that are traveling 0
af_num_adults Number of  adults that are traveling 1

Code examples

Android iOS - Objective C iOS - Swift Unity
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);

Add payment info (af_add_payment_info)

Purpose

Record successful and unsuccessful attempts at adding payment info when booking a flight.

Trigger 

When a user clicks on the book a flight button

Event parameters

Name Description Example value
af_success Whether adding payment method is successful  true

Code examples

Android iOS - Objective C iOS - Swift Unity
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.SUCCESS, true);
AppsFlyerLib.getInstance().logEvent(getApplicationContext(), AFInAppEventType.ADD_PAYMENT_INFO, eventValue);

Purchase (af_purchase)

Purpose

Learn about purchase trends in your flight booking app. This event can help you:

  • 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

When the user lands on the thank you page after a successful purchase

Event parameters

Name Description Example value
af_revenue Estimated revenue from the purchase 1205.99
af_price Overall purchase sum 4000
af_content_id Item ID 121
af_content_type Item category flight
af_currency Currency code AUD
af_quantity Number of items in the cart 1
af_order_id ID of the order that is generated after the purchase X123ABC
af_receipt_id Order ID, required for CRITEO and Google Ad Words retargeting integration X123ABC

Code examples

Android iOS - Objective C iOS - Swift Unity
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 4000);
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "121");
// for multiple product categories, set the param value as: // new String {"121", "262"}
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE, "flight");
// for multiple product categories,, set the param value as: new String {"flight", "meals"}
eventValue.put(AFInAppEventParameterName.CURRENCY, "AUD");
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);

Recommended structures for custom events

The following section provides a list of event structures that include custom event names and the suggested event parameters to use. Note that in-app events can include any event parameters that meet your business needs.

First purchase (first_purchase)

Purpose

Same as the Purchase event. In addition, this event can help you determine:

  • How long it takes a new buyer to purchase
  • What flights first-time buyers prefer to purchase
  • The average price and revenue of first-time purchases

Trigger 

When the user completes their first purchase

Event parameters

Name Description Example value
af_revenue Revenue from purchase 1205.99
af_price Overall purchase sum 4000
af_content_id Item ID 121, 262
af_content_type Item category flight
af_currency Currency AUD
af_quantity Quantity of items in the cart 1
af_order_id ID of the order that is generated after purchase X123ABC
af_receipt_id

Order ID, required for CRITEO and Google AdWords retargeting integration

X123ABC

Code examples

Android iOS - Objective C iOS - Swift Unity
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.PRICE, 4000);
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);
Was this article helpful?