Aghanim-AppsFlyer Integration
This guide explains how to integrate Aghanim with AppsFlyer to streamline mobile attribution and analytics. By connecting Aghanim with AppsFlyer, you can track player-generated events from the game hub, ensuring precise tracking of user actions across your entire game environment.
Aghanim sends events to AppsFlyer when a player successfully completes a payment on the game hub, and when one of those payments is later refunded.
Requirements
- AppsFlyer account
- Administrative permissions to generate or retrieve API tokens
Step 1: Provide the AppsFlyer API token
Obtain an API token from AppsFlyer to authenticate communication, enabling Aghanim to send events:
- Log in to AppsFlyer.
- In the dashboard, go to Configuration → API Tokens or Server-to-Server (S2S) Tokens.
- If an API token is not already available, generate a new token following the provided instructions.
- Copy the generated token.
- Proceed to Aghanim Dashboard → App Connect → AppsFlyer and install the plugin.
- In the plugin settings, paste the generated token.
For more details, see the AppsFlyer documentation.
Step 2: Add AppsFlyer attributes to player.verify webhook response
To ensure AppsFlyer correctly identifies users and attributes their actions on the game hub, include the AppsFlyer‑specific attributes in the player.verify webhook response:
| Key | Type | Description | Required? |
|---|---|---|---|
attributes.appsflyer_id | string | A unique identifier generated by AppsFlyer when the app launches for the first time. This ID links the user's activity within the app to their AppsFlyer profile. Example: 1234567890123-1234567. | Yes |
attributes.appsflyer_app_id | string | The app identifier as defined in the AppsFlyer dashboard. It links the data to the correct application in AppsFlyer. Example: id123456789. | Yes |
attributes.appsflyer_customer_user_id | string | Overrides the customer_user_id sent to AppsFlyer. If omitted, Aghanim uses player_id. Example: 7572192912325116189. | No |
attributes.appsflyer_event_params | object | Optional custom parameters to include in the AppsFlyer event. You can add parameters directly or nest them inside eventValue. Example: {"idfa": "9876F1SS-2983-3855-27RR-2R626772VFNB", "eventValue": {"your_custom_attribute": "456.123"}}. | No |
For additional details on the attribute values, refer to the AppsFlyer documentation.
Example webhook response:
{
"player_id": "1x1x-xxxx1",
"name": "Molly",
"attributes": {
"appsflyer_id": "1234567890123-1234567",
"appsflyer_app_id": "id123456789",
"appsflyer_customer_user_id": "7572192912325116189",
"appsflyer_event_params": {
"idfa": "9876F1SS-2983-3855-27RR-2R626772VFNB",
"eventValue": {
"your_custom_attribute": "456.123"
}
}
}
}
Step 2 (B): Pass AppsFlyer attributes via Deep Link
Alternatively, if you can't send attributes through the player.verify webhook response, like if you do not store this ID on the server,
you can pass query parameters in the deep link login URL:
https://<GAME_HUB_URL>/go/login?player_id=<UNIQUE_PLAYER_ID>&attributes.appsflyer_id=<APPSFLYER_ID>&attributes.appsflyer_app_id=<APPSFLYER_APP_ID>
However, we recommend using the webhook method, as it is more reliable and secure.
Optional: Exclude reward points and virtual currency purchases
By default, Aghanim sends a purchase event to AppsFlyer for every successful payment, including those paid with reward points or virtual currency. Because these purchases have zero real-money revenue, they can interfere with AppsFlyer user-acquisition campaign machine learning models that optimize on revenue signals.
To exclude them, configure the AppsFlyer plugin in Aghanim Dashboard → App Connect → AppsFlyer:
| Setting | Type | Description |
|---|---|---|
| Exclude reward points purchases | toggle | When enabled, purchases paid entirely with reward points are skipped and no AppsFlyer event is sent. |
| Exclude virtual currency purchases | multi-select | Select one or more virtual currencies. Purchases paid with any of the selected virtual currencies are skipped and no AppsFlyer event is sent. Leave empty to send events for all virtual currency purchases. |
Both options are optional and independent — you can enable either, both, or neither. Real-money purchases are always sent to AppsFlyer regardless of these settings.
Need help?
Contact our integration team at [email protected]