AdjustConfig class
Use the AdjustConfig
class to store settings for use with the Adjust SDK.
AdjustConfig
class before you initialize the Adjust SDK. This is because the SDK copies properties from this class at runtime.
Functions
Set up the SDK with the AdjustConfig class
To set up the SDK, you need to pass information about your app to your config object. You need to specify your app token, environment, and log level.
AdjustConfig (Context context, String appToken, String environment, boolean allowSuppressLogLevel)
Enable event buffering
If you are triggering a lot of events in your app, you may want to enable event buffering. Event buffering staggers the sending of events. When enabled, the Adjust SDK sends events once per minute rather than in real-time. The buffer will hold events until the Adjust SDK sends them to the Adjust backend.
void setEventBufferingEnabled (Boolean eventBufferingEnabled)
Enable sending of data in the background
By default, the Adjust SDK will only send event information when the app is open in the foreground. You can enable the SDK to send events when the app is running in the background.
void setSendInBackground (boolean sendInBackground)
Change the logging level
You can change the level of logging you receive from the Adjust SDK by changing the logLevel
property. Some log levels are only available when you are running the application in a sandboxed environment.
void setLogLevel (LogLevel logLevel)
Set custom process name
If you are building a multi-process app, you will need to set the main process name in your config object.
void setProcessName (String processName)
Set a default tracker
You can set a default tracker for your app. The Adjust SDK will use this tracker when there is no other tracker information to read.
void setDefaultTracker (String defaultTracker)
Set attribution listener
You can register a delegate callback to notify you of tracker attribution changes. The Adjust SDK cannot provide this information synchronously. This is due to the different sources considered for attribution.
void setOnAttributionChangedListener (OnAttributionChangedListener onAttributionChangedListener)
Set whether a device is known
You can specify whether a device is already known in your config instance.
void setDeviceKnown (boolean deviceKnown)
Set event tracking success delegate
You can register a delegate callback to notify you when an event has been successfully tracked.
void setOnEventTrackingSucceededListener (OnEventTrackingSucceededListener onEventTrackingSucceededListener)
Set event tracking failure delegate
You can register a delegate callback to notify you when an event has not been tracked.
void setOnEventTrackingFailedListener (OnEventTrackingFailedListener onEventTrackingFailedListener)
Set session tracking success delegate
You can register a delegate callback to notify you when a session has been successfully tracked.
void setOnSessionTrackingSucceededListener (OnSessionTrackingSucceededListener onSessionTrackingSucceededListener)
Set session tracking failure delegate
You can register a delegate callback to notify you when a session has not been tracked.
void setOnSessionTrackingFailedListener (OnSessionTrackingFailedListener onSessionTrackingFailedListener)
Set a deep link response listener
You can set up a listener to respond to deep link information. This listener should return a boolean value. The value indicates whether you want to launch an activity when the user opens a deep link. See the deep linking guide for more information.
void setOnDeeplinkResponseListener (OnDeeplinkResponseListener onDeeplinkResponseListener)
Delay the launch of the SDK
Some information may not be available until after your app has launched. If you need to wait for the data to become available, you can delay the SDK's first launch. You can specify the number of seconds to delay the launch by.
void setDelayStart (double delayStart)
Set external device ID
An external device identifier is a custom value that you can assign to a device or user. They can be useful if you want to recognize a user across multiple sessions and installs even if the device identifier changes.
void setExternalDeviceId (String externalDeviceId)
Set whether preinstall tracking is enabled or not
You can use the Adjust SDK to check if your app came preinstalled on a user's device. The best way to do this is by using a system payload. To do this, you need to enable this feature in your config object.
void setPreinstallTrackingEnabled (boolean preinstallTrackingEnabled)
Require sending of cost data with attribution
The Adjust SDK enables you to specify if you need to send cost data as part of attribution.
void setNeedsCost (boolean needsCost)
Set data residency
The Adjust SDK can use the url strategy setting to prioritise regional endpoints. You can use this if you are making use of the data residency feature.
void setUrlStrategy (String urlStrategy)