Rich in-app events for Android and iOS

travel.png

Rich in-app events provide advertisers with the ability to record post-install events and attribute them to the originating media source.

When users perform registrations, complete tutorials, add items to the shopping cart or make purchases, then in-app events data can record the events with the details.  

Rich in-app events are the ideal tool to determine the value of app users and the quality of traffic originating from different media sources. The implementation of rich in-app events is optional but we strongly recommended that you do so. We also recommend defining and using the same in-app event names and structures across all platforms, for better raw data alignment.

Respecting the privacy of your users

  • AppsFlyer values and respects the privacy of you and your app users.
  • We don't collect nor accept personally identifiable information (PII).
  • To ensure the privacy of your users, don't populate in-app event values with information that can directly identify them. For example, email address, name, identity number, and in some locations postal code. 

The trackEvent API

An in-app event is comprised of an event name and event parameters.

You can use any event name string of your choice. However, AppsFlyer SDK contains recommended event names via enumerations and definitions (see the Event Types tab for the list of recommended events and parameter names).

Event names are case sensitive, meaning that af_purchase and af_PURCHASE are two different events in the raw data. However, in aggregate reports (e.g. Overview, Events) they may be displayed as a single event. Therefore, we recommend using only lower-case event and parameter names.

The length of event values is limited to 1000 characters. Don't exceed this limit. We may truncate it if you do so.

Syntax:

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

Context
Use getApplicationContext()
eventName
Any string to define the event name.
eventValues
A map of event parameters that comprise a rich event.

In-app events for hybrid apps

In cases where your app is a hybrid app, see our guide on in-app events for hybrid apps.

 Caution

Each network has its own limitations regarding the permitted characters in event names. To avoid problems, use only lower-case alpha-numeric characters (a-z and 0-9) for your in-app event names.

Was this article helpful?