AppMetrica
AppMetrica is a no-cost tool that helps you track advertisements and analyze how your mobile app is doing. It works in real time, so you see things right away.
How to set up AppMetrica integration
AppMetrica integration configuration is comprised of two major steps:
- Enable the integration in the Adapty Dashboard.
- Configure the integration in your app’s code.
Dashboard Configuration
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.
Events and tags
Below the credentials, there are three groups of events you can send to AppMetrics from Adapty. Simply turn on the ones you need. Check the full list of the events offered by Adapty here.

We recommend using the default event names provided by Adapty. But you can change the event names based on your needs.
SDK configuration
Use the setIntegrationIdentifier()
method to set the appmetrica_device_id
parameter. This is required to enable the integration.
If your app has user registration, you can also pass appmetrica_profile_id
.
- iOS (Swift)
- Android (Kotlin)
- Flutter (Dart)
- Unity (C#)
- React Native (TS)
Setting appmetrica_device_id
val startupParamsCallback = object: StartupParamsCallback {
override fun onReceive(result: StartupParamsCallback.Result?) {
val deviceIdHash = result?.deviceIdHash ?: return
Adapty.setIntegrationIdentifier("appmetrica_device_id", deviceIdHash) { error ->
if (error != null) {
// handle the error
}
}
}
override fun onRequestError(
reason: StartupParamsCallback.Reason,
result: StartupParamsCallback.Result?
) {
//handle the error
}
}
AppMetrica.requestStartupParams(context, startupParamsCallback, listOf(StartupParamsCallback.APPMETRICA_DEVICE_ID_HASH))
Setting appmetrica_profile_id
do {
try await Adapty.setIntegrationIdentifier(
key: "appmetrica_profile_id",
value: "YOUR_APPMETRICA_PROFILE_ID"
)
} catch {
// handle the error
}
Setting appmetrica_device_id
val startupParamsCallback = object: StartupParamsCallback {
override fun onReceive(result: StartupParamsCallback.Result?) {
val deviceIdHash = result?.deviceIdHash ?: return
Adapty.setIntegrationIdentifier("appmetrica_device_id", deviceIdHash) { error ->
if (error != null) {
// handle the error
}
}
}
override fun onRequestError(
reason: StartupParamsCallback.Reason,
result: StartupParamsCallback.Result?
) {
//handle the error
}
}
AppMetrica.requestStartupParams(context, startupParamsCallback, listOf(StartupParamsCallback.APPMETRICA_DEVICE_ID_HASH))
Setting appmetrica_profile_id
val startupParamsCallback = object: StartupParamsCallback {
override fun onReceive(result: StartupParamsCallback.Result?) {
val deviceIdHash = result?.deviceIdHash ?: return
Adapty.setIntegrationIdentifier("appmetrica_device_id", deviceIdHash) { error ->
if (error != null) {
// handle the error
}
}
Adapty.setIntegrationIdentifier("appmetrica_profile_id", "YOUR_ADAPTY_CUSTOMER_USER_ID") { error ->
if (error != null) {
// handle the error
}
}
}
override fun onRequestError(
reason: StartupParamsCallback.Reason,
result: StartupParamsCallback.Result?
) {
//handle the error
}
}
AppMetrica.requestStartupParams(context, startupParamsCallback, listOf(StartupParamsCallback.APPMETRICA_DEVICE_ID_HASH))
Setting appmetrica_device_id
import 'package:appmetrica_plugin/appmetrica_plugin.dart';
final startupParams = await AppMetrica.requestStartupParams([AppMetricaStartupParams.deviceIdHashKey]);
final deviceIdHash = startupParams.result?.deviceIdHash;
if (deviceIdHash != null) {
try {
await Adapty().setIntegrationIdentifier(
key: "appmetrica_device_id",
value: deviceIdHash,
);
} on AdaptyError catch (adaptyError) {
// handle the error
} catch (e) {
// handle the error
}
}
Setting appmetrica_profile_id
import 'package:appmetrica_plugin/appmetrica_plugin.dart';
try {
await Adapty().setIntegrationIdentifier(
key: "appmetrica_profile_id",
value: "YOUR_APPMETRICA_PROFILE_ID",
);
} on AdaptyError catch (adaptyError) {
// handle the error
} catch (e) {
// handle the error
}
Setting appmetrica_device_id
using AdaptySDK;
using Io.AppMetrica;
AppMetrica.RequestStartupParams(
(result, errorReason) => {
string deviceIdHash = result.DeviceIdHash;
if (deviceIdHash != null) {
Adapty.SetIntegrationIdentifier(
"appmetrica_device_id",
deviceIdHash,
(error) => {
// handle the error
});
}
},
new List<string>() { StartupParamsKey.AppMetricaDeviceIDHash }
);
Setting appmetrica_profile_id
Adapty.SetIntegrationIdentifier(
"appmetrica_profile_id",
"YOUR_APPMETRICA_PROFILE_ID",
(error) => {
// handle the error
});
Setting appmetrica_device_id
import { adapty } from 'react-native-adapty';
import AppMetrica, { DEVICE_ID_HASH_KEY, StartupParams, StartupParamsReason } from '@appmetrica/react-native-analytics';
// ...
const startupParamsCallback = async (
params?: StartupParams,
reason?: StartupParamsReason
) => {
const deviceIdHash = params?.deviceIdHash
if (deviceIdHash) {
try {
await adapty.setIntegrationIdentifier("appmetrica_device_id", deviceIdHash);
} catch (error) {
// handle `AdaptyError`
}
}
}
AppMetrica.requestStartupParams(startupParamsCallback, [DEVICE_ID_HASH_KEY])
Setting appmetrica_profile_id
import { adapty } from 'react-native-adapty';
try {
await adapty.setIntegrationIdentifier("appmetrica_profile_id", 'YOUR_ADAPTY_CUSTOMER_USER_ID');
} catch (error) {
// handle `AdaptyError`
}