Skip to main content
Qonversion sends subscription events to AppMetrica to help you match your users’ behavior with their payment history and inform your product decisions.

1. Setup the SDKs

  1. Make sure you have AppMetrica SDK installed. More about the AppMetrica SDKs read here.
  2. Set Qonversion SDK by following installing the SDK guide.
  3. To attribute sent from Qonversion events to a particular AppMetrica user, set AppMetrica Device ID Hash (AppMetrica.deviceIDHash):
    let completionBlock: (String?, Error?) -> Void = { deviceId, error in
      if let error = error {
        // Handle error here
      } else if let deviceId = deviceId {
        Qonversion.shared().setUserProperty(.appmetricaDeviceId, value: deviceId)
      }
    }
    
    // Specify the dispatch queue on which you want to execute the completion block, main queue as an example
    let queue = DispatchQueue.main // Use the main queue as an example
    
    YMMYandexMetrica.requestAppMetricaDeviceID(withCompletionQueue: queue, completionBlock: completionBlock)
    
  4. (Optionally) To improve attribution quality, set the same user ID to AppMetrica and Qonversion SDKs:
    YMMYandexMetrica.setUserProfileID("yourSideUserID")
    Qonversion.shared().setUserProperty(.appMetricaUserProfileId, value: "yourSideUserID")
    

2) Configure the AppMetrica integration

  1. Navigate to your AppMetrica dashboard, select Settings and collect the following keys:
    1. Application ID. It can be found right below the Application name in the General tab.
    2. Post API key. It can be found in the General settings section as well.
  1. Navigate to the Integrations section of your Qonversion project, select AppMetrica, provide the Application ID and Post API key, and click Save.
  1. You can use the default event names provided by Qonversion or change them as you need.
Read more about tracked events here

Done

Now Qonversion starts sending in-app purchases and subscription data to your AppMetrica account.

Event Payload

In case you need details about data sent to AppMetrica, follow the example below:
{
  "post_api_key": "your_post_api_key",
  "application_id": "your_application_id",
  "revenue_event_type": "example_event_type",
  "event_timestamp": "1707206995",
  "product_id": "example_product_id",
  "app_package_name": "com.example.app",
  "appmetrica_device_id": "8f65b16df378e7a6bece9614e1530fb55",
  "price": "19.99",
  "currency": "USD",
  "transaction_id": "example_transaction_id",
  "order_id": "example_order_id",
  "ios_ifa": "example_advertising_id_for_ios",
  "google_aid": "example_advertising_id_for_android",
  "os_name": "iOS",
  "os_version": "15.0",
  "device_model": "iPhone13,2",
  "device_locale": "en_US",
  "app_version_name": "1.0.0"
}

Amplitude AppsFlyer