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 -
MapeventValue = 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
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Prince Bhardwaj
Prince Bhardwaj is having Talent as Application Developer, he is an enthusiastic team player in Oodles Technologies.