​AppMetrica is a free real-time ad tracking and mobile app analytics solution.
Sending built-in revenue in AppMetrica is not yet supported due to limitations of their Server-to-Server API. Currently, we send all revenue values as custom parameters: usd_price
and local_price
​Integrate Apphud SDK.
​Integrate AppMetrica.
​Match User IDs between AppMetrica and Apphud.
Open AppMetrica and go to Settings of your app.
Copy Application ID and Post API Key fields (not API key!).
At Apphud go to "Integrations" section and add AppMetrica:
Enter Post API Key and Application ID values into their corresponding fields:
You can enter your custom event names or disable some:
Enable integration and click Save:
Here is an example of initialising both SDKs with User IDs matching.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {​Apphud.start(apiKey: "YOUR_API_KEY")Apphud.setDelegate(self)if let configuration = YMMYandexMetricaConfiguration.init(apiKey: "AppMetrica-API-Key") {YMMYandexMetrica.activate(with: configuration)YMMYandexMetrica.setUserProfileID(Apphud.userID())}​return true}​// implement ApphudDelegatefunc apphudDidChangeUserID(_ userID: String) {// Match againYMMYandexMetrica.setUserProfileID(Apphud.userID())}
Apphud.start(apiKey: "YOUR_API_KEY")val config: YandexMetricaConfig = YandexMetricaConfig.newConfigBuilder(Constants.Appmetrica_API_KEY).build()YandexMetrica.activate(applicationContext, config)YandexMetrica.setUserProfileID(Apphud.userId())YandexMetrica.enableActivityAutoTracking(this)
Apphud.start(apiKey: "YOUR_API_KEY")YandexMetricaConfig config = YandexMetricaConfig.newConfigBuilder(API_key).build();YandexMetrica.activate(getApplicationContext(), config);YandexMetrica.setUserProfileID(Apphud.userId());YandexMetrica.enableActivityAutoTracking(this);
This is a list of all possible events and their parameters that are being sent to AppMetrica.
Default event name: [Apphud] trial_started
Parameters:
product_id
: String
unit
: String
units_count
: Integer
Default event name: [Apphud] trial_converted
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
Default event name: [Apphud] trial_expired
Parameters:
product_id
: String
reason
: String
Default event name: [Apphud] trial_canceled
Parameters:
product_id
: String
Default event name: [Apphud] subscription_canceled
Parameters:
product_id
: String
Default event name: [Apphud] autorenew_disabled
Parameters:
product_id
: String
Default event name: [Apphud] autorenew_enabled
Parameters:
product_id
: String
Default event name: [Apphud] intro_started
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
offer_type
: String
unit
: String
units_count
: Integer
Default event name: [Apphud] intro_renewed
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
offer_type
: String
unit
: String
units_count
: Integer
Default event name: [Apphud] intro_converted
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
offer_type
: String
Default event name: [Apphud] intro_expired
Parameters:
product_id
: String
reason
: String
offer_type
: String
Default event name: [Apphud] intro_refunded
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
reason
: String
offer_type
: String
Default event name: [Apphud] subscription_started
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
Default event name: [Apphud] subscription_renewed
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
Default event name: [Apphud] subscription_expired
Parameters:
product_id
: String
reason
: String
Default event name: [Apphud] subscription_refunded
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
reason
: String
Default event name: [Apphud] promo_started
Parameters:
product_id
: String
offer_id
: String
local_price
: Float
currency
: String
usd_price
: Float
offer_type
: String
unit
: String
units_count
: Integer
Default event name: [Apphud] promo_renewed
Parameters:
product_id
: String
offer_id
: String
local_price
: Float
currency
: String
usd_price
: Float
offer_type
: String
unit
: String
units_count
: Integer
Default event name: [Apphud] promo_converted
Parameters:
product_id
: String
offer_id
: String
local_price
: Float
currency
: String
usd_price
: Float
offer_type
: String
Default event name: [Apphud] promo_expired
Parameters:
product_id
: String
offer_id
: String
reason
: String
offer_type
: String
Default event name: [Apphud] promo_refunded
Parameters:
product_id
: String
offer_id
: String
local_price
: Float
currency
: String
usd_price
: Float
reason
: String
offer_type
: String
Default event name: [Apphud] non_renewing_purchase
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
Default event name: [Apphud] non_renewing_purchase_refunded
Parameters:
product_id
: String
local_price
: Float
currency
: String
usd_price
: Float
reason
: String
Default event name: [Apphud] billing_issue
Parameters:
product_id
: String
Default event name: [Apphud] billing_issue_resolved
Parameters:
product_id
: String