---
title: "Adjust"
description: "Connectez Adjust à Adapty pour un meilleur suivi des abonnements et des analyses."
---

[Adjust](https://www.adjust.com/) est l'une des principales plateformes Mobile Measurement Partner (MMP) qui collecte et présente les données des campagnes marketing. Cela aide les entreprises à suivre les performances de leurs campagnes.

Adapty fournit un ensemble complet de données vous permettant de suivre les [événements d'abonnement](events) depuis les stores en un seul endroit. Avec Adapty, vous pouvez facilement observer le comportement de vos abonnés, comprendre leurs préférences et utiliser ces informations pour communiquer avec eux de manière ciblée et efficace. Cette intégration vous permet ainsi de suivre les événements d'abonnement dans Adjust et d'analyser précisément les revenus générés par vos campagnes.

L'intégration entre Adapty et Adjust fonctionne de deux manières principales.

1. **Adapty reçoit les données d'attribution depuis Adjust**
   Une fois l'intégration Adjust configurée, Adapty commencera à recevoir les données d'attribution depuis Adjust. Vous pouvez facilement consulter ces données sur la page du profil utilisateur.

  
    <img src="/assets/shared/img/98769d9-CleanShot_2023-08-11_at_14.39.182x.webp"
    style={{
      border: '1px solid #727272', /* border width and color */
      width: '700px', /* image width */
      display: 'block', /* for alignment */
      margin: '0 auto' /* center alignment */
    }}
  />
  

2. **Adapty envoie les événements d'abonnement à Adjust**
   Adapty peut envoyer à Adjust tous les événements d'abonnement configurés dans votre intégration. Vous pourrez ainsi suivre ces événements depuis le tableau de bord Adjust. Cette intégration est utile pour évaluer l'efficacité de vos campagnes publicitaires.

## Configurer l'intégration \{#set-up-integration\}

### Connecter Adapty à Adjust \{#connect-adapty-to-adjust\}

1. Ouvrez l'Adapty Dashboard et accédez à [Integrations > Adjust](https://app.adapty.io/integrations/adjust).

2. Activez le bouton en haut de la page.

3. Remplissez les champs et renseignez vos identifiants d'accès.

  
    <img src="/assets/shared/img/5064125-CleanShot_2023-08-11_at_14.43.382x.webp"
    style={{
      border: '1px solid #727272', /* border width and color */
      width: '700px', /* image width */
      display: 'block', /* for alignment */
      margin: '0 auto' /* center alignment */
    }}
  />
  

3. Si vous avez activé l'autorisation OAuth sur la plateforme Adjust, vous devez obligatoirement fournir un **OAuth Token** lors du processus d'intégration pour vos applications iOS et Android.
4. Ensuite, fournissez les **app tokens** pour vos applications iOS et Android. Ouvrez votre tableau de bord Adjust et vous y verrez vos applications.

  
    <img src="/assets/shared/img/adjust-apps.webp"
    style={{
      border: '1px solid #727272', /* border width and color */
      width: '700px', /* image width */
      display: 'block', /* for alignment */
      margin: '0 auto' /* center alignment */
    }}
  />
  

:::note
Vous pouvez avoir des applications Adjust différentes pour iOS et Android. Dans Adapty, vous disposez donc de deux sections indépendantes pour cela. Si vous n'avez qu'une seule application Adjust, renseignez simplement les mêmes informations.
:::

5. Sélectionnez votre application dans la liste et copiez l'**App Token**. Collez le token dans le champ correspondant sur l'Adapty Dashboard.

  <img src="/assets/shared/img/adjust-token.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

### Configurer les événements et les tags \{#configure-events-and-tags\}

Adjust fonctionne un peu différemment des autres plateformes. Vous devez créer manuellement des événements dans le tableau de bord Adjust, récupérer les tokens d'événement, puis les copier-coller dans les événements correspondants dans Adapty.

La première étape consiste donc à trouver les tokens d'événement pour tous les événements que vous souhaitez qu'Adapty envoie. Pour ce faire :

1. Dans le tableau de bord Adjust, ouvrez votre application et accédez à l'onglet **Events**.

  <img src="/assets/shared/img/adjust-events.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

1. Copiez le token d'événement et collez-le dans Adapty. Sous les identifiants, vous trouverez trois groupes d'événements que vous pouvez envoyer à Adjust depuis Adapty. Consultez la liste complète des événements proposés par Adapty [ici](events).

  <img src="/assets/shared/img/adjust-event-token.webp"
  style={{
    border: '1px solid #727272', /* border width and color */
    width: '700px', /* image width */
    display: 'block', /* for alignment */
    margin: '0 auto' /* center alignment */
  }}
/>

Adapty enverra les événements d'abonnement à Adjust via une intégration serveur à serveur, ce qui vous permettra de consulter tous les événements d'abonnement dans votre tableau de bord Adjust et de les associer à vos campagnes d'acquisition.

:::important
Tenez compte des points suivants :

- Adjust ne prend pas en charge les événements de plus de 58 jours. Ainsi, si vous avez un événement datant de plus de 58 jours, Adapty l'enverra à Adjust, mais la date et l'heure de l'événement seront remplacées par l'horodatage actuel.
- Adjust ne prend pas en charge IPv6. Si vous désactivez la collecte IP dans le SDK dans **App settings** ou lors de l'activation du SDK, seule une adresse IPv6 backend peut être envoyée, ce qui peut entraîner un échec du suivi — gardez la collecte IP du SDK activée pour garantir l'utilisation d'IPv4.

:::

### Connecter votre application à Adjust \{#connect-your-app-to-adjust\}

Après avoir effectué les étapes décrites ci-dessus, ajoutez les deux méthodes suivantes à votre application. Elles établiront la communication entre votre application et Adjust :

1. **Pour envoyer les données d'abonnement à Adjust** : Passez l'identifiant d'appareil Adjust à la méthode SDK `setIntegrationIdentifier()`
2. **Pour recevoir les données d'attribution depuis Adjust** : Mettez à jour les données d'attribution avec la méthode SDK `updateAttribution()`

Pour Adjust version 5.0 ou ultérieure, utilisez l'exemple suivant :

<Tabs groupId="current-os" queryString>
<TabItem value="swift" label="iOS (Swift)" default>

```swift showLineNumbers
class AdjustModuleImplementation {
    func updateAdjustAdid() {
        Adjust.adid { adid in
            guard let adid else { return }
            // Adapty SDK 4.x
            Adapty.setIntegrationIdentifier(.adjustDeviceId(adid))
            // Adapty SDK 3.x
            Adapty.setIntegrationIdentifier(key: "adjust_device_id", value: adid)
        }
    }

    func updateAdjustAttribution() {
        Adjust.attribution { attribution in
            guard let attribution = attribution?.dictionary() else { return }
            // Adapty SDK 4.x
            Adapty.updateAttribution(attribution, source: .adjust)
            // Adapty SDK 3.x
            Adapty.updateAttribution(attribution, source: "adjust")
        }
    }
}
```

</TabItem>
<TabItem value="kotlin" label="Android (Kotlin)" default>

```kotlin showLineNumbers
Adjust.getAdid { adid ->
    if (adid == null) return@getAdid

    Adapty.setIntegrationIdentifier("adjust_device_id", adid) { error ->
        if (error != null) {
            // handle the error
        }
    }
}

Adjust.getAttribution { attribution ->
    if (attribution == null) return@getAttribution

    Adapty.updateAttribution(attribution, "adjust") { error ->
        // handle the error
    }
}
```

</TabItem>
<TabItem value="java" label="Android (Java)" default>

```java showLineNumbers
Adjust.getAdid(adid -> {
    if (adid == null) return;

    Adapty.setIntegrationIdentifier("adjust_device_id", adid, error -> {
        if (error != null) {
            // handle the error
        }
    });
});

Adjust.getAttribution(attribution -> {
    if (attribution == null) return;

    Adapty.updateAttribution(attribution, "adjust", error -> {
        // handle the error
    });
});
```

</TabItem>
<TabItem value="rn" label="React Native (TS)" default>

```typescript showLineNumbers

var adjustConfig = new AdjustConfig(appToken, environment);

// Before submiting Adjust config...
adjustConfig.setAttributionCallbackListener(attribution => {
  // Make sure Adapty SDK is activated at this point
  // You may want to lock this thread awaiting of `activate`
  adapty.updateAttribution(attribution, "adjust");
});

// ...
Adjust.create(adjustConfig);

Adjust.getAdid((adid) => {
  if (adid)
    adapty.setIntegrationIdentifier("adjust_device_id", adid);
});
```

</TabItem>

<TabItem value="flutter" label="Flutter" default>

```javascript showLineNumbers

try {
  final adid = await Adjust.getAdid();

  if (adid == null) {
    // handle the error
  }
  
  await Adapty().setIntegrationIdentifier(
    key: "adjust_device_id", 
    value: adid,
  );
    
  final attributionData = await Adjust.getAttribution();

  var attribution = Map<String, String>();

  if (attributionData.trackerToken != null) attribution['trackerToken'] = attributionData.trackerToken!;
  if (attributionData.trackerName != null) attribution['trackerName'] = attributionData.trackerName!;
  if (attributionData.network != null) attribution['network'] = attributionData.network!;
  if (attributionData.adgroup != null) attribution['adgroup'] = attributionData.adgroup!;
  if (attributionData.creative != null) attribution['creative'] = attributionData.creative!;
  if (attributionData.clickLabel != null) attribution['clickLabel'] = attributionData.clickLabel!;
  if (attributionData.costType != null) attribution['costType'] = attributionData.costType!;
  if (attributionData.costAmount != null) attribution['costAmount'] = attributionData.costAmount!.toString();
  if (attributionData.costCurrency != null) attribution['costCurrency'] = attributionData.costCurrency!;
  if (attributionData.fbInstallReferrer != null) attribution['fbInstallReferrer'] = attributionData.fbInstallReferrer!;

  await Adapty().updateAttribution(attribution, source: "adjust");
} on AdaptyError catch (adaptyError) {
  // handle the error
} catch (e) {
  // handle the error
}
```

</TabItem>

<TabItem value="unity" label="Unity" default>

```csharp showLineNumbers
// 1. To update ADID
Adjust.GetAdid((adid) => {
    if (adid == null) {
        // handle the error
        return;
    }

    Adapty.SetIntegrationIdentifier("adjust_device_id", adid, (error) => {
        if (error != null) {
            // handle the error
            return;
        }

    });
});

// 2. To update Attribution

// in your adjust configuration scope:
adjustConfig.AttributionChangedDelegate = AttributionChangedCallback;

public void AttributionChangedCallback(AdjustAttribution attributionData) {
    var attribution = new Dictionary<string, string>();

    if (attributionData.TrackerToken != null) attribution["trackerToken"] = attributionData.TrackerToken;
    if (attributionData.TrackerName != null) attribution["trackerName"] = attributionData.TrackerName;
    if (attributionData.Network != null) attribution["network"] = attributionData.Network;
    if (attributionData.Adgroup != null) attribution["adgroup"] = attributionData.Adgroup;
    if (attributionData.Creative != null) attribution["creative"] = attributionData.Creative;
    if (attributionData.ClickLabel != null) attribution["clickLabel"] = attributionData.ClickLabel;
    if (attributionData.CostType != null) attribution["costType"] = attributionData.CostType;
    if (attributionData.CostAmount != null) attribution["costAmount"] = attributionData.CostAmount.ToString();
    if (attributionData.CostCurrency != null) attribution["costCurrency"] = attributionData.CostCurrency;
    if (attributionData.FbInstallReferrer != null) attribution["fbInstallReferrer"] = attributionData.FbInstallReferrer;

    // you will probably need to install Newtonsoft.Json package, if not yet
    var attributionJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(attribution);

    Adapty.UpdateAttribution(attributionJsonString, "adjust", (error) => {
        if (error != null) {
            // handle the error
        }
    });
}
```

</TabItem>

</Tabs>

## Structure des événements \{#event-structure\}

Adapty envoie les événements sélectionnés à Adjust selon la configuration définie dans la section **Events names** de la [**page d'intégration Adjust**](https://app.adapty.io/integrations/adjust). Chaque événement est structuré ainsi :

```json
{
   "event_token": "EVENT_TOKEN_FROM_CONFIG",
   "app_token": "APP_TOKEN_FROM_CONFIG",
   "s2s": 1,
   "environment": "production",
   "created_at_unix": 1709294400,
   "currency": "USD",
   "revenue": 9.99,
   "customer_user_id": "user_12345",
   "external_device_id": "user_12345",
   "ip_address": "192.168.100.1",
   "user_agent": "Mozilla/5.0 (Linux; Android 14; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36",
   "android_id": "875646c2-4a56-4211-8931-168532479006",
   "gps_adid": "875646c2-4a56-4211-8931-168532479006",
   "callback_params": "{\"integration_event_id\":\"550e8400-e29b-41d4-a716-446655440000\",\"customer_user_id\":\"user_12345\",\"vendor_product_id\":\"com.example.app.yearly.premium\",\"transaction_id\":\"GPA.3312-4512-1100-55923\",\"original_transaction_id\":\"GPA.3312-4512-1100-55923\",\"store\":\"play_store\",\"store_country\":\"US\",\"price_usd\":9.99,\"proceeds_usd\":8.49,\"price_local\":9.99,\"proceeds_local\":8.49,\"net_revenue_usd\":8.49,\"net_revenue_local\":8.49,\"tax_amount_usd\":0.0,\"tax_amount_local\":0.0,\"consecutive_payments\":3,\"rate_after_first_year\":false}",
   "partner_params": "{\"integration_event_id\":\"550e8400-e29b-41d4-a716-446655440000\",\"customer_user_id\":\"user_12345\",\"vendor_product_id\":\"com.example.app.yearly.premium\",\"transaction_id\":\"GPA.3312-4512-1100-55923\",\"original_transaction_id\":\"GPA.3312-4512-1100-55923\",\"store\":\"play_store\",\"store_country\":\"US\",\"price_usd\":9.99,\"proceeds_usd\":8.49,\"price_local\":9.99,\"proceeds_local\":8.49,\"net_revenue_usd\":8.49,\"net_revenue_local\":8.49,\"tax_amount_usd\":0.0,\"tax_amount_local\":0.0,\"consecutive_payments\":3,\"rate_after_first_year\":false}"
}
```

Where

| Paramètre            | Type    | Description                                                                                                                                  |
|:---------------------|:--------|:---------------------------------------------------------------------------------------------------------------------------------------------|
| `app_token`          | String  | Le token d'application Adjust issu de vos paramètres d'intégration.                                                                         |
| `event_token`        | String  | Le token d'événement Adjust associé à l'événement Adapty concerné.                                                                          |
| `s2s`                | Integer | Indicateur d'événement serveur à serveur.                                                                                                    |
| `environment`        | String  | `sandbox` ou `production`.                                                                                                                   |
| `created_at_unix`    | Integer | Horodatage de l'événement en secondes.                                                                                                       |
| `currency`           | String  | Code devise (ex. : « USD ») pour la transaction. Inclus uniquement lorsque le revenu dépasse 0,001, car Adjust exige que le revenu et la devise soient envoyés ensemble. |
| `revenue`            | Float   | Montant du revenu de la transaction. Inclus uniquement lorsque la valeur dépasse 0,001. Les événements de remboursement sont envoyés sans propriétés de revenu, car Adjust ne prend pas en charge les valeurs de revenu négatives. |
| `customer_user_id`   | String  | L'identifiant utilisateur client (Customer User ID).                                                                                         |
| `external_device_id` | String  | Identique à `customer_user_id`.                                                                                                              |
| `ip_address`         | String  | Adresse IP de l'utilisateur (IPv4 uniquement).                                                                                               |
| `user_agent`         | String  | Chaîne User Agent de l'appareil.                                                                                                             |
| `adid`               | String  | Identifiant d'appareil Adjust (si connu).                                                                                                    |
| `android_id`         | String  | **Android uniquement**. Google Advertising ID.                                                                                               |
| `gps_adid`           | String  | **Android uniquement**. Google Advertising ID.                                                                                               |
| `idfa`               | String  | **iOS uniquement**. ID for Advertisers.                                                                                                      |
| `idfv`               | String  | **iOS uniquement**. ID for Vendors.                                                                                                          |
| `callback_params`    | String  | Chaîne JSON contenant tous les [champs d'événement](webhook-event-types-and-fields#for-most-event-types) disponibles. Seuls les champs non nuls sont inclus. |
| `partner_params`     | String  | Identique à `callback_params`.                                                                                                               |

## Résolution des problèmes \{#troubleshooting\}

### Écart de revenus \{#revenue-discrepancy\}

Si vous constatez un écart de revenus entre Adapty et Adjust, cela peut être dû au fait que tous vos utilisateurs n'utilisent pas la version de l'application intégrant le SDK Adapty. Pour garantir la cohérence des données, vous pouvez forcer vos utilisateurs à mettre à jour l'application vers une version incluant le SDK Adapty.

### `access_level_updated` apparaît comme échoué dans l'Event Feed \{#access-level-updated-shows-as-failed-in-the-event-feed\}

`access_level_updated` est un **événement réservé aux webhooks**. Adapty ne l'envoie jamais à cette intégration. Mais Adapty enregistre un résultat pour chaque intégration activée, et un événement non pris en charge est affiché comme un échec.