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

mCommerce Applications – Android Phonegap

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

1. Add To Cart Event

This is used to track each product added by the user to the list of items, he may be willing to purchase on the Application.

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

trackAddToCart: function(userID,identifier,productName,category,price,quantity,brand,
productDiscount,pageName,latitude,longitude,languageCode,countryCode)

  • Mandatory parameters (Add to Cart):                                                                          
    • User Id – Unique User Identifier
    • Identifier – Unique Event Identifier
    • Product Name – Name of the Product
    • Category – Product Category
    • Price – Price of the Product
    • Language Code  – Unique Language Code.
    • 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 (Add to Cart):                                                                         
    • Quantity – Quantity of products added to cart
    • Brand – Brand of the product added to cart
    • Product Discount – Discount applicable for the product added to cart
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackAddToCart(){
mtractiontracker.trackAddToCart(“123”,”1234567”,”Targus Backpack”,”Bags”,29.99,1,”Targus”,5.00,”Product Details”,35.01,70.01,”JP”,”JP”);
}
</script>

2. Add To Wishlist Event

This is used to track each product added by the user to the list of his desired items, he may be willing to purchase at a later time on the Application. You will need to call the below method to track the Add to Wishlist event in your Application.

trackAddToWishlist:
function(userID,identifier,productName,category,price,brand,
productDiscount,pageName,latitude,longitude,languageCode,countryCode)

  • Mandatory parameters (Add to Wishlist):                                                                           
    • User Id – Unique User Identifier
    • Identifier – Unique Event Identifier
    • Product Name – Name of the Product
    • Category – Product Category
    • Price – Price of the Product
    • Language Code  – Unique Language Code.
    • 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 (Add to Wishlist):                                                                          
    • Brand – Brand of the product added to wishlist
    • Product Discount – Discount applicable for the product added to cart
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackAddToWishlist(){
mtractiontracker.trackAddToWishlist(“123”,”1234567”,”argus Backpack”,”Bags”,29.99,”Targus”,5.00,”Product Details”,35.01,70.01,”JP”,”JP”);
}
</script>

3. Checkout Initiated Event

This is used to track the purchase initiation event before the users make their payment towards purchase in the Application.

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

trackCheckoutInitiated:
function(userID,totalPrice,totalLoyalty,pageName,overallDiscount,
latitude,longitude,paymentInfo,languageCode,countryCode,checkOutInitiatedItemList)

  • Mandatory parameters (Checkout Initiated):                                                            
    • User Id – Unique User Identifier
    • Total Price – Sum of the prices of the products initiated for Checkout
    • productList – Array of the list of products initiated for Checkout
    • Language Code  – Unique Language Code.
    • 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 (Checkout Initiated):                                                           
    • Loyalty – Loyalty points applied on the Purchase
    • Overall Discount – Discount applied for the Purchase
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event
    • Payment information availableYES or NO depending on the availability of the user’s Payment preferences, in your Application

CheckOut Initiated Product Item List’s Pre-defined parameters for tracking product data on our system

  • Mandatory parameters (Checkout Item):                                                        
    • Identifier – Unique Product Identifier
    • Product Name – Name of the Product
    • Price – Price of the Product
    • Quantity – Quantity of the Product being Purchased
    • Category – Product Category
  • Optional parameters (Checkout Item):                                                       
    • Brand – Brand Name of the Product
    • Product Discount – Discount applied for the Product

Sample Code

Adding the product to the CheckOut Initiated Product List     

<script>
   var checkOutInitiatedItemList=[ ];
            var values = {
                          "identifier":"123",
                          "productName": "Targus Backpack",
                          "quantity": 1,
                          "category": "Bags",
                          "price": 29.99
                          "brand": "Targus",
                          "productDiscount": 5.00
                          }
checkOutInitiatedItemList.push(values);  
}
</script>

4. Removed From Cart Event

This is used to track the event that is triggered when the users remove products from the shopping cart within your Application.

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

trackRemoveFromCart: function(userID,category,pageName,latitude,longitude,
languageCode,countryCode,removedfromCart_ItemList)

  • Mandatory parameters (Cart Abandoned):                                                  
    • User Id – Unique User Identifier
    • Category – Product Category
    • Product List – Array of the list of products initiated for Checkout
    • 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 (Cart Abandoned):                                                  
    • Brand-Brand Name of the Product
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

RemovedFromCart Item List’s Pre-defined parameters for tracking product data on our system


  • Mandatory parameters (Removed from Cart Item):                                                  
    • Identifier – Unique Product Identifier
    • Product Name – Name of the Product
    • Price – Price of the Product
    • Quantity – Quantity of the Product being Purchased
  • Optional parameters (Removed from Cart Item):                                                  
    • Brand – Brand Name of the Product
    • Product Discount – Discount applied for the Product

Sample Code

 <script>
      var removedfromCart_ItemList =[];
        
         var values = {
                        "identifier": "12345",
                        "productName": "Targus Backpack",
                        "price": 29.99,
                        "quantity": 1,
                        "brand": "Targus",
                        "productDiscount": 5.00

                         }
       removedfromCart_ItemList.push(values);

        }
    </script>

RemovedFromCart Constructor Call

<script>

        function trackRemoveFromCart(){
mtractiontracker.trackRemoveFromCart(“123”,”Bags”,”Purchase_summary”,35.01,70.01,”JP”,”JP”,”removedfromCart_ItemList”);

 }</script>

5. Return Order Event

This is used to track the Return Order event triggered when an user has completed a return product request on the Application. You will need to call the below method to track the Order Return event in your Application.

trackReturnOrder: function(userID,category,identifier,productName,brand,refundAmount,
quantity,transactionId,pageName,latitude,longitude,languageCode,countryCode)

  • Mandatory parameters (Return Order):                                                  
    • User Id – Unique User Identifier
    • Category – Product Category
    • Identifier – Unique Event Identifier
    • Product Name – Name of the Product
    • Refund Amount – Amount to be refunded for the product
    • Quantity – Quantity of the product requested for refund
    • Language Code  – Unique Language Code.
    • 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 (Return Order):                                                  
    • Brand – Brand Name of the Product
    • Transaction Id – Transaction Identifier of the order returned
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackReturnOrder(){
mtractiontracker.trackReturnOrder(“123”,”Bags”,”12345”,”Targus Backpack”,”Targus”,20.00,1,”100065789”,”Track Orders”,35.01,70.01,”JP”,”JP”);
}
</script>

6.Product 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 Product
    • Product Discount – Discount applied for the Travel booking
    • Tier  – Class of Travel

Product Compared Item 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": "Targus Backpack",
                        "price": 29.99
                        "brand": "Targus",
                        "tier": "Bags for Macbook",
                        "productDiscount": 5.00

                        }
       productComparedItemList.push(values);
}</script>

ProductCompared Constructor Call

<script>

        function trackProductCompared(){
mtractiontracker.trackProductCompared(“123”,”Bags”,”Compare Products”,35.01,70.01”productComparedItemList”);

}</script>


Was this article helpful to you? Yes No

How can we help?