Rich in-app events guide

At a glance: Record post-install rich in-app events (such as login, register, or in-app purchase) attributed to media sources and campaigns.

Why record in-app events?

In-app events provide insight into what is happening in your app and are the ideal tool to determine the value of app users and the quality of traffic originating from different media sources. Recording in-app events helps you measure KPIs such as ROI (Return on Investment) and LTV (Lifetime Value).

When users perform registrations, complete tutorials, add items to the shopping cart or make purchases, the in-app event data can record the events with the details. The implementation of in-app events is mandatory for all post-install analysis purposes.

About in-app events

An in-app event comprises an event name and can include event parameters. When you add event parameters to an in-app event, it is referred to as a rich in-app event. Event parameters provide you with more context and information about the occurring event. For example, while it helps to know that a user made a booking, event parameters can provide you with details such as the type of purchase, destination, and revenue.

travel.png

Predefined and custom events

In-app events that you want to send require your developer to implement code where applicable in your app. Event names and event parameters are classified as follows:

  • Predefined: These are event names and event parameters that are commonly used among different apps. We highly recommend using predefined event names and event parameters as much as possible for the following reasons:
      • Predefined naming allows automatic mapping of events to partners. 
      • If AppsFlyer decides to change the name of any event or event parameter, your implementation is backward compatible.
  • Custom: These are event names and parameters that you define for specific user scenarios that occur in your app. You can use any custom event name or parameter name string, but keep in mind that custom events need maintenance by your developer. See Tips and Limitations.

Sending events

There are several ways to send in-app events to AppsFlyer:

  • AppsFlyer SDK: This is the most common way to send events. You can send rich in-app events that record user actions in the app using the AppsFlyer in-app events API at the SDK level.
  • Sever-to-server API: Use the server-to-server API to send events that occur outside the mobile app, directly to AppsFlyer. For example, if you have a user who is active on both web and mobile interfaces, you can record events from both sources and attribute them to the same user in AppsFlyer. It can be either an in-app event or other events, such as website events, call-center events, or purchases in your brick-and-mortar store.
  • Receipt validation: This is a secure mechanism where the payment platform, for example, Apple and Google, validate that the in-app purchase took place as reported. Validating purchases is the primary tool to prevent fraudulent revenue events. It also helps you see what the real revenue is, and filters out incomplete in-app purchases. 
  • Hybrid apps: These apps combine native views and HTML content and 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.

Setting up in-app events

The process of setting up in-app events requires that the marketer and the developer work together as follows:

Step Role Task Details

1

Marketer

Determine the in-app events that you want to measure. Define and communicate the event names and event parameters to your developer.  

It is recommended to start with 3-5 events that you can use as KPIs to measure the quality of your users (for example, purchases, registration, and sharing). Event parameters are optional, and you can use any event parameter with any event name.

See Recommended events by business vertical for typical in-app events.

2 Developer

Implement code in your app where applicable. 

Developer documentation is here.

3 [Optional] Marketer Work with your developer to set the Customer User ID field (CUID)

This field helps enrich in-app events data by cross-referencing AppsFlyer attribution data with your other data using the CUID as a key.

4 [Optional] Marketer Map events to relevant partners in the dashboard.  This is an ongoing task, depending on the partners you integrate with.

Defining an in-app event

Once you determine the in-app events that you want to measure, define the events and parameters as follows:

  1. Select an event name that is most suitable to the scenario you want to record.
  2. Select the event parameters that you want to associate with the event. Choose parameters that will provide additional context to the event and enrich the data.
  3. Send the developer the completed table, as shown in the following example.

 Example

A marketer for an eCommerce app wants to record the type of content users view in order to better understand what categories are the most popular and connect product views with product sales.

The following table shows an example of the event structure the marketer passes to the developer:
Event name Event parameters Parameter values When is the event triggered?
af_content_view af_price Product price

When a user views a specific product details page

af_content_type Name of the product category, for example, shoes
af_content_id

Product ID, for example, SKU

Recommended events by business vertical

The following table provides links to articles that include examples and flows of the typical in-app events we suggest recording per vertical.

Business vertical Article title
InApp_Events_games.png  Recommended gaming app events
InApp_Events_ecommerce.png Recommended eCommerce app events
InApp_Events_streaming.png Recommended entertainment app events
banking.png Recommended finance and banking app events
InApp_Events_lending.png Recommended P2P lending app events
education.png Recommended online education app events
InApp_Events_ride.png Recommended ride-hailing app events
InApp_Events_flight.png Recommended flight booking app events
InApp_Events_hotel.png Recommended hotel booking app events
5669_Healthcare_icon_3.png Recommended healthcare app events
telecommunications_icon.png Recommended telecommunication app events
InApp_Events_eWallet.png Recommended eWallet app events

View in-app event data

In-app events are attributed to the media source responsible for the install throughout the lifetime of the user. Event data is presented as Life Time Value or Activity data

You can view your in-app event data in these locations:

  • Dashboard overview page: Displays real-time LTV user acquisition (UA) performance
  • Events page: Displays LTV in-app event performance across media sources
  • Raw data in-app event reportDisplays activity data, meaning, a chronological list of the actions performed by your entire user base. This report includes event parameter values, for example:
    {
      "af_level":"10",
      "af_score":"3387",
      "arena":"7",
      "char_type":"paladin"
    }

    Note that raw-data reporting is a premium feature.

Tips 

Keep in mind the following when adding event names and parameters:

  • For data consistency in raw-data reporting, we recommend defining and using the same in-app event names and structures across all platforms.
  • 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.
  • Note that AppsFlyer collects the IP address of devices during engagements. In some jurisdictions or use scenarios, the IP address can be regarded as PII. We use the IP address to derive the broad geographic location (city, district level) of the device but not the specific address. If needed, you can select to mask IP addresses so that they don't appear in raw data reports. 
  • In-app events are the only source of revenue data in AppsFlyer. You can attach a specific revenue value to each event, and view it on your app's dashboard. Learn more about the monetizing parameters.

    revenue_data.png

Limitations

Keep in mind the following when adding event names and parameters:

  • We recommend using only lower-case alpha-numeric characters (a-z and 0-9) for your in-app event 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, or Events) they can be displayed as a single event. 
  • Event names cannot begin with these characters: ", =, +, -.
  • Event values should not exceed 1000 characters. 
  • If you include the referring URL as an event value, it must be URL encoded.
  • Facebook has some limitations regarding event names and parameters. Read about the limitations here.
Was this article helpful?