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

Content Based Applications – iOS Phonegap

We have provided a list of Events with their example usage that can be integrated for Content based Applications. Please find them below:

1. Purchase Event

This is used to track the successful Purchase events or paid subscription to the Application.

You will need to call the below method to track the In-App Purchase event in your Application.

trackPurchase: function(userID,revenue,transactionId,pageName,
loyalty,serviceCharge,overallDiscount,paymentMode,
frequency,latitude,longitude,locale,productItemList);

  • Mandatory parameters (Purchase):            
    • User Id – Unique User Identifier
    • Revenue – Total Revenue generated from this Purchase event
    • Payment ModeCREDIT_CARD or DEBIT_CARD or NET_BANKING or GIFT_CARD or PAYMENT_WALLET
    • Transaction Id – Unique Purchase Transaction Identifier
    • Purchase FrequencyONCE or RECURRING representing One Time Payment or Subscription based Payment respectively
    • Product List – Array of the list of products purchased
    • 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 (Purchase):           
    • Loyalty – Loyalty points applied on the Purchase
    • Overall Discount – Discount applied for the Purchase
    • Service Charge – Service Charge applied for the Purchase
    • Location – Geolocation of the Event

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

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

Sample Code

<script>
var productList=[ ];
var values = {
         "IDENTIFIER": "12345",
         "PRODUCT_NAME": "Cook Books",
         "PRICE": 14.99,
         "QUANTITY": 1,
         "BRAND": "Gordon Ramsay",
         "CATEGORY": "Books",
         "PRODUCT_DISCOUNT": 5.00 
}
var addProduct;
addProduct=JSON.stringify(values);
productList.push(addProduct);
</script>

Sample Code- Purchase event tracking

<script>
// Calling trackPurchase Method...
mtractiontracker.trackPurchase(
        "123",
        24.65,
        "1000123",
        "Book Purchase",
       350.00,
        4.99,
        5.00,
        DEBIT_CARD, 
        RECURRING,
       35.01,
        70.01,
      “en_US”,
        productItemList
        );
        }
</script>

2. Content Viewed Event

This is used to track the event triggered when the user has viewed any content on the Application.

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

trackContentViewed: function(userID,revenue,identifier,productName,
category,pageName,latitude,longitude,mediaType,locale)

  • Mandatory parameters (Content Viewed):            
    • User Id – Unique User Identifier
    • Revenue – Total Revenue generated from this Content Viewed event
    • Identifier – Unique Content Identifier
    • Media Type – Type of content viewed, AUDIO or VIDEO or TEXT or IMAGE
    • 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 (Content Viewed):            
    • Product Name – Title of the Content
    • Category – Content Category
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackContentViewed(){
mtractiontracker.trackContentViewed(”123”,123.00,”12345”,”Article on Electronic gadgets”,”Technology”,”Article”,35.01,70.01,”VIDEO”,”en_IN”);
}</script>

3. Create Playlist Event

This is used to track the event triggered when a user has to create playlist in your Application. .

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

trackCreatePlaylist: function(playList,description,identifier,
pageName,latitude,longitude)

  • Mandatory parameters (Create Playlist):            
    • Playlist Name – User Playlist Name
    • Identifier – Unique Event Identifier
  • Optional parameters (Content Viewed):            
    • Description  – Additional information about the Event
    • Page Name – Page that triggered the Event
    • Location  – Geolocation of the Event

Sample Code

<script>
       function trackCreatePlaylist(){
mtractiontracker.trackCreatePlaylist("MyFavList","Songs List","12345","Playlist",35.01,70.01);
       }
   </script>
Was this article helpful to you? Yes No

How can we help?