Creating a tracker for pre-installs

Pre-installs are apps installed on a device without direct user involvement. AppMetrica supports a number of methods to track pre-installed apps.

Creating a tracker for apps pre-installed by the device manufacturer

Alert

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.

Step 1. Creating a tracker in the AppMetrica interface

  1. In the AppMetrica interface, go to TrackingCreate tracker.

  2. Under Campaign details, fill in the following fields:

    • Pre-installing: Enable this option to track pre-installs.
    • PAI: Keep this option disabled. Learn more about creating a tracker for 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.

Step 2. Obtaining tracking_ID

  1. Find the created tracker in the list and open it. Use the ID you see on the page as tracking_ID when setting up the AppMetrica SDK.

Step 3. Configuring the AppMetrica SDK

Tracking pre-installed apps is available when using the extended configuration of the AppMetrica library. To set parameters for tracking pre-installed apps, follow these steps:

  1. Create an object with the necessary tracking parameters:

    public class MyApp extends Application {
          @Override
          public void onCreate() {
              super.onCreate();
              // Creating an instance of a constructor for app pre-installation information.
              PreloadInfo.Builder preloadInfoBuilder = PreloadInfo.newBuilder(tracking_ID);
              // Creating an instance of information about app pre-installation.
              PreloadInfo preloadInfo = preloadInfoBuilder.build();
    
  2. 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.

    public class MyApp extends Application {
          @Override
          public void onCreate() {
              super.onCreate();
              // Creating an extended library configuration.
              AppMetricaConfig.Builder configBuilder = 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.
              AppMetricaConfig extendedConfig = configBuilder.build();
              // Initializing the AppMetrica SDK.
              AppMetrica.activate(getApplicationContext(), extendedConfig);
          }
    }
    

    Initialize the AppMetrica SDK this way for all the app processes.

  3. Use the method of the AppMetrica class to enable tracking user activity:

    ...
    AppMetrica.enableActivityAutoTracking(this);
    

Tracking pre-installed apps is available when using the extended configuration of the AppMetrica library. To set information for tracking pre-installed apps, follow these steps:

  • Objective-C

    1. Create an object with the necessary tracking parameters:

      YMMYandexMetricaPreloadInfo *preloadInfo = [[YMMYandexMetricaPreloadInfo alloc] initWithTrackingIdentifier:@"tracking_ID"];
      
    2. 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

    1. Create an object with the necessary tracking parameters:

      let preloadInfo = YMMYandexMetricaPreloadInfo.init(trackingIdentifier: "tracking_ID")
      
    2. 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.

Creating a tracker for PAI pre-installs

  1. In the AppMetrica interface, go to TrackingCreate tracker.

  2. 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.
  3. 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.

See also

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.

Contact support