">
The Adjust SDK requires the following permissions. Add them to your plugin.xml
file if they’re not already present:
<config-file target="AndroidManifest.xml" parent="/manifest/application"> <receiver android:name="com.adjust.sdk.AdjustReferrerReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver></config-file>
The Adjust SDK includes the com.google.android.gms.AD_ID
permission by default in version 4.32.0 and above. You can remove it by adding a remove
directive if need to make your app COPPA-compliant or if you don’t target the Google Play Store.
<config-file target="AndroidManifest.xml" parent="/manifest"> <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" /></config>
If you are using Proguard, add the following rules to your Proguard file:
-keep public class com.adjust.sdk.** { *; }-keep class com.google.android.gms.common.ConnectionResult { int SUCCESS;}-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);}-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { java.lang.String getId(); boolean isLimitAdTrackingEnabled();}-keep public class com.android.installreferrer.** { *; }
If you aren’t publishing your app in the Google Play Store, add the following rule to your Proguard file.
-keep public class com.adjust.sdk.** { *; }
The install referrer is a unique identifier which you can use to attribute an app install to a source. The Adjust SDK requires this information to perform attribution. There are three methods you can use to gather this information:
To support the Google Play Referrer API:
Configure the Google Maven repository in your build.gradle
file:
allprojects { repositories { jcenter() maven { url "https://maven.google.com" } }}
Add the following in your plugin.xml
file:
<framework src="com.android.installreferrer:installreferrer:2.2" />
If you’re using Proguard, make sure you have added the following setting in your Proguard file:
-keep public class com.android.installreferrer.** { *; }
As of v4.21.1, the Adjust SDK supports install tracking on Huawei devices using Huawei App Gallery v10.4 and later. You don’t need to make any changes to start using the Huawei Referrer API.
The Adjust SDK supports the Meta Install Referrerin v4.37.1 and above. To enable this feature:
Find your Meta app ID in your App Dasard. See Meta’s App Dasard documentationfor more information.
Assign your App ID to the fbAppId
property on your AdjustConfig
instance.
var adjustConfig = new AdjustConfig( "{YourAppToken}", AdjustConfig.EnvironmentSandbox,);adjustConfig.fbAppId = "<FB_APP_ID_STRING>";Adjust.create(adjustConfig);
The Adjust SDK is able to get extra information when you include certain iOS frameworks in your app. These frameworks enable certain SDK features, but they’re not mandatory for the SDK to work normally.
Framework | Description | Notes |
---|---|---|
AdSupport.framework | Enables access to the device’s IDFA. Also enables access to LAT information on devices running iOS 14 or earlier | Don’t add this framework if your app targets the “Kids” category |
AdServices.framework | Handles Apple Search Ads attribution | |
StoreKit.framework | Enables access to the SKAdNetwork framework | Required to allow the Adjust SDK to handle communication with SKAdNetwork on devices running iOS 14 or later |
AppTrackingTransparency.framework | Required to allow the Adjust SDK to wrap user tracking consent dialog and access consent responses on devices running iOS 14 or later | Don’t add this framework if your app targets the “Kids” category |
Add the desired frameworks to your plugin.xml
file to enable them.
<framework src="AdSupport.framework" weak="true" /><framework src="StoreKit.framework" weak="true" /><framework src="AdServices.framework" weak="true" /><framework src="AppTrackingTransparency.framework" weak="true" />
Make sure you initialize the Adjust SDK as soon as possible in your Cordova app. To do this, instantiate an AdjustConfig
object with the following information:
appToken
: Your Adjust app token.environment
: The environment your app is running in. Set this to AdjustConfig.ENVIRONMENT_SANDBOX
to test your app locally.var adjustConfig = new AdjustConfig( "{YourAppToken}", AdjustConfig.EnvironmentSandbox,);Adjust.create(adjustConfig);
Well done! You should now be able to build and run your Cordova app. Enable logging to check for any issues. Check your logs to see the Install tracked
message.
You are ready to start attributing your users with the Adjust SDK.
You can use the Adjust SDK signature to sign all communications sent by the Adjust SDK. This enables Adjust’s servers to detect and reject any install activity that’s not legitimate.
To get started with the Adjust SDK signature, contact your Technical Account Manager or [email protected].
The Adjust SDK provides tools for testing and troubleshooting issues with your integration. To test your setup:
To test that the Adjust SDK can receive a device’s Google Advertising ID, set the log level to verbose and the environment to Sandbox. Start your app and measure a session or an event. The SDK logs the gps_adid
(Google Play Services Advertiser ID) parameter if it has read the advertising ID.
If you’re experiencing issues retrieving the Google Advertising ID, open an issue in the SDK repositoryor contact [email protected].