Skip to main content

AppMetrica

AppMetrica is a free analytics tool that helps you track user behavior and analyze your mobile app's performance in real time. By integrating AppMetrica with Adapty, you can gain deeper insights into your subscription metrics and user engagement.

How to set up AppMetrica integration

Setting up the AppMetrica integration involves two main steps:

  1. Configure the integration in the Adapty Dashboard
  2. Set up the integration in your app's code

Dashboard configuration

To set up the AppMetrica integration:

  1. Open the AppMetrica apps list
  2. Select the app you want to track
  3. Go to Settings and copy the Application ID and Post API key
  1. Go to Integrations > AppMetrica in the Adapty Dashboard
  2. Paste your AppMetrica credentials.

Events and tags

Adapty allows you to send three groups of events to AppMetrica. You can enable the events you need to track your app's performance. For a complete list of available events, see our events documentation.

note

AppMetrica syncs events every 4 hours, so there may be a delay before events appear in your dashboard.

tip

We recommend using Adapty's default event names for consistency, but you can customize them to match your existing analytics setup.

Revenue settings

By default, Adapty sends revenue data as properties in events, which appear in AppMetrica's Events report. You can configure how this revenue data is calculated and displayed:

  • Revenue calculation: Choose how revenue values are calculated to match your financial reporting needs:

    • Gross revenue: Shows the total revenue before any deductions, useful for tracking the full amount customers pay
    • Proceeds after store commission: Displays revenue after App Store/Play Store fees are deducted, helping you track actual earnings
    • Proceeds after store commission and taxes: Shows net revenue after both store fees and applicable taxes, providing the most accurate picture of your earnings
  • Report user's currency: When enabled, sales are reported in the user's local currency, making it easier to analyze revenue by region. When disabled, all sales are converted to USD for consistent reporting across different markets.

  • Send revenue events: Enable this option to make revenue data appear not only in the Events report but also in AppMetrica's In-app and ad revenue report. Make sure you’re not sending revenue from anywhere else, as this may result in duplication.

  • Exclude historical events: When enabled, Adapty won't send events that occurred before the user installed the app with Adapty SDK. This helps avoid data duplication if you were already sending events to analytics before integrating Adapty.

SDK configuration

To enable the AppMetrica integration in your app, you need to set up two identifiers:

  1. appmetrica_device_id: Required for basic integration
  2. appmetrica_profile_id: Optional, but recommended if your app has user registration

Use the setIntegrationIdentifier() method to set these values. Here's how to implement it for each platform:

Setting appmetrica_device_id

AppMetrica.requestStartupIdentifiers(on: nil) { ids, error in
if let error {
// handle AppMetrica error
return
}

guard let deviceIDHash = ids?[.deviceIDHashKey] as? String else {
// handle AppMetrica error
return
}

Task {
do {
try await Adapty.setIntegrationIdentifier(
key: "appmetrica_device_id",
value: deviceIDHash
)
} catch {
// handle the error
}
}
}

Setting appmetrica_profile_id

do {
try await Adapty.setIntegrationIdentifier(
key: "appmetrica_profile_id",
value: "YOUR_APPMETRICA_PROFILE_ID"
)
} catch {
// handle the error
}