# Adjust Integration

## What is Adjust?

Adjust is an attribution service for mobile app marketing that provides features for effectively managing and analyzing ad campaigns. It offers data-driven solutions for user acquisition, retention, and conversion.

By integrating Hackle with Adjust, 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 Adjust with Hackle?**

Integrate Adjust with Hackle and experience deeper analysis and growth.

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

## Adjust SDK Integration

To integrate with Adjust, you need to send the identifiers (user ID) and properties collected by the Adjust SDK to the Hackle SDK.

{% hint style="warning" %}
SDK call order must be guaranteed

You must call the functions below after the Adjust SDK initialization is complete to properly retrieve Adjust information. Then send that information to the Hackle SDK.
{% endhint %}

### Retrieving Adjust Identifiers

You can call the Adjust SDK to retrieve Adjust identifiers. In addition to the most basic Adjust device identifier (Adid), you can use various other identifier information. For details, see [Adjust's official documentation](https://help.adjust.com/en/article/get-device-information-unity-sdk).

```csharp
//Adjust device identifier
string adid = Adjust.getAdid();

//ID for Advertisers
string idfa = Adjust.getIdfa();

//Google Play Services Advertising ID
Adjust.getGoogleAdId((string googleAdId) => {
   //...
}};

//Amazon Advertiser ID
string amazonAdId = Adjust.getAmazonAdId();
```

```java
//Adjust device identifier
String adid = Adjust.getAdid();

//Google Play Services Advertising ID
Adjust.getGoogleAdId(this, new OnDeviceIdsRead() {
    @Override
    public void onGoogleAdIdRead(String googleAdId) {}
});

//Amazon Advertiser ID
String amazonAdId = Adjust.getAmazonAdId(context);
```

```javascript
//Adjust device identifier
let adid = Adjust.getAdid();

//Google Play Services Advertising ID
Adjust.getGoogleAdId(function(googleAdId) {
    // ...
});

//Amazon Advertiser ID
let amazonAdId = Adjust.getAmazonAdId();
```

```swift
//Adjust device identifier
NSString *adid = [Adjust adid];

//iOS ID for Advertisers (IDFA)
NSString *idfa = [Adjust idfa];
```

```swift
//Adjust device identifier
let adid = Adjust.adid()

//iOS ID for Advertisers (IDFA)
let idfa = Adjust.idfa()
```

```javascript
//Adjust device identifier
var adid = Adjust.getAdid();

//iOS ID for Advertisers (IDFA)
Adjust.getIdfa(function(idfa) {
   // …
});
```

### Retrieving Adjust Attribution Information

You can call the Adjust SDK to retrieve various attribution information such as ad network and campaign, in addition to identifiers. For details, see [Adjust's official documentation](https://help.adjust.com/en/article/attribution-information-unity-sdk#get-current-attribution-information).

```csharp
//Get current attribution information
var attribution = Adjust.getAttribution();
```

```java
///Get current attribution information
AdjustAttribution attribution = Adjust.getAttribution();
```

```javascript
///Get current attribution information
let attribution = Adjust.getAttribution();
```

```swift
///Get current attribution information
ADJAttribution *attribution = [Adjust attribution];
```

```swift
///Get current attribution information
let attribution = Adjust.attribution()
```

```javascript
///Get current attribution information
var attribution = Adjust.getAttribution();
```

### Sending Identifiers and Properties to the Hackle SDK

In the code that integrates with Hackle, send the identifiers and properties retrieved from Adjust as custom identifiers and properties as shown below. For more accurate details, see the User Identifier & Properties documentation for each SDK language. [(Link)](/en/development-guide/unity/unity-user-info.md)

#### Sending Identifiers

Send the desired identifier to the Hackle SDK as a custom identifier.

```csharp
// Custom Identifier
Hackle hackle = Hackle.GetInstance();

HackleUser user = new HackleUser.Builder()
    .Identifier("myCustomId", "CUSTOM_IDENTIFIER") // Custom ID
    .Build();

hackle.SetUser(user);
```

```java
// Custom Identifier
import io.hackle.sdk.common.User

User user = User.builder()
    .identifier("myCustomId", "42")  // Custom ID
    .build();

hackleApp.setUser(user);
```

```objectivec
// Custom Identifier
HackleUserBuilder *builder = [User builder];
[builder identifier:@"myCustomId" :@"42"]; // Custom ID
User *user = [builder build];

[hackleApp setUserWithUser:user];
```

```swift
// Custom Identifier
let user = User.builder()
    .identifier("myCustomId", "42") // Custom ID
    .build()

hackleApp.setUser(user: user)
```

#### Sending User Properties

Send the desired attribution information to the Hackle SDK as custom User Properties.

```csharp
// Custom User Properties
PropertyOperations operations = new PropertyOperations.Builder()
  .Set("age", 42)
  .Set("grade", "GOLD")
  .SetOnce("sign_up_date", "2020-07-03")
  .Build();

hackle.UpdateUserProperties(operations);
```

```java
// Custom User Properties
PropertyOperations operations = PropertyOperations.builder()
    .set("age", 42)
    .set("grade", "GOLD")
    .setOnce("sign_up_date", "2020-07-03")
    .build();

hackleApp.updateUserProperties(operations);
```

```objectivec
// Custom User Properties
PropertyOperationsBuilder *builder = [PropertyOperations builder];
[builder set:@"age" :@42];
[builder set:@"grade": @"GOLD"];
[builder setOnce:@"sign_up_date" :@"2020-07-03"];
PropertyOperations *operations = [builder build];

[hackleApp updateUserPropertiesWithOperations:operations];
```

```swift
// Custom User Properties
let operations = PropertyOperations.builder()
    .set("age", 42)
    .set("grade", "GOLD")
    .setOnce("sign_up_date", "2020-07-03")
    .build()

hackleApp.updateUserProperties(operations: operations)
```


---

# 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/adjust-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.
