Introduction to Functionality
This article will provide a detailed guide on how to integrate AppsFlyer data into the Sensors Analytics system, including two methods, as follows:
AppsFlyer API | Data Granularity | API Type | Data Update Frequency | Request Frequency Limit |
---|---|---|---|---|
Push API | Raw Data | AppsFlyer API Push | Real-time | No limitation |
Please note
1. Please consult your AppsFlyer account manager for usage permissions before using the API.
2. Some media platforms may limit the transmission of certain fields in the raw data, including attribution information, revenue data, and cost data. Refer to the AppsFlyer field documentation for more details.
Push API Raw Data Access
You can use AppsFlyer's Push API to send user behavior raw data to the Sensors Analytics system. Sensors Analytics supports the following features to help you analyze overseas promotion channel sources more effectively.
1. Save the raw data pushed via the Push API into the Sensors Analytics Event-User table for you to view and analyze the received raw events and users. (Note: When the raw data from third-party push is written to the database by event, this part of the data will be counted as events consumed by the cluster)
2. Record the attribution results of each new user acquisition in the overseas attribution table in Sensors Analytics for you to view and analyze the overseas channel sources corresponding to the user behaviors reported by Sensors Analytics.
3. In addition to the default attribution information, you can also add other message fields allowed to be pushed back by the Push API to the event properties and overseas attribution table to flexibly analyze other overseas channel properties.
Integration Process
If you are using the Push API for raw data access for the first time, you need to complete the following configurations in order during the docking phase:
1. Integrate and configure AppsFlyer and Sensors Analytics SDKs
Integrate the AppsFlyer client SDK and the Sensors Analytics client SDK, and use the Sensors Analytics SDK to obtain the Sensors Analytics user identifier in the client, and pass the identifier to the AppsFlyer client SDK through the specified interface, so that the Sensors Analytics user identifier is carried with the user behavior events reported by AppsFlyer.
2. Configure the Push API interface on the AppsFlyer platform
Copy the data receiving URL from the "Third-party Data Integration" - "AppsFlyer Push API Data Access" page in the Sensors Analytics platform and fill it in the AppsFlyer Push API endpoint address, and configure the target event and message fields in the same location.
3. Enable data collection and event writing in the Sensors Analytics platform, and add other custom message fields as needed
When the Sensors Analytics system receives real-time pushback data, it will automatically integrate the data according to the write rules you configured. At this time, you can query the user behavior events reported by Sensors Analytics and their corresponding channel sources in the Sensors Analytics model.
Client SDK Settings
If you want to associate the user behavior reported by the Push API with the user behavior reported by the Sensors Analytics system at the user level, you need to report the Sensors Analytics user identifier in the AppsFlyer client SDK.
The Sensors Analytics user identifier used by this feature is the Anonymous ID (distinct_id) and whether the user is logged in (is_login). After initializing Sensors Analytics and AppsFlyer SDKs according to the specified process, call the interface to enable the reporting of this identifier.
For detailed configuration steps, please refer to the Third-party Data Access Guide (Android) and the Third-party Data Access Guide (iOS).
Configure the AppsFlyer Push API interface.
You need to log in to the AppsFlyer backend with an administrator account, and configure the original data feedback of the Push API in "Integration"-"API Data Interface".
Please follow the steps below to configure the original data feedback of the Push API:
1. HTTP Request Method
- Sensors Analytics supports both POST and GET methods for data feedback. We recommend choosing the POST method.
2. Endpoint URL
- Please copy the Data Receiving URL in the "AppsFlyer Push API Integration" of the Sensors Analytics system and fill it in here. Please note that each Sensors Analytics project has a different Data Receiving URL.
3. Event Messages
- Please select at least "Install" and "Install in-app events". If you want to feedback other event data, you can check them as needed.
4. Message Fields
- At least the following message fields should be included:
- Fields related to Sensors Analytics user identifier: custom_data, customer_user_id, appsflyer_id, idfa, advertising_id
- Fields related to event reporting: event_time, event_time_selected_timezone, app_id
- Fields related to channel attribution: media_source, network_account_id, campaign, af_c_id, af_adset, af_adset_id, af_ad, af_ad_id, af_keywords, keyword_id, conversion_type
- Add other fields that need to be used as event or third-party attribution properties as needed
- If there is no special requirement, it is recommended that you check all message fields.
5. In-app events tracking
- Select the in-app events to be tracked, such as the purchase event reported by the client.
Note
If you need to track Facebook's raw data, you need to collectively agree to Facebook's data use agreement in the Facebook channel settings in the AppsFlyer backend (Terms of Service), otherwise you will not be able to obtain Facebook's user-level raw data.
After completing the above steps, you have successfully set up the AppsFlyer Push API endpoint in the Sensors Analytics system endpoint. Next, you need to complete the AppsFlyer Push API related data receiving configuration in the Sensors Analytics platform.
Configuring AppsFlyer Push API Data Receiving in Sensors Analytics
Before setting up the platform functionality, please make sure that 2.1.1 and 2.1.2 have been completed, otherwise the following settings will not take effect.
Turn on the data receiving switch
In "Third Party Data Integration", find "AppsFlyer Push API" and click the "Access Configuration" button to enter the configuration page.
Click the "Data Receiving Configuration" edit button, and check "Enable Data Receiving" and save it. When the "Effective Status" is "Enabled", the data receiving switch has been turned on.
Note: The data receiving switch takes effect in real time, and the change of status will be confirmed twice. Do not change the status at will to avoid affecting the real-time transmission data result.
Turn on event writing switch
Click the "Event Writing Configuration" edit button, and check the "Enable event writing" option. At this time, you can configure the user behavior events you want to receive based on the events Callbacked in AppsFlyer Push API. The Sensors Analytics system will write the original data into the event table in the format of "mmp_af_target event name" and record the corresponding user table information.
For example: If you want to record the payOrder event Callbacked by AppsFlyer in the Sensors Analytics system, you first need to make sure that AppsFlyer has reported this behavior event, and then make sure that the payOrder event has been added in the Callback of in-app events in Push API. Finally, enable the event writing function in the "Event Writing Configuration" of Sensors Analytics, and add the "mmp_af_payOrder" event. In this way, when AppsFlyer Callbacks the payOrder event, the Sensors Analytics system will automatically write it into the event table.
Notice
1. Writing AppsFlyer callback events will consume the event volume in your SensAnalytics package; in particular, when the data reception function is enabled, regardless of whether you enable event writing, the activation event (Install) will be written to the event table to consume the package event volume in order to achieve the integration of SensAnalytics and AppsFlyer attribution.
2. Please be sure to fill in the accurate event name according to the callback event fields configured in AppsFlyer (you can confirm the callback event name with your AppsFlyer account manager or SDK developer). The event name is case-sensitive, and filling in incorrectly will result in the event not being written to the event table.
3. When the event "visit" is entered and the enter key is pressed, it will be automatically named "mmp_af_visit", so there is no need to enter "mmp_af_" repeatedly.
4. Changing the event writing configuration will take effect in real-time and will be double confirmed. Please do not change the status casually to avoid affecting the real-time writing of data.
Configure message fields
Default receive fields
SensAnalytics by default supports writing the following AppsFlyer message fields into the event table as custom properties and synchronizes them to the SensAnalytics third-party attribution attribute table. Default receive fields are for viewing only and do not support deletion or modification.
Definition of terms is as follows:
- AppsFlyer message field name: The parameter field name provided by AppsFlyer, case-sensitive, please make sure it matches the original data dictionary field of AppsFlyer.
- SensAnalytics custom property name: In the event table, it is used to receive the custom property name corresponding to the AppsFlyer event. It is only applicable to viewing AppsFlyer events.
- SensAnalytics third-party attribution attribute name: In the third-party attribution table, it is used to uniformly receive the channel attribute fields of activation events from multiple MMPs such as AppsFlyer and Adjust. It is actually a virtual attribute. It is applicable to viewing MMP channel attribution results in SensAnalytics.
- SensAnalytics third-party first channel attribute: When a user is first attributed to a media channel, this preset user attribute is used to record the channel attribution results of MMP. Use profile setonce() to do the first update.
AppsFlyer message field grouping | AppsFlyer message field name | Corresponding SensAnalytics custom property name | Corresponding SensAnalytics third-party attribution attribute name | Corresponding SensAnalytics third-party first channel attribute | Remark |
---|---|---|---|---|---|
Attribution Information | media_source | mmp_af_media_source | mmp_media_source | mmp_first_media_source | Media Channel |
network_account_id | mmp_af_network_account_id | mmp_network_account_id | mmp_first_network_account_id | Channel Advertising Account ID | |
campaign | mmp_af_campaign | mmp_campaign | mmp_first_campaign | Advertising Campaign Name | |
af_c_id | mmp_af_campaign_id | mmp_campaign_id | mmp_first_campaign_id | Campaign ID | |
af_adset | mmp_af_adgroup | mmp_adgroup | mmp_first_adgroup | Ad Group | |
af_adset_id | mmp_af_adgroup_id | mmp_adgroup_id | mmp_first_adgroup_id | Ad Group ID | |
af_ad | mmp_af_ad | mmp_ad | mmp_first_ad | Ad Name | |
af_ad_id | mmp_af_ad_id | mmp_ad_id | mmp_first_ad_id | Ad ID | |
af_keywords | mmp_af_keyword | mmp_keyword | / | Keywords | |
keyword_id | mmp_af_keyword_id | mmp_keyword_id | / | Keyword ID | |
conversion_type | mmp_af_conversion_type | mmp_conversion_type | / | Conversion Type: Currently only support activation | |
User and Device Information | custom_data | mmp_af_custom_data_sensors_distinct_id mmp_af_custom_data_sensors_is_login | / | / | Adds the Sensetime user identifier to the AppsFlyer message field, from which the distinct_id and is_login fields can be extracted. |
customer_user_id | mmp_af_customer_user_id | mmp_customer_user_id | / | User ID set by the customer | |
appsflyer_id | mmp_af_appsflyer_id | mmp_appsflyer_id | / | User ID generated by AppsFlyer | |
advertising_id | mmp_af_advertising_id | mmp_advertising_id | / | Resettable advertising ID on Android devices, usually GAID | |
idfa | mmp_af_idfa | mmp_idfa | / | iOS Device's Resettable Advertising ID | |
App Information | app_id | mmp_af_app_id | mmp_app_id | / | Unique identifier for the app in AppsFlyer |
Custom Receiving Fields
If the default receiving fields do not meet your requirements, we support you to add custom receiving fields as needed. Please strictly follow Parameter names in the AppsFlyer raw data dictionary , fill in the AppsFlyer message field name, and fill in the name of the custom attribute for receiving.
Sensors will automatically add "mmp_af_" prefix according to the custom attribute name you fill in to distinguish the attribute from the AppsFlyer event, and automatically create the Shenze tripartite attribution attribute name with "mmp_" prefix for unified reception of tripartite channel attribution results.
For example, if you want to add app_version field to AppsFlyer, you can fill in app_version in "AppsFlyer Message Field Name", fill in app_version in "Custom Attribute Name", click "save", and click "save". The newly added user-defined receiving fields can be configured.
Meaning: When the analysis system receives the app_version message field returned by AppsFlyer, it will automatically create and write the mmp_af_app_version custom attribute when writing the event; If the received event is Install, the mmp_app_version virtual property is automatically created and written into the property. If the same user reports the behavior event through the Shenze SDK, the mmp_app_version value can be associated query.
Note
1. Whether it is a default receiving field or a custom receiving field, before use, please make sure that the following fields have been checked in the AppsFlyer Push API return message field, otherwise AppsFlyer will not return message fields, and God will not receive them.
2. The mapping rule takes effect in real time after the customized message field is edited and saved, the same as the data receiving configuration and event writing configuration. Do not change the data arbitrarily. Otherwise, data writing may be affected.
3, The custom attribute received by the analysis has a length limit, the default is the maximum length of 1024 bytes after UTF-8 encoding. Detailed referenceData format
Data entry rules
User identification rule
According to the user ID field set in the client SDK, user ID will be found by default by clicking the following fields in the returned install data:
- Check that the custom_data field contains sensors_distinct_id/sensors_is_login, the user identifier field that God sent to AppsFlyer
- Check if the return field contains af_id, the user ID field of AppsFlyer
If a valid user ID can be obtained in Step 1, stop the check in Step 2 and record the user according to the user ID.
If the valid user id cannot be obtained in Step 1, the af_id in Step 2 is used as the anonymous ID of the user. Notice that the user cannot be associated with the Shenze Report user.
If a valid user id cannot be obtained in Step 1 and 2, an anonymous ID is randomly generated to record the user. Notice that the user cannot be associated with other users.
Note
If you use a special user identification field in the Sensors Analytics system (the use of distinct_id and is_login cannot accurately identify your users), please contact your account manager. We will make adjustments during the delivery phase to adapt to your business situation.
Event Storage Rules
As long as the data receiving switch is turned on, whether event writing is enabled or not, the Sensors Analytics system will default to write the received activation event (Install) to the event table. If you have configured other event writing in the event writing configuration, the Sensors Analytics system will write them together.
The following are the rules for event data storage:
- The written event data is attributed to the corresponding user in accordance with the Sensors Analytics user identification rules.
- Use the event_time field in the passed-back data as the reported time (time) of the event.
- The written event name will be prefixed with "mmp_af_" to distinguish it from other events reported by you. In particular, the Install event will be written by default as mmp_af_Install without the need for configuration.
- The written events will carry a custom property mmp_name= AppsFlyer.
- The written event property name will be prefixed with "mmp_af_" before your configured custom property name to distinguish it from other event properties reported by you. For example, the media_source in the AppsFlyer message field will be written as mmp_af_media_source according to the mapping.
User Property Storage Rules
When receiving any passed-back event and updating the user table, if the user has no "third-party channel user property" at this time, the profile_set_once() function will be used to update the following first-time third-party channel user properties.
Sensors First-Time Third-Party Channel Properties (Predefined user properties) | AppsFlyer message field name | Notes |
---|---|---|
mmp_first_media_source | media_source | Media Channel |
mmp_first_account_id | network_account_id | Channel advertiser account ID |
mmp_first_campaign | campaign | Advertising campaign name |
mmp_first_campaign_id | af_c_id | Advertising campaign ID |
mmp_first_adgroup | af_adset | Ad group |
mmp_first_adgroup_id | af_adset_id | Ad group ID |
mmp_first_ad | af_ad | Ad name |
mmp_first_ad_id | af_ad_id | Ad ID |
Tripartite Attribution Table Update Rules
The SensAnalytics system supports receiving and saving the attribution results from various third-party attribution platforms, and associates the user behavior reported by SensAnalytics with the third-party attribution results through the integrated SensAnalytics user identification. The rules for updating the third-party attribution table are as follows:
- The third-party attribution table is updated only when the activation event (Install) from AppsFlyer is received and carries a valid SensAnalytics user identification. (Re-attribution results related to remarketing are not yet supported for updating)
- When updating, the SensAnalytics user identification is used as the primary key to add a new attribution record, recording the start and end time of the attribution result and the channel information.
- Start and end time: When adding a new attribution record, it is always guaranteed that all the attribution records of the same user are continuous and non-repetitive.
- Channel information: It refers to the third-party attribution properties (virtual properties) written, which is formatted by adding the prefix "mmp_" to the custom attribute name you configured.
Data Query Method
After completing the above configuration and integration, you can query the AppsFlyer events that have been integrated with the user and the third-party attribution channel results associated with the events reported by SensAnalytics. The method is as follows.
Query the integrated AppsFlyer events
Take the default integrated Install event as an example, filter the event "mmp_af_install" in the event analysis, and check the custom attribute "mmp_af_app_id" in the grouping selection to see the query result example below.
Depending on your actual needs, you can filter other events that have been integrated and custom attributes (be sure to be consistent with the format of the names in the event writing configuration and message field configuration, otherwise the results will not be queried. The custom attributes of AppsFlyer all start with "mmp_af_").
Query the integrated AppsFlyer users
Take the default integrated Install event as an example, filter the event "mmp_af_install" in the event analysis, and check the third-party user channel attribute "mmp_first_media_source" in the grouping selection to see the query result example below.
Depending on your actual needs, you can filter other events that have been integrated and third-party user channel attributes (by default, only 5 third-party user channel attributes are written during the first update, all starting with "mmp_first_").
Query the third-party attribution channel results associated with the events reported by SensAnalytics
Take the in-app user behavior payOrder as an example, filter the event "payOrder" in the event analysis, and check the third-party channel attribute "mmp_media_source" in the grouping selection to see the query result example below.
You can filter other collection events and third-party channel attributes based on actual requirements. (The format of the name must be the same as that in the message field configuration; otherwise, the query result will not be available.) All three channel attributes start with mmp_)