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

Generic Events Across Verticals – Android Unity

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.

Java

public static void TrackPage (string pageName);

 

Sample Code

MTractionTracker.TrackPage (“Home”);

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 Application.

Java

public static void TrackRegistration (string userID, Dictionary<string, object> extraParams);

 

  • 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

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.EMAIL_ID, “john@john.com”);
       extrasParams.Add (EventConstant.USER_NAME, “John77”);
       extrasParams.Add (EventConstant.GENDER, MTraction.Gender.MALE);
       extrasParams.Add (EventConstant.AGE, 25);    
       extrasParams.Add (EventConstant.CCCODE, 1);
       extrasParams.Add (EventConstant.MOBILE_NUMBER, 8325552002);
       extrasParams.Add (EventConstant.PAGE_NAME, “Account Signup”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackRegistration (“123”, extrasParams);

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.

Java

public static void TrackLogin (string userID, Dictionary<string, object> extraParams);

 

  • 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

Js

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “Home Page”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, 118.144516);

       MTractionTracker.TrackLogin (“123”, extrasParams);

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.

Java

public static void TrackRate (string userID, float ratingVal,
short maxRatingVal, string identifier, string productName,
Dictionary<string, object> extraParams);

 

  • 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

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.BRAND, “Targus”);
       extrasParams.Add (EventConstant.CATEGORY, “Bags”);
       extrasParams.Add (EventConstant.PAGE_NAME, “Product rating”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackRate (“123”, 4.5f, 5, “12345”, “Targus Backpack”, extrasParams);

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.

public static void TrackSearch (string userID, Dictionary<string, object> extraParams);

 

  • 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(With an Example based on a scenario from the Travel Vertical):

String dateFrom = DateTime.ParseExact (“2017-06-07 11:45:35”, “yyyy-MM-dd HH:mm:ss”, null).ToString (“yyyy-MM-dd HH:mm:ss”);
       String dateTo = DateTime.ParseExact (“2017-06-07 11:45:35”, “yyyy-MM-dd HH:mm:ss”, null).ToString (“yyyy-MM-dd HH:mm:ss”);

       Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.KEYWORDS, “Non Stop Flights”);
       extrasParams.Add (EventConstant.CATEGORY, “Flights”);
       extrasParams.Add (EventConstant.DATE_FROM, _dateFrom);
       extrasParams.Add (EventConstant.DATE_TO, _dateTo);
       extrasParams.Add (EventConstant.LOCATION_FROM, “Singapore”);
       extrasParams.Add (EventConstant.LOCATION_TO, “New Delhi”);
       extrasParams.Add (EventConstant.CLASS, “Economy”);
       extrasParams.Add (EventConstant.PRICE_FROM, 350.00);
       extrasParams.Add (EventConstant.PRICE_TO, 750.00);
       extrasParams.Add (EventConstant.DISCOUNT, 10.00);
       extrasParams.Add (EventConstant.BRAND, “Singapore Airlines”);
       extrasParams.Add (EventConstant.PAGE_NAME, “Flights Search”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackSearch (“123”, extrasParams);

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.

Java

public static void TrackInvite (string userID, Dictionary<string, object> extraParams);

 

  • 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

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.DESCRIPTION, “Invitation to user id: 567 join my Network”);        
       extrasParams.Add (EventConstant.PAGE_NAME, “Invite friends”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackInvite (“123”, extrasParams);

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.

Java

public static void TrackShare (string userID, Dictionary<string, object> extraParams);

 

  • 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

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.DESCRIPTION, “Targus Backpack for 13 inch Macbook Pro”);
       extrasParams.Add (EventConstant.CATEGORY, “Bags”);
       extrasParams.Add (EventConstant.IDENTIFIER, “12345”);
       extrasParams.Add (EventConstant.PRODUCT_NAME, “Targus Backpack”);
       extrasParams.Add (EventConstant.BRAND, “Targus”);
       extrasParams.Add (EventConstant.PAGE_NAME, “Purchase History”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackShare (“123”, extrasParams);

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.

Java

public static void TrackPaymentInfoUpdated
(string userID, PaymentMode paymentMode,
Dictionary<string, object> extraParams);

 

  • 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

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “Payment Information”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackPaymentInfoUpdated (“123”, PaymentMode.CREDIT_CARD, extrasParams);

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.

Java

public static void TrackAppExit (string userID, Dictionary<string, object> extraParams);

 

  • 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

Dictionary<string, object> extrasParams = new Dictionary<string, object> ();
       extrasParams.Add (EventConstant.PAGE_NAME, “Home Page”);
       extrasParams.Add (EventConstant.LATITUDE, 34.147785);
       extrasParams.Add (EventConstant.LONGITUDE, -118.144516);

       MTractionTracker.TrackAppExit (“123”, extrasParams);

 

 

Was this article helpful to you? Yes No

How can we help?