Before you begin
Here’s what you need to do before updating to SDK v5:
- SDK v5 supports SDK signature verification natively. If you currently use the SDK signature library, you need to uninstall this first.
- The minimum supported API versions for SDK v5 have been updated. If your app targets a lower version, you need to update it first.
- iOS: 12.0
- Android: 21
- The SDK namespace has been renamed from
com.adjust.sdk
toAdjustSdk
.
Install the SDK
Before you install SDK v5, you first need to remove all SDK v4 assets and code from your project.
If you prefer to append changes to your existing project, follow these steps to remove all Adjust SDK v4 assets:
- Delete the existing
Adjust
installation in yourAssets
directory. - Delete all references to
Adjust
from your Xcode project.- Delete the
Adjust
directory under the Libraries section of your project. - Open the General tab and delete the
Adjust.a
library under Frameworks, Libraries, and Embedded Content. - Optional: SDK v4 adds an
-ObjC
flag under your app target’s Other Linker Flags settings. Only if this was added automatically by the SDK, remove this flag.
- Delete the
- Delete all references to
Adjust
in your Android Studio project.- Locate and delete the
adjust-android.jar
library in your project’slibs
directory.
- Locate and delete the
Once you’ve removed all SDK v4 assets from your project, you can install SDK v5. To do this, either:
- Download the Adjust
unitypackage
from the GitHub releases page and import it into your project. - Install the package using the Unity Package Manager:
- Select the Package Manager window in the Unity editor.
- Select Add package from git URL.
- Enter the following URL:
https://github.com/adjust/unity_sdk.git?path=Assets/Adjust
.
Install the iOS and Android SDKs
SDK v5 no longer uses the iOS and Android SDKs as binary dependencies. To install the underlying iOS and Android SDKs, you need to use the External Dependency Manager for Unity (EDM4U) to install the packages from CocoaPods and Maven.
Update the initialization method
In SDK v4, the SDK is initialized by configuring an AdjustConfig
object and passing it to the Adjust.start()
method.
In SDK v5, this method has been renamed to Adjust.InitSdk()
.
Set up the Signature library
SDK v5 includes the SDK signature library. You can test this by following the testing steps in the Signature library integration guide.
Signature protection is inactive by default. To enable it, you need to:
- Enforce signature validation.
- Provide your app’s SHA-1 fingerprints prior to testing.
Changed APIs
The following APIs have been changed in SDK v5.
Set log level
In SDK v4, you can set your logging level by passing an AdjustLogLevel
constant to the AdjustConfig.setLogLevel()
method.
In SDK v5, you need to assign an AdjustLogLevel
constant to the LogLevel
property of your AdjustConfig
instance.
Disable and enable the SDK
In SDK v4, you can enable and disable the SDK by calling Adjust.setEnabled()
with a bool
value.
- Call
Adjust.setEnabled(false)
to disable the SDK. - Call
Adjust.setEnabled(true)
to enable the SDK
In SDK v5, this feature is split into separate commands for clarity.
- Call
Adjust.Disable()
to disable the SDK. - Call
Adjust.Enable()
to enable the SDK.
Send information in background
In SDK v4, you can call the AdjustConfig.setSendInBackground()
method with a true
argument to enable the SDK to send information to Adjust while your app is running in the background.
In SDK v5, you need to set the IsSendingInBackgroundEnabled
property on your AdjustConfig
instance to true
to enable the SDK to send information to Adjust while your app is running in the background.
Preinstalled app measurement
In SDK v4, you can enable measuring preinstalled apps using the AdjustConfig.setPreinstallTrackingEnabled
method.
In SDK v5, you need to set the IsPreinstallTrackingEnabled
property on your AdjustConfig
instance to true
.
In SDK v4, you can configure the path containing preinstalled app information using the AdjustConfig.setPreinstallFilePath
method.
In SDK v5, you need to set the PreinstallFilePath
property on your AdjustConfig
instance to the file path containing your preinstalled app information.
In SDK v4, you can set a default link token to measure installs for preinstalled apps using the AdjustConfig.setDefaultTracker()
method.
In SDK v5, you need to assign your link to the DefaultTracker
property on your AdjustConfig
instance directly.
Set external device ID
In SDK v4, you can set an external device ID by passing an ID to the AdjustConfig.setExternalDeviceId()
method.
In SDK v5, you need to assign your ID to the ExternalDeviceID
property on your AdjustConfig
instance directly.
Set Meta App ID
In SDK v4, you can set your Meta app ID using the AdjustConfig.setFbAppId()
method.
In SDK v5, you need to assign your Meta app ID to the FbAppId
property on your AdjustConfig
instance.
Disable AdServices information reading
In SDK v4, you can call the AdjustConfig.setAllowAdServicesInfoReading()
method with a false
argument to prevent the Adjust SDK from reading AdServices information.
In SDK v5, you need to set the IsAdServicesEnabled
property on your AdjustConfig
instance to false
to prevent the Adjust SDK from reading AdServices information.
Disable IDFA reading
In SDK v4, you can call the AdjustConfig.setAllowIdfaReading()
method with a false
argument to prevent the Adjust SDK from reading the device’s IDFA.
In SDK v5, you need to set the IsIdfaReadingEnabled
property on your AdjustConfig
instance to false
to prevent the Adjust SDK from reading the device’s IDFA.
Enable cost data in attribution
In SDK v4, you can enable cost data in the device’s attribution information by calling the Adjust.setNeedsCost()
method with a true
argument.
In SDK v5, you need to set the IsCostDataInAttributionEnabled
property on your AdjustConfig
instance to true
to enable cost data in the device’s attribution information.
Enable LinkMe
In SDK v4, you can enable Adjust LinkMe by calling the AdjustConfig.setLinkMeEnabled()
method with a true
argument.
In SDK v5, you need to set the IsLinkMeEnabled
property on your AdjustConfig
instance to true
to enable LinkMe.
Only read device IDs once
In SDK v4, you can instruct the SDK to only read device identifiers one time upon startup by calling the AdjustConfig.setReadDeviceInfoOnceEnabled()
method with a true
argument.
In SDK v5, you need to set the IsDeviceIdsReadingOnceEnabled
property on your AdjustConfig
instance to true
to instruct the SDK to only read device IDs once.
Offline mode
In SDK v4, you can enable and disable offline mode the SDK by calling Adjust.setOfflineMode()
with a bool
argument.
In SDK v5, this feature is split into separate commands for clarity.
- Call
Adjust.SwitchToOfflineMode()
to set the SDK to offline mode. - Call
Adjust.SwitchBackToOnlineMode()
to set the SDK back to online mode.
Push tokens
In SDK v4, you can set your push tokens using the Adjust.setDeviceToken
method.
This method has been renamed to Adjust.SetPushToken
in SDK v5.
Session callback parameters
In SDK v4, you can add session parameters by passing a key-value pair to the Adjust.addSessionCallbackParameter()
method and remove individual parameters using the Adjust.removeSessionCallbackParameter()
method.
In SDK v5, session parameters are renamed to global parameters.
Session partner parameters
In SDK v4, you can add session partner parameters by passing a key-value pair to the Adjust.addSessionPartnerParameter()
method and remove individual parameters using the Adjust.removeSessionPartnerParameter()
method.
In SDK v5, session partner parameters are renamed to global partner parameters.
Success and failure callbacks
In SDK v4, you can configure session success and failure callbacks by passing delegate functions to the AdjustConfig.setSessionSuccessDelegate()
and AdjustConfig.setSessionFailureDelegate()
methods respectively.
In SDK v5, you need to set the SessionSuccessDelegate
and SessionFailureDelegate
properties on your AdjustConfig
instance to the relevant delegate functions.
The same change also applies to event success and failure callbacks. In SDK v4, these are set by passing delegate functions to the AdjustConfig.setSessionSuccessDelegate()
and AdjustConfig.setSessionFailureDelegate()
methods respectively.
In SDK v5, you need to set the EventSuccessDelegate
and EventFailureDelegate
properties on your AdjustConfig
instance to the relevant delegate functions.
App Store Subscriptions
The following class properties should be set directly in SDK v5:
TransactionDate
SalesRegion
The following setters have been renamed:
addCallbackParameter
->AddCallbackParameter
addCallbackParameter
->AddPartnerParameter
Here is a full example of what has changed:
Play Store Subscriptions
The following class properties should be set directly in SDK v5:
PurchaseTime
The following setters have been renamed:
addCallbackParameter
->AddCallbackParameter
addCallbackParameter
->AddPartnerParameter
Here is a full example of what has changed:
AdjustEvent class
The following class properties should be set directly in SDK v5:
CallbackId
TransactionId
ProductId
PurchaseToken
The following setters have been renamed:
setRevenue
->SetRevenue
addCallbackParameter
->AddCallbackParameter
addCallbackParameter
->AddPartnerParameter
The receipt
property has been removed from the AdjustEvent
class.
Here is a full example of what has changed:
Event deduplication
In SDK v4, event deduplication is coupled with the event transaction ID
and is limited to a maximum of 10 unique IDs.
In SDK v5, the feature is decoupled from transaction ID
. A new ID field called DeduplicationId
has been added for event deduplication.
Users can set a custom limit on the number of DeduplicationId
that can be added to the list for identifying duplicate events. By default, the limit is set to 10.
AdjustAttribution class
In SDK v4, the AdjustAttribution
calls has a property called adid
. In SDK v5, the adid
property has been removed from the AdjustAttribution
class. You can retrieve the device’s ADID using the Adjust.GetAdid()
getter method.
In addition, all internal members of the AdjustAttribution
class are now public properties.
Attribution changed callback
In SDK v4, you can call a delegate function when the device’s attribution changes by assigning the function to the AdjustConfig.setAttributionChangedDelegate()
function.
In SDK v5, you need to assign your delegate function to the AttributionChangedDelegate
property on your AdjustConfig
instance.
Reattribution using deep links
In SDK v4, you can pass your deep link information to the Adjust.appWillOpenUrl()
method.
In SDK v5, this has been renamed to Adjust.ProcessDeeplink()
for clarity. A new AdjustDeeplink
class has been added for constructing deep links. To process a deep link, instantiate an AdjustDeeplink
object with your deep link URL and pass it to the Adjust.ProcessDeeplink
method.
Launch deferred deep links
In SDK v4, you can call the AdjustConfig.setLaunchDeferredDeeplink()
method to open deferred deep links.
In SDK v5, you need to set the IsDeferredDeeplinkOpeningEnabled
property on your AdjustConfig
instance to true
to enable the SDK to open deep links.
COPPA compliance
In SDK v4, you can mark your app as COPPA compliant by calling the setCoppaCompliantEnabled
method on your AdjustConfig
instance with a bool
value.
In SDK v5, you need to set the IsCoppaComplianceEnabled
property on your AdjustConfig
instance to a bool
value.
Play Store Kids Apps
In SDK v4, you can mark an app as a Play Store Kids app using the AdjustConfig
class. This property is read during SDK initialization, which means that the value can’t be updated once the SDK is initialized.
In SDK v5, you need to set the IsPlayStoreKidsComplianceEnabled
property of your AdjustConfig
instance to true
to enable compliance.
Set data residency and URL strategy
In SDK v4, URL strategy and data residency domains are defined as constants in the AdjustConfig
class.
In SDK v5, you need to pass your chosen domain or domains as an array. You can also set the following:
shouldUseSubdomains
(bool
): Whether the source should prefix a subdomain.isDataResidency
(bool
): Whether the domain should be used for data residency.
Check the table below to see how to configure your URL strategy in SDK v5.
v4 | v5 - main and fallback domain | v5 - use sub domains | v5 - is Data Residency |
---|---|---|---|
AdjustConfig.AdjustDataResidencyEU | "eu.adjust.com" | true | true |
AdjustConfig.AdjustDataResidencyTR | "tr.adjust.com" | true | true |
AdjustConfig.AdjustDataResidencyUS | "us.adjust.com" | true | true |
AdjustConfig.AdjustUrlStrategyChina | "adjust.world" , "adjust.com" | true | false |
AdjustConfig.AdjustUrlStrategyCn | "adjust.cn" , "adjust.com" | true | false |
AdjustConfig.AdjustUrlStrategyCnOnly | "adjust.cn" | true | false |
AdjustConfig.AdjustUrlStrategyIndia | "adjust.net.in" , "adjust.com" | true | false |
Examples
AdjustThirdPartySharing class changes
The following methods have been renamed in SDK v5:
addGranularOption
->AddGranularOption
addPartnerSharingSetting
->AddPartnerSharingSetting
Here is a full example of what has changed:
Send ad revenue from a specific source
In SDK v4, ad revenue sources are defined as constants in the AdjustConfig
class. In SDK v5, ad revenue sources need to be passed as a string.
v4 | v5 |
---|---|
AdjustConfig.AdjustAdRevenueSourceAppLovinMAX | "applovin_max_sdk" |
AdjustConfig.AdjustAdRevenueSourceAdMob | "admob_sdk" |
AdjustConfig.AdjustAdRevenueSourceIronSource | "ironsource_sdk" |
AdjustConfig.AdjustAdRevenueSourceAdMost | "admost_sdk" |
AdjustConfig.AdjustAdRevenueSourceUnity | "unity_sdk" |
AdjustConfig.AdjustAdRevenueSourceHeliumChartboost | "helium_chartboost_sdk" |
AdjustConfig.AdjustAdRevenueSourceADX | "adx_sdk" |
AdjustConfig.AdjustAdRevenueSourcePublisher | "publisher_sdk" |
AdjustConfig.AdjustAdRevenueSourceTradplus | "tradplus_sdk" |
AdjustConfig.AdjustAdRevenueSourceTopOn | "topon_sdk" |
AdjustConfig.AdjustAdRevenueSourceMopub | No longer supported |
AdjustAdRevenue class changes
The following class properties should be set directly in SDK v5:
AdImpressionsCount
AdRevenueNetwork
AdRevenueUnit
AdRevenuePlacement
The following setters have been renamed:
setRevenue
->SetRevenue
addCallbackParameter
->AddCallbackParameter
addCallbackParameter
->AddPartnerParameter
Here is a full example of what has changed:
Configure ATT pop-up waiting interval
In SDK v4, you can use the setAttConsentWaitingInterval
method of your AdjustConfig
instance to configure an interval that delays sending install information to Adjust. This delay gives the user time to interact with an ATT pop-up.
In SDK v5, you need to assign your delay interval to the AttConsentWaitingInterval
property of your AdjustConfig
instance.
Disable SKAdNetwork communication
In SDK v4, you can prevent the SDK from communicating with SKAdNetwork by calling the AdjustConfig.deactivateSKAdNetworkHandling()
method.
In SDK v5, you need to set the IsSkanAttributionEnabled
property on your AdjustConfig
instance to false
to disable SKAdNetwork communication.
Listen for conversion value updates
In SDK v4, you can assign a delegate function to listen for conversion value updates by passing it to the AdjustConfig.setConversionValueUpdatedDelegate()
.
In SDK v5, you need to assign your delegate function to the SkanUpdatedDelegate
property on your AdjustConfig
instance.
Update conversion values
In SDK v4, you can use the Adjust.updateConversionValue()
method to send updated conversion values to Adjust. This method wraps Apple’s deprecated updateConversionValue
method and has been removed in SDK v5.
To update conversion values in SDK v5, use the Adjust.UpdateSkanConversionValue()
method with the following arguments:
conversionValue
(int
): The updated conversion valuecoarseValue
(string
): The updated coarse conversion valuelockWindow
(bool
): Whether to send the postback before the conversion window endscallback
(Action<string>
): A callback function which can handle any errors that occur
App Tracking Transparency authorization wrapper
In SDK v4, you can handle changes to a user’s ATT authorization status using the Adjust requestTrackingAuthorizationWithCompletionHandler()
method.
This has been renamed to Adjust.RequestAppTrackingAuthorization()
in SDK v5 for clarity.
Get device information
In SDK v4, all device information getter methods run synchronously. In SDK v5, these methods have been changed to run asynchronously. You can add a callback function to handle the information when the asynchronous process completes
Removed APIs
The following APIs have been removed in SDK v5.
Event buffering
SDK v4 supports event buffering. This feature stores requests event, ad revenue, push tokens, and other information on a local buffer to send at a later date.
This setting has been removed in SDK v5.
Custom user agent string
SDK v4 supports setting a custom User Agent by calling AdjustConfig.setUserAgent()
with a user agent string.
This setting has been removed in SDK v5.
Set whether a device is known
In SDK v4, you can call the AdjustConfig.setDeviceKnown()
method to manually inform the SDK whether a device is known.
This setting has been removed in SDK v5.
Delay SDK start
SDK v4 supports delaying the start of the SDK by calling AdjustConfig setDelayTimer()
with up to 10 seconds of delay.
This setting has been removed in SDK v5.
Disable third party sharing globally
In SDK v4, you can call the Adjust.disableThirdPartySharing()
method to globally disable sharing information with third parties globally.
This feature has been removed from SDK v5. In SDK v5, use the Adjust.trackThirdPartySharing()
method to enable or disable third party sharing.
Check for authorization status change
In SDK v4, you can use the Adjust.checkForNewAttStatus()
method to prompt the SDK to read a user’s ATT status and forward the information to Adjust’s servers.
This method has been removed in SDK v5.
Set an App Secret
SDK v4 supports setting an App Secret by calling setAppSecret
method on your AdjustConfig
instance to sign the SDK traffic with.
This setting has been removed in SDK v5.