# AppsFlyer Integration

AppsFlyer is a global platform for mobile marketing analytics and attribution that helps track ad campaign performance and optimize mobile app user acquisition. It comprehensively analyzes user behavior data to evaluate the effectiveness of marketing strategies and provides transparent visibility into performance across various marketing channels.

By integrating Hackle with AppsFlyer, you can **import mobile app acquisition data as User Properties and use them for A/B Test targeting or detailed analysis**.

{% hint style="info" %}
**Want to integrate AppsFlyer with Hackle?**

Integrate AppsFlyer with Hackle and experience deeper analysis and growth.

[👉 Contact us now](https://hackle.io/ko/?inquiry=true\&utm_source=blog)
{% endhint %}

### Setting Up AppsFlyer Integration

#### Hackle Dashboard Configuration

1. Before integrating, both the Hackle SDK and AppsFlyer SDK must be installed in your service.
2. Go to Workspace Settings > External Integration in the Hackle Dashboard. ([Link](https://dashboard.hackle.io/config/integrations))

   ![](/files/maErN6yLJ18eJRQi6YlU)
3. Select AppsFlyer.

   You can check the AppsFlyer integration status and the API Key required for integration. The integration status will change to "Integration Complete" once the API Key is registered in AppsFlyer and events are successfully received in Hackle from AppsFlyer. Proceed to the next step in the AppsFlyer Dashboard.

   ![](/files/hUhpWfBNfALzmOoYza6S)

#### AppsFlyer Dashboard Configuration — Adding a Partner

![Menu -> Configuration -> Partner Marketplace](/files/SUhOJny9YUonfFVaTkcC)

![Navigate to Partner Marketplace](/files/yjsUocv3f4WVseIRlJUW)

![Search for Hackle in Partner Marketplace and click the Hackle partner](/files/CwrviSGoPPs0kW0gQjOD)

![Navigate to Integration Management](/files/YMoutrWB8JvdXYku4PKo)

#### Partner Integration Configuration

* Hackle API Key Setup Enter the API Key issued from the Hackle Dashboard above.
* Hackle Partner Permissions Setup

![Menu -> Configuration -> Active Integrations (Permissions tab)](/files/eTGcItcpIZTGbolswrK0)

* Default Postback Configuration

For user acquisition source, select **All Media Sources, Including Organic**

![Change user acquisition source](/files/D3fWikqXumwkRzAS23Vh)

You have now completed the AppsFlyer Dashboard configuration for sending data from AppsFlyer to Hackle. Finally, complete the SDK integration work to connect the transmitted data with other Hackle data.

#### SDK Integration Work

To properly use data sent from AppsFlyer in Hackle, you must send the Hackle Device ID to the AppsFlyer SDK.

Configure the AppsFlyer integration code as shown below. The Hackle Device ID can only be retrieved properly after the Hackle SDK is initialized (init).

HackleCustomId is sent with all postbacks and is used to identify users.

Postback events are billed the same as regular events.

```java
HashMap<String, Object> customData = new HashMap<String,Object>();

String deviceId = HackleApp.getInstance().getDeviceId();
customData.put("hackleCustomId", deviceId);

AppsFlyerLib.setAdditionalData(customData);
```

```swift
let deviceId = Hackle.app()!.deviceId
let customData = ["hackleCustomId": deviceId]

AppsFlyerLib.shared().customData = customData
```

#### App Install Event ($af\_install)

App install events are sent to Hackle as an event called $af\_install.

#### In-App Event ($af\_inapp)

Additionally, by configuring in-app event postbacks, you can also send events collected through AppsFlyer to Hackle in the form of $af\_inapp. Events collected via postback cannot be used as triggers for In-App Messages or Push Messages that require real-time processing, but they can be used for data analysis purposes such as checking conversion status or querying amounts.

![In-App Event Configuration](/files/51xvHYE8heOYo8lis7zd)

#### Event Timestamp Adjustment

By default, events collected via postback are stored based on the time the event is sent from AppsFlyer to the Hackle server. In this case, there may be a difference of a few minutes from when the actual event occurred. If you send the Timestamp parameter in the postback parameters for install and in-app events, the event is stored based on the actual time the event occurred in AppsFlyer.

![Timestamp](/files/EJNjNT7vxSS86vHFsh1g)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/external-link/appsflyer-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
