1. Home
  2. Integrations
  3. iOS PhoneGap Event Setup Guide
  4. Travel Applications – iOS Phonegap

Travel Applications – iOS 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,latitude,longitude,
paymentMode,dateFrom,dateTo,cclass,locale)

  • 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
    • Locale – Currency code is used for this event.

      Note: For passing custom currency code, Follow the sample below:

      Locale is String type. We have to pass country code.

      Example

      Locale *currencyCode = ”en_US” ; 

      Note:
      Click here to Locale Identifier List

    • Payment ModeCREDIT_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 = “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>

Sample Code- Track Reservation Constructor 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”,”en_IN”);

}</script>

2. Reservation Cancelled Event

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

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

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

  • 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
    • Locale – Currency code is used for this event.

      Note: For passing custom currency code, Follow the sample below:

      Locale is String type. We have to pass country code.

      Example

      Locale *currencyCode = ”en_US” ; 

      Note:
      Click here to Locale Identifier List

  • 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>

Sample Code- //Reservation Cancelled construction 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”,”en_IN”);
</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 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

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


  • 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-// 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);

}</script>

Sample Code-// 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?