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.
Methods
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.
+ (void) addSessionCallbackParameter: (nonnull NSString *) key
value: (nonnull NSString *) 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.
+ (void) removeSessionCallbackParameter: (nonnull NSString *) 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.
+ (void) 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.
+ (void) addSessionPartnerParameter: (nonnull NSString *) key
value: (nonnull NSString *) 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.
+ (void) removeSessionPartnerParameter: (nonnull NSString *) 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.
+ (void) 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.
+ (NSString *) adid
Verify the app launched correctly
To initialize the SDK, you need to verify that your application launched properly. To do this, you can pass your ADJConfig object to the appDidLaunch
method:
+ (void) appDidLaunch: (nullable ADJConfig *) adjustConfig
Handle App Tracking Transparency choices
The Adjust SDK includes a wrapper built on top of the requestTrackingAuthorizationWithCompletionHandler
method. You can use this wrapper to gather information about the user's authorization status.
Retrieve the current tracking authorization status
As of iOS 14.5, users need to give explicit consent for you to capture a device's ID for Advertisers (IDFA). You can query the Adjust SDK for the consent status with the appTrackingAuthorizationStatus
method.
- (int) appTrackingAuthorizationStatus
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.
+ (void) appWillOpenUrl: (nonnull NSURL *) url
Get current attribution data
After a user has installed your app, you can query the Adjust SDK for the device attribution information.
+ (ADJAttribution *) attribution
Convert a universal URL to a scheme URL
The Adjust SDK contains a helper method to convert universal links into deep links. To use this, pass your custom deep link scheme to the convertUniversalLink
method.
+ (nullable NSURL *) convertUniversalLink: (nonnull NSURL *) url
scheme: (nonnull NSString *) scheme
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.
- Pass the partner-specific user's preference for third party sharing.
(void) + trackThirdPartySharing
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.
+ (void) disableThirdPartySharing
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.
+ (void) trackMeasurementConsent: (BOOL) enabled
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.
- (void) gdprForgetMe
Gather a device's IDFA
You can retrieve a device's ID for Advertisers (IDFA) by calling on the idfa
method.
+ (nullable NSString *) idfa
Enable or disable the Adjust SDK
You can enable and disable tracking with the Adjust SDK using the setEnabled
method.
checkEnabled
method.
+ (void) setEnabled: (BOOL) enabled
Check the Adjust SDK is enabled
You can check whether the Adjust SDK is enabled by calling on the isEnabled
method.
+ (BOOL) 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.
+ (NSString *) sdkVersion
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.
+ (void) setDeviceToken: (nonnull NSData *) deviceToken
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.
+ (void) setOfflineMode: (BOOL) 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.
+ (void) trackAdRevenue: (nonnull NSString *) source
payload: (nonnull NSData *) payload
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.
+ (void) trackEvent: (nullable ADJEvent *) 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.
+ (void) trackSubscription: (nonnull ADJSubscription *) subscription
Notify the SDK that the application has been paused
You can notify the Adjust SDK that the application has been paused by calling the trackSubsessionEnd
method.
+ (void) trackSubsessionEnd
Notify the SDK that the application has been resumed
You can notify the Adjust SDK that the application has been resumed by calling the trackSubsessionStart
method.
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.
+ (void) sendFirstPackages