AdGyde Logo

Events


Event is a powerful tool to track interaction between user and mobile application.
There are 3 kinds of events, which are
  1. Simple Event
  2. Counting Event
  3. Computing Event

1. Simple Event
Simple event is an event without parameters. It can be used to track simple event. For example, if you need to track how many times which user launch your application. Just put a line at onCreate() of main activity.

public void onCreate() {
// fire simple event named "Launch my application"
AdGyde.onSimpleEvent("Launch my application");
}

Simple event can be used to construct funnel, the details for same can be found under funnel section.

For more complicated event tracking - Counting Event or Computing Event should be considered.

2. Counting Event
Counting Event is useful to track event which needs counting. For example, if we are developing a news application. This application has three categories, which are local news, national news and international news. We need to know which category is the most popular, just implement the following code on click listener.

/**
* Being triggered if "Local News" tab clicked.
*/
public void onCategoryLocalNewsClicked(View view) {
Map<String, String> params = new HashMap<String, String>();
// params.put(patrametre_name, value);
params.put("category", "local news");
AdGyde.onCountingEvent("selected category", params);
}

/**
* Being triggered if "National News" tab clicked.
*/
public void onCategoryNationalNewsClicked(View view) {
Map<String, String> params = new HashMap<String, String>();
// params.put(patrametre_name, value);
params.put("category", "national news");
AdGyde.onCountingEvent("selected category", params);
}

/**
* Being triggered if "International News" tab clicked.
*/
public void onCategoryInternationalNewsClicked(View view) {
Map<String, String> params = new HashMap<String, String>();
// params.put(patrametre_name, value);
params.put("category", "international news");
AdGyde.onCountingEvent("selected category", params);
}

As the events are different and AdGyde Server needs to differentiate that the event is counting event, therefore events need to be added in Dashboard with specified type.

Following are the steps to add counting event in Dashboard
  1. Login to AdGyde Dashboard
  2. Click on Setup/Events
  3. Click on 'create' button above events list
  4. Select your application on app_name field
  5. Enter 'selected category' on event_id field. It should be the same as first parameter of AdGyde.onEvent(String, Map<String, String>)
  6. Enter 'category' on parameter_name field
  7. Select 'Counting' item of comp_param_type field
  8. Click on 'Create' button



3. Computing Event
Computing Event can be used to track accumulative values.

E.g. If we put our banner in application with different Weightage or say Cost, then using the computing event we can know the Contribution of each Banner as per weightage assigned.

/**
* Invoked when advertisement clicked.
*/
public void onAdvertismentClicked(Advertisement adv) {
Map<String, String> params = new HashMap<String, String>();
// First parameter is event name and second is value name which will be accumulated.
params.put("CPM", adv.getName());
// Second parameter is the value for its value name. Value must be integer type.
params.put(adv.getName(), "" + adv.getPrice());
// Trigger event where first parameter is event_id
AdGyde.onComputingEvent("CPM income", params);
}

Computing event uses 2 parameters. First parameter defines event id say 'CPM' and parameter which will be accumulated. Second parameter defines parameter value. For example, news application placed 2 banners. First is 'adv1', CPM is 1 cent. Second is 'adv2', CPM is 5 cents. 'adv1' clicked 5 times, 'adv2' clicked 10 times. Accumulated value is 'adv1'=1 cent * 5=5 cents, 'adv2'=5 cents * 10=50 cents.

The process of defining the computing event is like counting event, but com_param_type should be set to 'Computing'.



4. Revenue Event
There is a separate Revenue event which should and can be used for keeping track of revenue generated through the application. Revenue shown in the Dashboard is also based on this event only.

private void fireRevenueEvent() {
AdGyde.onRevenue(17);
}

5. Unique Event
Unique Event is useful to track events which need unique counting in a specific time period. For example, if we develop a news application. This application has three categories, which are local news, national news and international news.

AdGyde provides Unique Events in three types
  1. onDailyUnique
  2. onPermanentUnique
  3. onCustomUnique

The 3 Types of Unique events can be used for different requirements
  1. To know how many unique users complete the Game Stage in each date, onDailyUnique should be used
  2. To know how many unique users complete the Game Stage in user lifetime, onPermanentUnique should be used
  3. To know how many unique users complete the Game Stage in 24 Hours, onCustomUnique should be used
For the unique event following code needs to be implemented
/**
* Daily Unique event allows to keep an event unique for current date
* When user completes Game Stage
*/
public void onGameStageCompleted(View view) {
Map<String, String> params = new HashMap<String, String>();
//The parameter being passed in unique event are in combination of ParameterName and Value
params.put("Level", "level_1");

// Event is triggered with EventId and Parameters prepared above, the same are passed in this function
AdGyde.onDailyUnique("GameLevelComplete", params);
}

/**
* Permanent Unique event allows to keep an event unique for user lifetime
*/
public void onGameStageCompletedUnique(View view) {
Map<String, String> params = new HashMap<String, String>();
//The parameter being passed in unique event are in combination of ParameterName and Value
params.put("Level", "level_1");

// Event is triggered with EventId and Parameters prepared above, the same are passed in this function
params.onPermanentUnique("GameLevelComplete", params);
}

/**
* Custom Unique event allows to keep an event unique for user defined time (hours)
*/
public void onCategoryInternationalNewsClicked(View view) {
Map<String, String> params = new HashMap<String, String>();
//The parameter being passed in unique event are in combination of ParameterName and Value
params.put("Level", "level_1");

// Event is triggered with EventId and Parameters prepared above, the same are passed in this function
// The third parameter (3) specifies that the Event will not be counted again before 3 hours
params.onCustomUnique("GameLevelComplete", params, 3);
}


As the events are different and AdGyde Server needs to differentiate that the event is unique event, therefore events need to be added in console with specified type.

Please follow instructions below to create unique event
  1. Login into AdGyde Console
  2. Click on Setup/Events
  3. Click on 'create' button above events list
  4. Select your application on app_name field
  5. Enter 'GameLevelComplete' on event_id field. It should be the same as first parameter of AdGyde.onEvent(String, Map, Boolean flag)
  6. Enter 'Level' on parameter_name field
  7. Select 'Unique Event' item of comp_param_type field
  8. Click on 'Create' button

This website uses cookies in order to improve your experience and our services. By continuing to use our website, agree to the use of such cookies. Click here for Privacy Policy.