Amplitude Integration

Airbridge is sending data to Amplitude through the Amplitude Integration (v2) feature. However, devices don't seem to match and we're having a hard time analyzing data.


This is because the device ID used by Airbridge and Amplitude are different.

In order to solve this, retrieve device ID data from Amplitude and insert amplitude_device_id in your user aliases. Once done, Airbridge will prioritize amplitude_device_id over Airbridge's device ID when sending data to Amplitude.
Please make sure that this setup is complete when using Amplitude's JS SDK and React native SDK, as Google and Apple does not allow the collection of ADID.

❗️

The above setting is only applies to Amplitude V2 (HTTP API) integrations

V1 (Amplitude Attribution API) integrations only supports user matching through ADIDs (IDFA/IDFV/GAID). User matching through Amplitude device IDs are not supported.


Fetching Amplitude Device ID


Airbridge User Alias Setup

airbridge.init({
    ...
    user: {
        alias: {
            amplitude_device_id: Amplitude.getInstance().getDeviceId(),
        },
    },
    ...
});
Airbridge.getCurrentUser().setAlias("amplitude_device_id", Amplitude.getInstance().getDeviceId());
[AirBridge.state addUserAliasWithKey:@"amplitude_device_id" value:Amplitude.instance.deviceId];
Airbridge.state.updateUser({
    alias: {
        amplitude_device_id: Amplitude.getInstance().getDeviceId(),
    },
});
Dictionary<string, string> alias = new Dictionary<string, string>();
...
alias.Add("amplitude_device_id", Amplitude.getInstance().getDeviceId());

AirbridgeUser user = new AirbridgeUser();
...
user.SetAlias(alias);
AirbridgeUnity.SetUser(user);

📘

For React Native, Cordova and Flutter, please add the code to the line after the SDK init code in the native environment.
Also, it is good practice to initialize Amplitude's SDK before calling device IDs. This is to ensure that the user is properly matched with Amplitude's Device ID for installation events.

The above code enables you to retrieve amplitude_device_id through Amplitude HTTP API V2 in the following priority.

  1. user.alias.amplitude_device_id
  2. device.deviceUUID (App)
  3. browser.clientID (Web)