Rich in-app events for Android and iOS

At a glance: Record post-install events and attribute them to the originating media source by sending SDK or S2S rich events to AppsFlyer.



Why record rich in-app events?

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 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 logEvent 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 (for example, Overview, Events) they can 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.


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

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

In-app events for hybrid apps

Hybrid apps, that combine native views and HTML content, can also record in-app events. However, because the SDK can only send events from the native side, developers have to forward all event data to native code. See our guide on in-app events for hybrid apps for instructions.


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?