1. Home
  2. Integrations
  3. Android Unity Events Setup Guide
  4. Travel Applications – Android Unity

Travel Applications – Android Unity

We have provided a list of Events with their example usage that can be integrated for Applications that belong to the Travel Vertical. Please find them below:

1. Reservation Event

This is used to track the event triggered when an user has completed a Travel Booking on your Application.

You will need to call the below method to track the Reservation event in your Application.

Java

public static void TrackReservation (string userID, string category, string dateFrom, string locationFrom, float revenue, PaymentMode paymentMode, string transactionId, string languageCode, string countryCode, Dictionary<string, object> extraParamsDic);

 

  • Mandatory parameters (Reservation):                              
    • User Id – Unique User Identifier
    • Category – Travel Category
    • Date From – Travel Booking starting date
    • Location From – Location from which the travel will start
    • Revenue – Revenue generated from this Reservation event
    • Language Code – Revenue generated from this Reservation event
    • Country Code – Unique country code Note: For passing custom language Code currency code. Please Click here to view list of country codes.
    • (ISO-3166) & Language codes (ISO-639).   Follow the sample below.   
    • Example : Locale *languageCode = ”JP” Locale *currencyCode = ”JP”
    • Payment Mode –  CREDIT_CARD or DEBIT_CARD or NET_BANKING or GIFT_CARD or PAYMENT_WALLET
    • Transaction Id – Reservation Transaction Identifier
  • Optional parameters (Reservation):                              
    • Identifier – Unique Event Identifier
    • Product Name – Name of the Travel Product
    • Date To – Travel Booking end date
    • Location To – Location from which the travel will start
    • Loyalty – Loyalty points applied on the booking
    • Class – Class of Travel
    • Brand – Brand information(if any) on the Travel booking
    • Discount – Discount applied for the Travel booking
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

