1. Home
  2. Integrations
  3. Android PhoneGap Events Setup Guide
  4. Generic Events Across Verticals – Android Phonegap

Generic Events Across Verticals – Android Phonegap

We have provided a list of Generic Events with their example usage that are applicable and can be integrated for Applications across all Verticals. Please find them below:

1. Page Views

This is used to track user’s page views in your application.

Note: For average page time, you will need this on transition pages so that we can calculate start and end times on the page. Also note that this can generate a lot of traffic and hence cost if the request is large.

You will need to call the below method to track the Page views in your Application.

trackPage :function(pageName)

  • Mandatory parameters (Page Views):                                                                           
    • Page Name  Page that triggered the Event.

Sample Code

<script>
       function trackPage(){  mtractiontracker.trackPage("pageName");      }
   </script>

2. Registration Event

This is used to track the event triggered when a user has successfully registered an account in your Application.

You will need to call the below method to track the Registration event in your javasript file in Application.

trackRegistration: function(userID,emailId,name,age,countryCode,
mobileNumber,pageName,latitude,longitude,gender)

  • Mandatory parameters (Registration):                                

    • User Id – Unique User Identifier
  • Optional parameters (Registration):                                                                            
    • Mobile Number – Mobile Number of the person registering
    • GenderMALE or FEMALE based on the sex of the person, registering in your Application
    • Name – Name of the person registering
    • Email Id – Email of the person registering
    • Country Calling Code – Calling Code of the Country, the person registering belongs
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackRegistration(){
mtractiontracker.trackRegistration(“123”,”john@john.com”,”John Smith”,22,1,8325552002,”Sigup”,37.09,95.71,”MALE”);
}
</script>

3. Login Event

This is used to track the event triggered when a user has just logged into your Application with his credentials.

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

trackLogin:function(userId,pageName,latitude,longitude)

  • Mandatory parameters (Login):                                                                            
    • User Id – Unique User Identifier
  • Optional parameters (Login):                                                                            
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackLogin(){
mtractiontracker.trackLogin(“123”,”Home Page”,35.01,70.01);
}
</script>

4. Rate Event

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

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

trackRate: function(userID,ratingValue,maxRatingValue,category,identifier,
brand,productName,pageName,latitude,longitude)

  • Mandatory parameters (Rate):                                                                            
    • User Id – Unique User Identifier
    • Rating Value – App user’s Rating
    • Maximum Rating Value – Maximum allowed Rating
    • Identifier – Unique Event Identifier
    • Product Name – Name of the product being rated
  • Optional parameters (Rate):                                                                           
    • Brand – Brand of the product being rated
    • Category – Category of the product being rated
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackRate(){
mtractiontracker.trackRate(“123”,4.5,5,”Bags”,”12345”,”Targus”,”Targus Backpack”,”Product rating”,35.01,70.01);
}
</script>

5. Search Event

This is used to track the event triggered when a user has searched for a product/content or travel in your Application.

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

trackSearch: function(userID,keywords,category,cclass,locationFrom,locationTo,
priceFrom,priceTo,brand, discount,pageName,latitude,longitude,dateFrom,dateTo)

  • Mandatory parameters (Search):                                                                            
    • User Id – Unique User Identifier
  • Optional parameters (Search):                                                                           
    • Keywords – Keywords used for the Search event
    • Category – Category of the searched item
    • Date From – “From Date”, used in the Search event (Applies for Travel Travel)
    • Date To – “To Date”, used in the Search event (Applicable for Travel Travel)
    • Location From – “From Location”, used in the Search event (Applicable for Travel Travel)
    • Location To – “To Location”, used in the Search event (Applicable for Travel)
    • Class – Class of the searched item (Applicable for Travel vertical)
    • Price From – Starting price range of the searched item
    • Price To – Ending price range of the searched item
    • Discount – Discount information of the searched item
    • Brand – Brand information of the searched item
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

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>

<script>
function trackSearch(){
mtractiontracker.trackSearch(“userID”,”keywords”,”category”,”cclass”,”locationFrom”,”locationTo”,”priceFrom”,”priceTo”,”brand”,”discount”,”pageName”,”latitude”,”longitude”,“dateFrom”,”dateTo”);
}
</script>

6. Invite Event

This is used to track the event triggered when a user has invited his/her friend to use your Application.

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

trackInvite: function(userID,description,pageName,latitude,longitude)

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

Sample Code

<script>
function trackInvite(){
mtractiontracker.trackInvite(“123”,”Invitation to user id: 567 join my Network”,”Invite friends”,35.01,70.01);}
</script>

7. Share Event

This is used to track the event triggered when a user has shared information about his/her engagement with the Application either internally or externally.

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

trackShare: function(userID,description,category,brand,productName,identifier,pageName,latitude,longitude)

  • Mandatory parameters (Share):                                                                            
    • User Id – Unique User Identifier
  • Optional parameters (Share):                                                                           
    • Description – Additional information about the shared item
    • Category – Category of the content shared
    • Identifier – Unique Event Identifier
    • Product Name – Name of the shared item
    • Brand – Brand information of the shared item
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackShare(){
mtractiontracker.trackShare("123","Targus Backpack for 13 inch Macbook Pro","Bags","Targus","Targus Backpack","12345","Purchase History",35.01,70.01);}
</script>

8. Payment Information Updated Event

This is used to track the event triggered when a user has updated/saved his payment information on the Application which can be used for his transactions later.

You will need to call the below method to track the Payment Information Updated event in your Application Class to track the Payment Information Updated event in your Application.

trackPaymentInfoUpdated: function(userID,pageName,latitude,longitude,paymentMode)

  • Mandatory parameters (Payment Information Updated):                                                                            
    • User Id – Unique User Identifier
    • PaymentInfoUpdated.PaymentMode.XXXXXX can take any of the predefined values, [CREDIT_CARD or DEBIT_CARD or NET_BANKING or GIFT_CARD or PAYMENT_WALLET]
  • Optional parameters (Payment Information Updated):                                                                           
    • Page Name – Page that triggered the Event
    • Location – Geolocation of the Event

Sample Code

<script>
function trackPaymentInfoUpdated(){
mtractiontracker.trackPaymentInfoUpdated("userId","pageName","latitude","longitude",”paymentMode”);}
</script>

9. App Exit Event

This is used to track the event triggered when a user has quit from the Application.

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

trackAppExit: function(userID,pageName,latitude,longitude)

  • Mandatory parameters (App Exit):                                                                            
    • User Id – Unique User Identifier
  • Optional parameters (App Exit):                                                                           
    • Location – Geolocation of the Event
    • Page Name – Page that triggered the Event

Sample Code

<script>
function trackAppExit(){
mtractiontracker.trackAppExit("123","Home Page",35.01,70.01);
}
</script>

Was this article helpful to you? Yes No

How can we help?