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:

Note: Please ensure to include the MTraction header file (as shown below) in the class of your project from where the in App event methods have to be invoked.

#import <mTraction/MTraction.h>

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.

[[MTraction mTractionManager]trackPage:@"Page Name"];

Sample Code

[[MTraction mTractionManager]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.

[[MTraction mTractionManager]trackRegistration:registration];
-(void)trackRegistration:(Registration*) registration;

  • Mandatory parameters (Registration):   
    • User Id - Unique User Identifier
  • Optional parameters (Registration):   
    • Mobile Number - Mobile Number of the person registering
    • Gender - MALE 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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with User ID (User ID is mandatory)
Registration *registration =[[Registration alloc] initWithRegistrationUserID:@"123"];

// Examples for other parameters passed with the event (These are optional)
  [registration setEmailId:@"john@john.com"];
  [registration setName:@"John77"];
  [registration setGender:MALE];
  [registration setLocationLatitude:latitude longitude:longitude];
  [registration setCountryCallingCode:1];
  [registration setMobileNumber:8325552002];
  [registration setPageName:@"Account Signup"];

// trackRegistration method call
[[MTraction mTractionManager]trackRegistration:registration];

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.

[[MTraction mTractionManager]trackLogin:login];
-(void)trackLogin:(Login*) login;

  • 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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with User ID (User ID is mandatory)
Login *login =[[Login alloc] initWithLoginUserID:@"123"];

// Examples for other parameters passed with the event (These are optional)
 [login setLocationLatitude:latitude longitude:longitude];
 [login setPageName:@"Home Page"];

// trackLogin method call
 [[MTraction mTractionManager]trackLogin:login];

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 Rate event in your Application.

[[MTraction mTractionManager]trackRate:rate];
-(void)trackRate:(Rate*) rate;

  • 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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with all the mandatory parameters
Rate *rate =[[Rate alloc] initWithRateUserID:@"123" RatingValue:4.5 MaxRatingValue:5 Identifier:@"12345" ProductName:@"Targus Backpack"];

// Examples for other parameters passed with the event (These are optional)
  [rate setPageName:@"Product rating"];
  [rate setLocationLatitude:latitude longitude:longitude];
  [rate setCategory:@"Bags"];
  [rate setBrand:@"Targus"];

// trackRate method call
 [[MTraction mTractionManager]trackRate:rate];

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.


[[MTraction mTractionManager]trackSearch:search];
-(void)trackSearch:(Search*) search;

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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Dates to passed in as Optional parameters
NSString *dateFromStr = @"17/06/2016";
NSString *dateToStr = @"24/06/2016";
NSTimeZone *centralStandardTime = [NSTimeZone timeZoneWithAbbreviation:@"CST"];
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd/MM/yyyy"];
[dateFormatter setTimeZone:centralStandardTime];
NSDate *dateFrom = [dateFormatter dateFromString:dateFromStr];
NSDate *dateTo = [dateFormatter dateFromString:dateToStr];

// Example Constructor call with User ID (User ID is mandatory)
Search *search = [[Search alloc]initWithSearchUserID:@"123"];

// Examples for other parameters passed with the event (These are optional)
  [search setKeyWords:@"Non Stop Flights"];
  [search setCategory:@"Flights"];
  [search setDateFrom:dateFrom];
  [search setDateTo:dateTo];
  [search setLocationFrom:@"Singapore"];
  [search setLocationTo:@"New Delhi"];
  [search setClass:@"Economy"];
  [search setPriceFrom:350.00];
  [search setPriceTo:750.00];
  [search setDiscount:10.00];
  [search setBrand:@"Singapore Airlines"];
  [search setPageName:@"Flights Search"];
  [search setLocationLatitude:latitude longitude:longitude];

// trackSearch method call
[[MTraction mTractionManager]trackSearch:search];

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.

[[MTraction mTractionManager]trackInvite:invite];
-(void)trackInvite:(Invite*) invite;

  • 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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with User ID (User ID is mandatory)
Invite *invite = [[Invite alloc]initWithInviteUserID:@"123"];

// Examples for other parameters passed with the event (These are optional)
  [invite setDescription:@"Invitation to user id: 567 join my Network"];
  [invite setPageName:@"Invite friends"];
  [invite setLocationLatitude:latitude longitude:longitude];

// trackInvite method call
[[MTraction mTractionManager]trackInvite:invite];

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.


[[MTraction mTractionManager]trackShare:share];
-(void)trackShare:(Share*) share;

  • 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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with User ID (User ID is mandatory)
Share *share = [[Share alloc]initWithShareUserID:@"123"];

// Examples for other parameters passed with the event (These are optional)
  [share setDescription:@"Targus Backpack for 13 inch Macbook Pro"];
  [share setCategory:@"Bags"];
  [share setIdentifier:@"12345"];
  [share setProductName:@"Targus Backpack"];
  [share setBrand:@”Targus”];
  [share setPageName:@"Purchase History"];
  [share setLocationLatitude:latitude longitude:longitude];

// trackShare method call
[[MTraction mTractionManager]trackShare:share];

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.

[[MTraction mTractionManager]trackPaymentInfoUpdated:paymentInfoUpdate];
-(void)trackPaymentInfoUpdated:(PaymentInfoUpdated*) paymentInfoUpdated;

  • Mandatory parameters (Payment Information Updated):   
    • User Id - Unique User Identifier
    • Payment Mode - 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

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with all the mandatory parameters
PaymentInfoUpdated *paymentInfoUpdate = [[PaymentInfoUpdated alloc]initWithPaymentInfoUpdatedUserID:@"123" PaymentMode:CREDIT_CARD];

// Examples for other parameters passed with the event (These are optional)
  [paymentInfoUpdate setPageName:@"Payment Information"];
  [paymentInfoUpdate setLocationLatitude:latitude longitude:longitude];

// trackPaymentInfoUpdated method call
  [[MTraction mTractionManager]trackPaymentInfoUpdated:paymentInfoUpdate];

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.

[[MTraction mTractionManager]trackAppExit:appExit];
-(void)trackAppExit:(AppExit*) appExit;

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

Sample Code

// Example Longitude &amp; Latitude code (Long / Lat is optional)
#import <CoreLocation/CoreLocation.h>
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  NSLog(@"didUpdateToLocation: %@", newLocation);
  CLLocation *currentLocation = newLocation;
  if (currentLocation != nil) 
  {
    double longitude = currentLocation.coordinate.longitude;
    double latitude = currentLocation.coordinate.latitude;
  }
}

// Example Constructor call with User ID (User ID is mandatory)
AppExit *appExit=[[AppExit alloc]initWithAppExitUserId:@"123"];

// Examples for other parameter passed with the event (This is optional)
  [appExit setPageName:@"Home Page"];
  [appExit setLocationLatitude:latitude longitude:longitude];

// trackAppExit method call
[[MTraction mTractionManager]trackAppExit:appExit];

Additionally, you can implement custom events to track specific behavior on your application. Please follow the documentation (with example): Custom Events Setup Guide