How to connect Apphud
Tracking through Apphud is a paid feature available on Custom and Pro pricing plans. This feature has a free limit of MTR < $10,000
.
Warning
- The tracking option through Apphud may not be available in some regions.
- Apphud only works for Google Play and App Store. For other app stores, such as Huawei AppGallery, information is not collected.
-
Activate the Apphud option in the Organization → Payment and plan section.
- If you are on the Free plan, switch to the Custom or Pro plan and fill out the required details. After this, the option with a free limit will be activated automatically.
- If you are on the Custom or Pro plan, the option with a free limit will be activated automatically.
-
Update the AppMetrica SDK. AppMetrica supports tracking through Apphud starting from Android 7.6.0, iOS 5.9.0 versions.
-
Disable automatic collection of purchases and subscriptions from Google Play, App Store in the AppMetrica SDK.
AndroidiOSKotlinJavaval config = AppMetricaConfig.newConfigBuilder(API_KEY) .withRevenueAutoTrackingEnabled(false) .build() AppMetrica.activate(context, config)
AppMetricaConfig config = AppMetricaConfig.newConfigBuilder(API_KEY) .withRevenueAutoTrackingEnabled(false) .build(); AppMetrica.activate(context, config);
SwiftObjective-Clet configuration = AppMetricaConfiguration(apiKey: "API_KEY")! configuration.revenueAutoTrackingEnabled = false AppMetrica.activate(with: configuration)
AMAAppMetricaConfiguration *configuration = [[AMAAppMetricaConfiguration alloc] initWithAPIKey:@"API_KEY"]; configuration.revenueAutoTrackingEnabled = NO; [AMAAppMetrica activateWithConfiguration:configuration];
-
Disable manual collection of purchases (if it was set up) from Google Play, App Store.
Try to search in the code for calls to
AppMetrica#reportRevenue(Revenue)
and remove them. For details on the implementation of manual collection, read the sections for Android, iOS. -
If you used In-app Revenue event upload in the POST API to collect purchases and subscriptions from Google Play, App Store — disable it.
Note
It is recommended to disable all collections (manual and automatic) to prevent information duplication in reports.
-
Integrate the Apphud module into your app's code.
AndroidiOSThe Apphud module version should match the AppMetrica SDK version.
dependencies { // AppMetrica SDK implementation("io.appmetrica.analytics:7.6.0") // AppMetrica SDK Apphud module // You should use the same versions for AppMetrica and Apphud modules implementation("io.appmetrica.analytics:analytics-apphud:7.6.0") }
CocoapodsSPMpod 'AppMetricaApphudAdapter', '~> 1.0.0'
dependencies: [ .package( url: "https://github.com/appmetrica/appmetrica-sdk-apphud-adapter-ios", from: "1.0.0" ) ]
-
Fill out the information about your application in the Settings → Subscriptions tracking (Apphud) section of the AppMetrica interface.
Android appiOS app-
Google Play package name.
-
Service account JSON.
To track subscription status changes, it's necessary to create and upload a service account json file to AppMetica. For more details on how to create a json file, read the Apphud documentation.
-
Google developer notifications in real-time.
After uploading the JSON file, a string will appear in the interface that needs to be copied to Google Play Console → Your App → Monetization Setup. For more details, read the Google documentation.
-
Google Play Reduced Service Fee.
If you are registered in the Google Play Reduced Service Fee program, specify the dates of effect.
-
Bundle ID.
-
App Store Apple ID.
It can be found in App Store Connect → Apps → App Information.
-
App Store Shared Secret.
How to obtain the App Store Shared Secret
- Open App Store Connect, go to the Apps section, and select your application.
- In the Features section on the left, go to Subscriptions.
- On the page, find the App-Specific Shared Secret, section and click Manage.
- Create and copy the Shared Secret.
- In the AppMetrica interface, navigate to Settings → Subscriptions tracking (Apphud) → iOS application.
- Paste the Shared Secret for the application into the App Store Shared Secret field.
-
Apple Small Business Program.
If you are registered in the Apple Small Business Program, specify the effective dates..
-
App Store Server Notifications.
- App Store Server API (StoreKit 2). Key for in-app purchase.
The private key (In-App Purchase Key) from App Store Connect, which needs to be uploaded to AppMetrica. Read more about how to create an In-App Purchase Key in the Apphud documentation.
- App Store Server API (StoreKit 2). Key for in-app purchase.
-
The URL for App Store Server Notifications version V1 or V2..
After uploading the In-App Purchase Key to the interface, a URL will appear — this is the address for setting up notifications from App Store Server Notifications.
- Copy the URL for App Store Server Notifications.
- Open App Store Connect, go to the Apps section, and select your application.
- In the General section on the left, go to App Information.
- At the bottom of the page that opens, in the App Store Server Notifications section, click the Edit button next to Production Server URL.
- In the Production Server URL field, enter the URL from AppMetrica.
- Below in the form, select Version 2 Notifications and click Save.
{% endcut %}.
-
Issuer ID.
Issuer ID from App Store Connect. It can be found in App Store Connect → Users and Access → Keys → App Store Connect API.
-
How to Disable Apphud
-
In the AppMetrica interface, go to Organization → Payment and plan.
-
On the card of your tariff, click the Settings button.
-
Find the Tracking in-app purchases and Apphud subscriptions option in the list and set it to Disabled on the right.
-
Click the Save button.
-
If you want to disable the Apphud module in the SDK, remove the dependencies in the application code.
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.