To get accurate statistics on pre-installed app activations, do not use the tracking URL from the created tracker. Create a separate tracker for each media source.
Tracker name: A name for the tracker. After being created, the tracker is available in the list with the specified name.
Application: Select the app you want to track.
Media Source: The media source to attribute clicks, installs, and conversions to.
If the media source isn't in the list, you can add it. After being added, the new source will be saved in the list.
Create an object with the necessary tracking parameters:
publicclassMyAppextendsApplication {
@OverridepublicvoidonCreate() {
super.onCreate();
// Creating an instance of a constructor for app pre-installation information.
PreloadInfo.BuilderpreloadInfoBuilder= PreloadInfo.newBuilder(tracking_ID);
// Creating an instance of information about app pre-installation.PreloadInfopreloadInfo= preloadInfoBuilder.build();
Create the extended configuration of the AppMetrica library and enter parameters for tracking pre-installed apps. Then perform library initialization in the app, using the extended configuration.
publicclassMyAppextendsApplication {
@OverridepublicvoidonCreate() {
super.onCreate();
// Creating an extended library configuration.
AppMetricaConfig.BuilderconfigBuilder= AppMetricaConfig.newConfigBuilder(API_key);
// Setting necessary parameters (for example, enabling logging).
configBuilder.setLogEnabled();
// ...// Setting tracking parameters for pre-installed apps.
configBuilder.setPreloadInfo(preloadInfo);
// Creating an extended configuration instance.AppMetricaConfigextendedConfig= configBuilder.build();
// Initializing the AppMetrica SDK.
AppMetrica.activate(getApplicationContext(), extendedConfig);
}
}
Initialize the AppMetrica SDK this way for all the app processes.
Use the method of the AppMetrica class to enable tracking user activity:
Create the extended configuration of the AppMetrica library and set information in it for tracking pre-installed apps. Then perform library initialization in the app, using the extended configuration.
// Creating an extended library configuration.
YMMYandexMetricaConfiguration *configuration = [[YMMYandexMetricaConfiguration alloc] initWithApiKey:@"API_key"];
// Setting up the configuration.
configuration.preloadInfo = preloadInfo;
// ...// Initializing the AppMetrica SDK.
[YMMYandexMetrica activateWithConfiguration:configuration];
Swift
Create an object with the necessary tracking parameters:
let preloadInfo =YMMYandexMetricaPreloadInfo.init(trackingIdentifier: "tracking_ID")
Create the extended configuration of the AppMetrica library and set information in it for tracking pre-installed apps. Then perform library initialization in the app, using the extended configuration.
// Creating an extended library configuration.let configuration =YMMYandexMetricaConfiguration.init(apiKey: "API key")
// Setting up the configuration
configuration?.preloadInfo = preloadInfo
// ...// Initializing the AppMetrica SDK.YMMYandexMetrica.activate(with: configuration!)
Parameter
Description
API_key
A unique app ID issued in the AppMetrica web interface at app registration.
tracking_ID
A numeric tracker ID that is shown in the AppMetrica interface when creating a tracker.
In the AppMetrica interface, go to Tracking → Create tracker.
Under Campaign details, fill in the following fields:
Pre-installing: Enable this option to track pre-installs.
PAI: Enable this option if you are creating a tracker for PAI pre-installs. Learn more about PAI pre-installs.
Tracker name: A name for the tracker. After being created, the tracker is available in the list with the specified name.
Application: Select the app you want to track.
Media Source: The media source to attribute clicks, installs, and conversions to.
If the media source isn't in the list, you can add it. After being added, the new source will be saved in the list.
In the section below, fill in the utm_campaign field. This parameter is used to count pre-installs of the PAI type. Enter the value obtained from the manufacturer or generate a parameter value and pass it to the manufacturer.
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.