Adjust class
The Adjust class can be used to send information about your application and users to Adjust. This can be used for attribution as well as for tracking of events for analytics.
Functions
Send callback parameters for each session
You can send callback parameters with each session recorded by the Adjust SDK. You can add extra parameters by calling on this method multiple times.
static void com.adjust.sdk.Adjust.addSessionCallbackParameter ( String key,
String value
)
Remove session callback parameters
If you have added a session parameter, you can remove it at a later time. To do this, pass the parameter key to the removeSessionCallbackParameter
method.
static void com.adjust.sdk.Adjust.removeSessionCallbackParameter ( String key )
Reset all session callback parameters
If you have added session callback parameters, you can remove them all at a later time. To do this, call the resetSessionCallbackParameters
method.
static void com.adjust.sdk.Adjust.resetSessionCallbackParameters()
Send callback parameters for each session to network partners
You can send callback parameters to partners with each session recorded by the Adjust SDK. You can add extra parameters by calling on this method multiple times.
static void com.adjust.sdk.Adjust.addSessionPartnerParameter ( String key,
String value
)
Remove callback parameters for partners
If you have added a partner parameter, you can remove it at a later time. To do this, pass the parameter key to the removeSessionPartnerParameter
method.
static void com.adjust.sdk.Adjust.removeSessionPartnerParameter ( String key )
Reset all callback parameters for partners
If you have added partner parameters, you can remove them all at a later time. To do this, call the resetSessionPartnerParameters
method.
static void com.adjust.sdk.Adjust.resetSessionPartnerParameters ()
Get the Adjust ID for a device
You can return the Adjust ID (adid) of a user's device by calling the adid
method.
static String com.adjust.sdk.Adjust.getAdid ()
Get deep link attribution information from a URL
If you are using deep links, you can instruct the Adjust SDK to search the URL for attribution information. If the SDK finds valid information, it will send this information to the Adjust backend.
static void com.adjust.sdk.Adjust.appWillOpenUrl ( Uri url,
Context context
)
Get current attribution data
After a user has installed your app, you can query the Adjust SDK for the device attribution information.
static AdjustAttribution com.adjust.sdk.Adjust.getAttribution ()
Change third-party sharing options
You can communicate a user's preference for third-party sharing. Call the following method with a third party sharing object. Initialize the object with the user's preference.
You can also pass granular options with the user's preference to gather more detail for your analytics.
Disable sharing of data to third parties
You can prevent sharing information with third-parties by calling the disableThirdPartySharing
method. This is set to false
by default.
static void com.adjust.sdk.Adjust.disableThirdPartySharing (final Context context)
Enable data privacy settings in the SDK
If you are using Adjust's data privacy settings, you need to toggle this in the Adjust SDK. Call the trackMeasurementConsent
method to set this up.
static void com.adjust.sdk.Adjust.trackMeasurementConsent (final boolean consentMeasurement)
Enable user to request to be forgotten for GDPR
You can enable users to request the right to be forgotten. When you call this method, the Adjust SDK will communicate the request to the Adjust backend. The Adjust backend will erase the user's information.
static void com.adjust.sdk.Adjust.gdprForgetMe (final Context context)
Gather a device's Google Play Advertising ID
If you are targeting the Google Play Store, you can use the Adjust SDK to retrieve a device's advertising ID. This is sometimes useful for performing analysis.
static void com.adjust.sdk.Adjust.getGoogleAdId (Context context,
OnDeviceIdsRead onDeviceIdRead
)
Gather a device's Amazon Advertising ID
If you are targeting the Amazon App Store, you can use the Adjust SDK to retrieve a device's advertising ID. This is sometimes useful for performing analysis.
static String com.adjust.sdk.Adjust.getAmazonAdId (final Context context)
Enable or disable the Adjust SDK
You can enable and disable tracking with the Adjust SDK using the setEnabled
method.
checkEnabled
method.
static void com.adjust.sdk.Adjust.setEnabled (boolean enabled)
Check the Adjust SDK is enabled
You can check whether the Adjust SDK is enabled by calling on the isEnabled
method.
static boolean com.adjust.sdk.Adjust.isEnabled ()
Check the version of the Adjust SDK
If you want to verify which version of the Adjust SDK a device is running, you can call on the sdkVersion
method.
static String com.adjust.sdk.Adjust.getSdkVersion ()
Set up a push token
If you are making use of push notifications for reattribution, you need to add your token to the Adjust SDK.
static void com.adjust.sdk.Adjust.setPushToken (final String token,
final Context context
)
Enable or disable offline mode
When a user's device goes offline, you can queue events by putting the SDK into offline mode. In this mode the Adjust SDK will store all events until it comes back online. When the Adjust SDK comes back online, it will attempt to send the events.
static void com.adjust.sdk.Adjust.setOfflineMode (boolean enabled)
Track ad revenue from a specific source
The Adjust SDK supports receiving ad revenue information from certain network partners. You can pass information recorded by the network partner's SDK to the Adjust SDK as a JSON object.
static void com.adjust.sdk.Adjust.trackAdRevenue (final AdjustAdRevenue adjustAdRevenue)
Track an event
The Adjust SDK allows you to pass back event information to the Adjust backend. This can be seen when looking at raw data exports.
static void com.adjust.sdk.Adjust.trackEvent (AdjustEvent event)
Track a subscription
The Adjust SDK enables you to track information about in-app subscriptions events. You can do this by forming a subscription object and passing it to the SDK.
static void com.adjust.sdk.Adjust.trackPlayStoreSubscription (final AdjustPlayStoreSubscription subscription)
Prompt the SDK to send initial payload
If you delay the start of the Adjust SDK, it will send information to the backend after the delay timer runs out. You can us this method to prompt the SDK to send packages before the delay time is up.
static void com.adjust.sdk.Adjust.sendFirstPackages ()