# Adjust

***

To integrate [Adjust](https://www.adjust.com/), please, go to Settings=>Applications=>Your Application=>Edit=>Choose Adjust set up

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FVswbR6qEZZsQWcxb622c%2Fimage.png?alt=media&#x26;token=e6605877-2a58-4956-ae15-c8a8c49b0abb" alt=""><figcaption></figcaption></figure>

Appflow\.ai will be sending subscription events to Adjust.

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2F4qIwMYICZG3A7hNR76pg%2Fimage.png?alt=media&#x26;token=905a4532-2f12-4926-97ee-7dd06fc7bc72" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %} <mark style="color:orange;">**Don't forget account token**</mark>

To integrate Adjust you will need to activate integration, add app token, account token and environment.
{% endhint %}

**To integrate Adjust you will need to activate integration, add app token, account token and environment.** To make it work, you will also need to generate event tokens on Adjust and add into the same page to the right events places.

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FQl0NSPWp7NvBYhU3gbNw%2Fimage.png?alt=media&#x26;token=1f2dfae7-64dc-48d2-accb-4995ba3b5009" alt=""><figcaption></figcaption></figure>

To find Account API token on Adjust you can check Adjust [documentation](https://help.adjust.com/en/article/report-service-api-authentication#use-adjust-token-api-calls)\
or here is quick guide:

If you are an admin:

* Log in to the Adjust dashboard.
* Select the menu icon in the top left.
* Select My Account.
* In the Your Data tab, find the User Details section. Select the cog icon () at the bottom of this segment.
* Select API Token.
* Copy your API token from the API Token panel.

If you are not admin user of Adjust:

* Log in to the Adjust dashboard.
* Select the menu icon in the top left.
* Select My Profile.
* Select API Token.
* Copy your API token from the API Token panel.

Also, please copy and paste the link by the provided path into Adjust.

{% hint style="warning" %}
If you don't finish this step, you could not get the iOS attribution info from Adjust.
{% endhint %}

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FtMwLgn2WWK37tGyec6Ob%2Fimage.png?alt=media&#x26;token=e16c988c-73c9-4b53-bb2c-cc904dca2e18" alt=""><figcaption></figcaption></figure>

### Integration

Here is a more detailed instruction on how to interact inside the Adjust exactly to send events to Adjust:

1. Create an app

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2Fpf4E2ue15EMqtgU444xt%2Fimage.png?alt=media&#x26;token=140eb12a-c3cb-4880-a246-50a37df1b992" alt=""><figcaption></figcaption></figure>

2. Copy the app token

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FbNvn7VCtjseTntKbp2gn%2Fimage.png?alt=media&#x26;token=77f8ca8e-8ef6-4394-8590-4bcc24397bdc" alt=""><figcaption></figcaption></figure>

and copy to Appflow\.ai Adjust setting.

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FIk3f6tyBKnHJ5Q4ZYJ9n%2Fimage.png?alt=media&#x26;token=8a1079bf-aebc-4937-86bd-9a1d5f39888f" alt=""><figcaption></figcaption></figure>

3. Now we need to create events first. Click on All Settings on the same Adjust screen. Click on Events

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FiYpPHfDYbwOlrBIMggtE%2Fimage.png?alt=media&#x26;token=55424c31-dfc4-411f-ab00-c3eb705a1712" alt=""><figcaption></figcaption></figure>

Near each event, you see the event token. Copy it to the Appflow\.ai events list

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FUUZaLE6m1DygHD8K2Jbu%2Fimage.png?alt=media&#x26;token=a6f9b562-2d46-4352-8d1c-328b2ba587b1" alt=""><figcaption></figcaption></figure>

### Attribution

If you want to do the opposite, meaning take attributes FROM Adjust\
You need just point 5 from this explanation (provide your developer with it). However, we provide you with some help steps (1-4) you may need for the testing.

Don't forget that your app should be integrated with Adjust:\
<https://help.adjust.com/en/article/get-started-android-sdk>\
<https://help.adjust.com/en/article/get-started-ios-sdk>

1. Create the app, as mentioned previously
2. Click on Tracker URLs and create a tracker

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FIGuAmZIeoq3tVsLxIkVs%2Fimage.png?alt=media&#x26;token=00f0a821-1fee-4966-b150-b8b8ed0ce5b8" alt=""><figcaption></figcaption></figure>

3. Call it anyhow you want

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FaVFW5UTEQYvNyevY8gwr%2Fimage.png?alt=media&#x26;token=63440ef9-5065-4676-8bbe-927f8446d91a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2FOOrN2zDVl28NJ0VMznSl%2Fimage.png?alt=media&#x26;token=8dfbac9e-0aa4-4d51-b8e8-45ca9c700f24" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2F0OZCt4GTFVF1rAqp30wK%2Fimage.png?alt=media&#x26;token=e591474e-a38e-4e28-a7a8-daaf93df9a6c" alt=""><figcaption></figcaption></figure>

4. Copy Tracking URL

<figure><img src="https://1902080327-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUSTYqtR8RNNkx3qqWf9%2Fuploads%2F1xacWTmf2BrztQ41pMzJ%2Fimage.png?alt=media&#x26;token=1ea31c96-1d44-4a92-b6a1-1775c7ad4dca" alt=""><figcaption></figcaption></figure>

**5. Ask your developer to put to the SDK:**\
\
for iOS

To upload Adjust attribution data, the developer accesses the Adjust SDK and reports the data in the AdjustDelegate method, refer to the example below

```swift
extension AppDelegate: AdjustDelegate {
    //Callback for the first app installation
    func adjustAttributionChanged(_ attribution: ADJAttribution?) {
        // Just pass Adjust attribution to Adapty SDK
        if let attribution = attribution?.dictionary() {
            Appflow.shared.updateAttribution(attribution, source: .adjust)
        }
    }
    
}
```

Android

Adjust\
To upload Adjust attribution data, refer to the example below

```kotlin
val config = AdjustConfig(context, adjustAppToken, environment)
config.setOnAttributionChangedListener { attribution ->
    attribution?.let { attribution ->
        Appflow.updateAttribution(attribution, AttributionType.ADJUST)
    }
}
Adjust.onCreate(config)
```