String dateTo = DateTime.ParseExact (“2017-06-07 11:45:35”, “yyyy-MM-dd HH:mm:ss”, null).ToString (“yyyy-MM-dd HH:mm:ss”);

       Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.IDENTIFIER, “SINDEL12301”);
       extrasParams.Add (EventConstant.PRODUCT_NAME, “SIN-DEL Flights”);
       extrasParams.Add (EventConstant.DATE_TO, _dateTo);
       extrasParams.Add (EventConstant.LOCATION_TO, “New Delhi”);
       extrasParams.Add (EventConstant.LOYALTY, 850.00);
       extrasParams.Add (EventConstant.CLASS, “economy”);
       extrasParams.Add (EventConstant.BRAND, “Singapore Airlines”);
       extrasParams.Add (EventConstant.DISCOUNT, 5.00);
       extrasParams.Add (EventConstant.PAGE_NAME, “Flight Itinerary”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       String dateFrom = DateTime.ParseExact (“2017-06-07 11:45:35”, “yyyy-MM-dd HH:mm:ss”, null).ToString (“yyyy-MM-dd HH:mm:ss”);

MTractionTracker.TrackReservation (“123”, “Flights”, _dateFrom, “Singapore”, 535.00f, PaymentMode.CREDIT_CARD, “123456”, “JP”, “JP” extrasParams);

2. Reservation Cancelled Event

This is used to track booking cancellation done by an user in a Travel Application.

You will need to call the below method to track the reservation cancelled event in your Application.

Java

public static void TrackCancelReservation (string userID, string category, string dateFrom, string locationFrom, float refundAmount, string languageCode, string countryCode, Dictionary<string, object> extraParamsDic);

 

  • Mandatory parameters (Reservation Cancelled):                               
    • User Id – Unique User Identifier
    • Category – Travel Category
    • Date From – Travel Booking starting date
    • Location From – Location from which the travel will start
    • Refund Amount – Amount to be refunded on cancellation of the Reservation
    • Language Code – Revenue generated from this Reservation event
    • Country Code – Unique country code Note: For passing custom language Code currency code. Please Click here to view list of country codes.
    • (ISO-3166) & Language codes (ISO-639).   Follow the sample below.   
    • Example : Locale *languageCode = ”JP” Locale *currencyCode = ”JP”
  • Optional parameters (Reservation Cancelled):                               
    • Identifier – Unique Event Identifier
    • Brand – Brand information(if any) on the Travel booking
    • Product Name – Name of the Travel Product
    • Date To – Travel Booking end date
    • Location To – Location from which the travel will start
    • Class – Class of Travel booking
    • Transaction Id – Unique Transaction Identifier of the Reservation
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

String dateTo = DateTime.ParseExact (“2017-06-07 11:45:35”, “yyyy-MM-dd HH:mm:ss”, null).ToString (“yyyy-MM-dd HH:mm:ss”);

       Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.IDENTIFIER, “100001”);
       extrasParams.Add (EventConstant.BRAND, “ITC Hotels”);
       extrasParams.Add (EventConstant.PRODUCT_NAME, “ITC Sheraton New Delhi”);
       extrasParams.Add (EventConstant.DATE_TO, _dateTo);
       extrasParams.Add (EventConstant.LOCATION_TO, “New Delhi”);
       extrasParams.Add (EventConstant.CLASS, “Business Suite”);
       extrasParams.Add (EventConstant.TRANSACTION_ID, “789456123”);
       extrasParams.Add (EventConstant.PAGE_NAME, “Cancel Booking”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       String dateFrom = DateTime.ParseExact (“2017-06-07 11:45:35”, “yyyy-MM-dd HH:mm:ss”, null).ToString (“yyyy-MM-dd HH:mm:ss”);

MTractionTracker.TrackCancelReservation (“123”, “Hotels in India”, _dateFrom, “Singapore”, 300.00f, “JP”, “JP” extrasParams);

3. Travel Compare Event

This is used to track the Travel Itinerary Comparison event which lets the users compare various travel options available in the Application.

You will need to call the below method to track the Travel Compare event in your Application.

Java

public static void TrackProductCompared (string userID, Dictionary<string, Dictionary<string, object>> prodCompItemList, Dictionary<string, object> extraParams);

 

// Product List Array Definition

Dictionary<string, Dictionary<string, object>>
prodCompItems = new Dictionary<string, Dictionary
<string, object>> ();

 

// Product Array Definition

HTML

Dictionary<string, object> prodCompItem1 = new Dictionary<string, object> ();

 

  • Mandatory parameters (Product Compared Item):                               
    • Identifier – Unique Product Identifier
    • Product Name – Name of the Product
    • Price – Price of the Product
  • Optional parameters (Product Compared Item):                               
    • Brand – Brand Name of the Travel Product
    • Product Discount – Discount applied for the Travel booking
    • Tier – Class of Travel

 

// How to create Product Compare List Array

HTML

Dictionary<string, Dictionary<string, object>> prodCompItems = new Dictionary<string, Dictionary<string, object>> ();
Dictionary<string, object> prodCompItem1 = new Dictionary<string, object> ();
Dictionary<string, object> prodCompItem2 = new Dictionary<string, object> ();

 

 

 

// Adding the items  to the Product Compare List Array

productList.Add ((EventConstant.PRODUCTCOMPARED_ITEM + “1”), product1);
productList.Add ((EventConstant.PRODUCTCOMPARED_ITEM + “2”), product2);

Note:Add items to the list by concatenation of incremental value with PRODUCTCOMPARED_ITEM constant as shown in above example.

  • Mandatory parameters (Product Compared):                               
    • User Id – Unique User Identifier
    • Product List – Array of the list of products initiated for Checkout
  • Optional parameters (Product Compared):                               
    • Category – Category of the Travel
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

 

Sample Code

Dictionary<string, Dictionary<string, object>> prodCompItems = new Dictionary<string, Dictionary<string, object>> ();
       Dictionary<string, object> prodCompItem1 = new Dictionary<string, object> ();
       prodCompItem1.Add (EventConstant.IDENTIFIER, “12345”);
       prodCompItem1.Add (EventConstant.PRODUCT_NAME, “Targus Backpack”);
       prodCompItem1.Add (EventConstant.PRICE, 29.99);
       prodCompItem1.Add (EventConstant.TIER, “Bags for Macbook”); // Optional parameter
       prodCompItem1.Add (EventConstant.BRAND, “Targus”); // Optional parameter
       prodCompItem1.Add (EventConstant.PRODUCT_DISCOUNT, 5.00); // Optional parameter

       prodCompItems.Add ((EventConstant.PRODUCTCOMPARED_ITEM + “1”), prodCompItem1);

       Dictionary<string, object> extrasParams = new Dictionary<string, object> ();    
       extrasParams.Add (EventConstant.CATEGORY, “Bags”);
       extrasParams.Add (EventConstant.PAGE_NAME, “Compare Products”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackProductCompared (“123”, prodCompItems, extrasParams);

 

 

 

Was this article helpful to you? Yes No

How can we help?