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

Travel Applications – Android Phonegap

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.

trackReservation: function(userID,category,identifier,productName,locationFrom,locationTo,
revenue,loyalty,brand,discount,transactionId,pageName,cclass,latitude,
longitude,paymentMode,dateFrom,dateTo,languageCode,countryCode)

  • 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

<script>
function convertDateFormat (){
    var e1 = “DateTime”;
    if(e1!=""){
        var d1 = new Date(e1),
        d1format = [d1.getFullYear(),d1.getMonth()+1,
                    d1.getDate()
                    ].join('-')+' '+
                    [d1.getHours(),
                     d1.getMinutes(),
                     d1.getSeconds()].join(':');
                     dateFrom/dateTo = d1format;
    }}
</script>

Track Reservation Call

<script>

function trackReservation(){
mtractiontracker.trackReservation(“123”,”Flights,”SINDEL12301”,”SIN-DEL Flights”,”Singapore”,”New Delhi”,535.00,850.00,”Singapore Airlines”,5.00,”123456”,”Flight Itinerary”,35.01,70.01,”NET_BANKING”,”dateFrom”,”dateTo”,”economy”,”JP”,”JP”);

}</script>


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.

trackCancelReservation: function(userID,category,cclass,identifier,brand,productName,locationFrom,locationTo,refundAmount,transactionId,pageName,latitude,longitude,dateFrom,dateTo,languageCode,countryCode)

  • 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

<script>
function convertDateFormat(){
    var e1 = “2017-01-20 10:10:10”;
    if(e1!=""){
        var d1 = new Date(e1),
        d1format = [d1.getFullYear(),d1.getMonth()+1,
                    d1.getDate()
                    ].join('-')+' '+
                    [d1.getHours(),
                     d1.getMinutes(),
                     d1.getSeconds()].join(':');
                     dateFrom/dateTo = d1format;
    }}
</script>

Track Cancel Reservation Call

<script>

function trackCancelReservation(){
mtractiontracker.trackCancelReservation(“123”,”Hotels in India”,”100001”,”ITC Hotels”,”ITC Sheraton New Delhi”,”Singapore”,”New Delhi”,300.00,”789456123”,”Cancel Booking”,35.01,70.01,”dateFrom”,”dateTo”,”Business Suite”,”JP”,”JP”);

}</script>


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.

trackProductCompared: 
function(userID,category,pageName,latitude,longitude,productComparedItemList)

  • 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

Product Compared List’s Pre-defined parameters for tracking product data on our system

  • 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

Sample Code

Adding the product to the Product List

<script>
     var productComparedItemList =[ ];
             var values = {
                        "identifier": "12345",
                        "productName": "SIN to DEL Return Air Tickets",
                        "price": 800.00,
                        "brand": "Singapore Airlines",
                        "tier": "Economy",
                        "productDiscount": 5.00

                        }
       productComparedItemList.push(values);

ProductCompared Constructor Call

<script>

        function trackProductCompared(){
mtractiontracker.trackProductCompared(“123”,”Flights”,”Compare flights”,35.01,75.01,productComparedItemList);

}</script>


Was this article helpful to you? Yes No

How can we help?