adjust-icon

Send preinstalled app activity

You can use the Adjust SDK to record activity from apps that came preinstalled on a user's device. This enables you to send information from users who didn't download your app from a campaign.

Control whether preinstall measurement is enabled by calling the setPreinstallTrackingEnabled method of your AdjustConfig2dx instance with a bool argument.

#include "Adjust/Adjust2dx.h"
std::string appToken = "{YOUR_APP_TOKEN}";
std::string environment = AdjustEnvironmentSandbox2dx;
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setPreinstallTrackingEnabled(true);
Adjust2dx::initSdk(adjustConfig);

The Adjust SDK provides 5 methods for measuring preinstalled apps:

System properties

Original Equipment Manufacturer (OEM) partners can leverage Android system properties to attribute preinstalled apps. The OEM (Original Equipment Manufacturer) writes attribution information to a file and adds its path to the system properties. The Adjust SDK reads this file on initialization to attribute the install.

Content provider

The content provider method makes use of a read-only content provider. The SDK uses a content resolver to gather preinstall information from the request.

To set the permissions, add the following to your AndroidManifest.xml file.

<uses-permission android:name="com.adjust.preinstall.READ_PERMISSION"/>

To access a list of preinstalled apps on the device, add the following to your AndroidManifest.xml file.

<queries>
<intent>
<action android:name="com.attribution.REFERRAL_PROVIDER"/>
</intent>
</queries>

System installer receiver

The system installer method uses a broadcast receiver. The system installer broadcasts preinstall information. The Adjust SDK reads this information using the system preinstall referrer receiver.

To set up the receiver, add the following to your AndroidManifest.xml file.

<receiver android:name="com.adjust.sdk.AdjustPreinstallReferrerReceiver">
<intent-filter>
<action android:name="com.attribution.SYSTEM_INSTALLER_REFERRER" />
</intent-filter>
</receiver>

World-readable directory

Save attribution information for your preinstalled app in a world-readable directory. The SDK reads the information from this file at install to attribute the user. The system encryption protocol protects app data.

To give the Adjust SDK access to this information, call the setPreinstallFilePath method of your AdjustConfig2dx instance with the path of your file.

#include "Adjust/Adjust2dx.h"
std::string appToken = "{YOUR_APP_TOKEN}";
std::string environment = AdjustEnvironmentSandbox2dx;
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
adjustConfig.setPreinstallFilePath("../EngagementFile.xml");
Adjust2dx::initSdk(adjustConfig);

Configuring a default link token enables you to attribute all preinstalls to a predefined Adjust link. Adjust records all information against this token until the attribution source changes. To set this up:

  1. Create a new campaign link in Campaign Lab.

    https://app.adjust.com/{YOUR_LINK_TOKEN}
  2. Copy this token and assign it to the DefaultTracker property of your AdjustConfig2dx instance in your app delegate file.

    #include "Adjust/Adjust2dx.h"
    std::string appToken = "{YOUR_APP_TOKEN}";
    std::string environment = AdjustEnvironmentSandbox2dx;
    AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);
    adjustConfig.setDefaultTracker("{YOUR_LINK_TOKEN}");
    Adjust2dx::initSdk(adjustConfig);
  3. Build and run your app. If you have logging enabled, you should see a message in your log

    Default tracker: '{YOUR_LINK_TOKEN}'.