> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.onesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adjust

> Correlate Adjust attribution and event callbacks with OneSignal users by passing the OneSignal External ID as an Adjust partner parameter.

Adjust is a mobile measurement partner (MMP) that attributes installs, sessions, and in-app events across your marketing channels. This integration passes the OneSignal [External ID](./users#external-id) to Adjust as the `onesignal_customer_id` partner parameter so Adjust can correlate the events it forwards to OneSignal with the correct user.

## Requirements

* OneSignal mobile SDK version 5.5.0 or higher.
* An [External ID](./users#external-id) set on the OneSignal User. Data syncs between Adjust and OneSignal are keyed by this ID, so the integration cannot correlate events for anonymous users.

## Setup

Two things must be in place for Adjust callbacks to reach the correct OneSignal User: Adjust must be configured to forward events to OneSignal, and your app must attach the External ID as a partner parameter on every session.

### 1. Enable data sharing in the Adjust dashboard

In your Adjust dashboard, enable the OneSignal integration and choose which events to forward. Adjust sends `install` and `session` activity by default; you can additionally map custom events and in-app revenue. Follow Adjust's [Set up OneSignal](https://help.adjust.com/en/integrated-partners/onesignal) guide for the exact steps.

<Note>
  Without this dashboard step, Adjust never sends callbacks to OneSignal, so the SDK code in the next step has nothing to attach the `onesignal_customer_id` parameter to.
</Note>

### 2. Pass the External ID as a partner parameter

When a user signs in to your app, call OneSignal's [`login` method](./mobile-sdk-reference#login-external-id) to set the External ID, then call Adjust's `addGlobalPartnerParameter` method with the key `onesignal_customer_id` and the same External ID as the value. Adjust forwards that key–value pair on every subsequent callback, and OneSignal uses `onesignal_customer_id` to match the callback to the right user.

<Warning>
  Every non-iOS Adjust SDK uses `(key, value)` argument order. iOS Swift and Objective-C use `(value, forKey: key)`. Passing the External ID as the key by mistake breaks the integration silently. Adjust will forward a parameter named after your user ID string, and OneSignal will never see `onesignal_customer_id`.
</Warning>

<CodeGroup>
  ```kotlin Kotlin theme={null}
  val externalId = "your_user_id"
  OneSignal.login(externalId)
  Adjust.addGlobalPartnerParameter("onesignal_customer_id", externalId)
  ```

  ```java Java theme={null}
  String externalId = "your_user_id";
  OneSignal.login(externalId);
  Adjust.addGlobalPartnerParameter("onesignal_customer_id", externalId);
  ```

  ```swift Swift theme={null}
  let externalId = "your_user_id"
  OneSignal.login(externalId)
  Adjust.addGlobalPartnerParameter(externalId, forKey: "onesignal_customer_id")
  ```

  ```objc Objective-C theme={null}
  NSString *externalId = @"your_user_id";
  [OneSignal login:externalId];
  [Adjust addGlobalPartnerParameter:externalId forKey:@"onesignal_customer_id"];
  ```

  ```csharp C# theme={null}
  string externalId = "your_user_id";
  OneSignal.Login(externalId);
  Adjust.AddGlobalPartnerParameter("onesignal_customer_id", externalId);
  ```

  ```javascript React Native theme={null}
  const externalId = "your_user_id";
  OneSignal.login(externalId);
  Adjust.addGlobalPartnerParameter("onesignal_customer_id", externalId);
  ```

  ```dart Flutter theme={null}
  final externalId = "your_user_id";
  OneSignal.login(externalId);
  Adjust.addGlobalPartnerParameter("onesignal_customer_id", externalId);
  ```

  ```javascript Cordova/Ionic theme={null}
  const externalId = "your_user_id";

  // Ionic
  OneSignal.login(externalId);

  // Cordova
  window.plugins.OneSignal.login(externalId);

  Adjust.addGlobalPartnerParameter("onesignal_customer_id", externalId);
  ```
</CodeGroup>

For the underlying Adjust SDK reference, see Adjust's Global Partner Parameters docs for [Android](https://dev.adjust.com/en/sdk/android/features/session-parameters#add-global-partner-parameters) and [iOS](https://dev.adjust.com/en/sdk/ios/features/session-parameters/#global-partner-parameters).

## Deep linking

Adjust uses [iOS Universal Links and Android App Links](https://www.adjust.com/glossary/deep-linking/) to route push taps to specific screens in your app. When sending OneSignal notifications that should open an Adjust deep link, set the notification's Launch URL to the Adjust deep link, as described in Adjust's [Push Notifications](https://help.adjust.com/en/article/push-notifications) guide. See OneSignal's [Deep linking guide](./deep-linking) for how Launch URLs are handled across platforms.

## FAQ

### What is the `onesignal_customer_id` partner parameter?

`onesignal_customer_id` is the exact key OneSignal reads on Adjust callbacks to correlate an Adjust event with a OneSignal User. Set its value to the same External ID you pass to `OneSignal.login`. Any other key name will not be recognized.

### When should I call `Adjust.addGlobalPartnerParameter`?

Call it every time you call `OneSignal.login`: on app start once the user's ID is known, and again on account switches. This mirrors OneSignal's [login guidance](./mobile-sdk-reference#login-external-id) and keeps the Adjust partner parameter in sync with the current OneSignal User.

### What happens when a user logs out or switches accounts?

Adjust keeps global partner parameters in memory until you change or remove them. On logout, call `Adjust.removeGlobalPartnerParameter("onesignal_customer_id")` (or overwrite the value on the next login). Otherwise, Adjust will keep attributing subsequent events to the previous user's External ID.

### What data does Adjust send to OneSignal?

By default Adjust forwards `install` and `session` activity, plus any events you map in the Adjust dashboard. The full list of forwarded fields is documented in [Adjust's OneSignal integration article](https://help.adjust.com/en/integrated-partners/onesignal).

***

## Related pages

<Columns cols={2}>
  <Card title="External ID" icon="id-card" href="./users#external-id">
    Set a stable identifier on your OneSignal User so partner integrations can correlate data.
  </Card>

  <Card title="Mobile SDK: login" icon="mobile" href="./mobile-sdk-reference#login-external-id">
    Reference for `OneSignal.login`, including when to call it and retry behavior.
  </Card>

  <Card title="Deep linking" icon="link" href="./deep-linking">
    Configure Universal Links, App Links, and URI schemes for push, in-app, email, and SMS.
  </Card>

  <Card title="Keys & IDs" icon="key" href="./keys-and-ids">
    Find your OneSignal App ID and REST API Key for the Adjust dashboard setup.
  </Card>
</Columns>
