In App Event Tracking using Appsflyer in Android

Posted By : Prince Bhardwaj | 10-Apr-2017

This API enables AppsFlyer library to track post install events. These events are defined by the advertiser and includes an event name, in addition with optional event values.

 

Tracking in-app events helps us to measure and analyze how loyal users discovers your app, and attributes them to specific campaigns / media sources. It is recommended to take  time and define the events you want to measure to allow you to track ROI ( Return on Investment ) and LTV (Lifetime Value).

 

In my previous blog, I have explained how to integrate Appsflyer in your android project. Now i will tell you how to track app events in your android project using Appsflyer. These events contains event name and values. The syntax is -

Syntax:

public static void trackEvent(Context context, String eventName, Map eventValues)

context - use getApplicationContext() here.

eventName is any string  referring event name.

eventValues is  map of event parameters that comprises a rich event. 

To track a event in your app, you have to use  trackEvent function of AppsflyerLib class as below - 

Map eventValue = new HashMap();
eventValue.put("KEY1",20);
eventValue.put("KEY2",32);
AppsFlyerLib.getInstance().trackEvent(context,"YOUR EVENT NAME",eventValue);
 

IMPORTANT NOTES -

1. An In-app event name must not be longer than 45 characters.  Events names which has more than 45 characters do not appear in the dashboard, but only in the raw Data, Pull and Push APIs.

2. The number of in-app events that can be defined in an application is limited to 128.

 

THANKS

About Author

Author Image
Prince Bhardwaj

Prince Bhardwaj is having Talent as Application Developer, he is an enthusiastic team player in Oodles Technologies.

Request for Proposal

Name is required

Comment is required

Sending message..