AppMetrica

Learn how to set up integration with AppMetrica

To integrate AppMetrica go to Integrations > AppMetrica and set credentials.

Open AppMetrica apps list. Choose the app you want to send events to and go to Settings. Copy Application ID and Post API key and use them to set up the integration in Adapty.

AppMetrica syncs events every 4 hours, so it may take some time for events to appear in the dashboard. AppMetrica doesn't support sending events revenue, but we send it as regular property.

SDK configuration

Use Adapty.updateProfile() method to set appmetricaProfileId or appmetricaDeviceId. If not set, Adapty uses your user ID (customerUserId). Make sure that the user id you use to send data to AppMetrica from your app is the same one you send to Adapty. These links should help to set up a user id for AppMetrica in your app.

import YandexMobileMetrica

YMMYandexMetrica.requestAppMetricaDeviceID(withCompletionQueue: .main) { deviceId, error in
    guard let deviceId = deviceId else { return }
            
    let builder = AdaptyProfileParameters.Builder()
        .with(appmetricaDeviceId: deviceId)
        .with(appmetricaProfileId: "YOUR_ADAPTY_CUSTOMER_USER_ID")

        Adapty.updateProfile(params: builder.build())
}
val params = AdaptyProfileParameters.Builder()
    .withAppmetricaDeviceId(appmetricaDeviceId)
    .withAppmetricaProfileId(appmetricaProfileId)
    .build()
Adapty.updateProfile(params) { error ->
    if (error != null) {
        // handle the error
    }
}
import 'package:appmetrica_plugin/appmetrica_plugin.dart';

final builder = AdaptyProfileParametersBuilder()
    ..setAppmetricaDeviceId(await AppMetrica.requestAppMetricaDeviceID())
    ..setAppmetricaProfileId("YOUR_ADAPTY_CUSTOMER_USER_ID")

try {
    await adapty.updateProfile(builder.build());
} on AdaptyError catch (adaptyError) {
    // handle error
} catch (e) {}
import { adapty } from 'react-native-adapty';

// ...
try {
  await adapty.updateProfile({
    appmetricaProfileId: appmetricaProfileId,
    appmetricaDeviceId: appmetricaDeviceId,
  });
} catch (error) {
  // handle `AdaptyError`
}
AppMetrica.Instance.RequestAppMetricaDeviceID((deviceId, error) => {
    if (error != null) {
        // handle error
        return;
    }

    var builder = new Adapty.ProfileParameters.Builder();

    builder.SetAppmetricaProfileId("YOUR_ADAPTY_CUSTOMER_USER_ID");
    builder.SetAppmetricaDeviceId(deviceId);

    Adapty.UpdateProfile(builder.Build(), (error) => {
        // handle error
    });
});