Creating a tracker for pre-installs

Pre-installs are apps installed on a device without direct user involvement. AppMetrica offers two methods for tracking these installs:

Trackers created for pre-installed apps are only available as part of pre-install campaigns. They can't be used in regular campaigns or re-used in other OEM/PAI pre-installs.

Step 1. Choosing a technology

Determine which scenario applies to your campaign:

  • OEM: The app is pre-installed as part of the device's firmware or build.
  • PAI: The app is pre-installed via Play Auto Install.

Step 2. Creating a tracker

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

  2. Enter the name of the tracker.

  3. Select a media source to attribute clicks, installs, and conversions to.

    If the media source isn't in the list, add a new source.

    Once the tracker has been created, you can't change the media source in the settings.

  4. Specify Pre-installing as the tracker type.

  5. Enable or disable the PAI (Play Auto Install) option based on your chosen technology.

Step 3. (Optional) Setting up postbacks

Trackers for pre-installs support postbacks that automatically send data about successful conversions to media sources. You can add up to five postbacks to one tracker. Use media source templates or configure custom URLs with macros.

Step 4. Obtaining UTM tag and tracking ID

  • If you have the PAI option enabled, click Generate to obtain a unique utm_campaign tag.
  • If you're using OEM pre-installing and have the PAI option disabled, a tracking_ID appears on the right.

Step 5. What's next?

If you're using PAI, send the UTM tag to your media source or manufacturer so they can use it on Google Play.

If you're using OEM pre-installing, configure 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:

  1. Create an object with the necessary tracking parameters:

    AMAAppMetricaPreloadInfo *preloadInfo = [[AMAAppMetricaPreloadInfo 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.
    AMAAppMetricaConfiguration *configuration = [[AMAAppMetricaConfiguration alloc] initWithApiKey:@"API_key"];
    // Setting up the configuration.
    configuration.preloadInfo = preloadInfo;
    // ...
    // Initializing the AppMetrica SDK.
    [AMAAppMetrica activateWithConfiguration:configuration];
    
  1. Create an object with the necessary tracking parameters:

    let preloadInfo = AppMetricaPreloadInfo.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 = AppMetricaConfiguration.init(apiKey: "API key")
    // Setting up the configuration
    configuration?.preloadInfo = preloadInfo
    // ...
    // Initializing the AppMetrica SDK.
    AppMetrica.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.

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