FAQs
You should initialize the Adjust SDK in the didFinishLaunching
or didFinishLaunchingWithOptions
method. If you have followed the get started guide, these methods should be in your app delegate. It is important to initialize the Adjust SDK as soon as possible to enable all the features of the SDK.
If you do not initialize the SDK straight away after launch it can lead to unexpected behavior. The Adjust SDK can not track anything if it is not initialized.
If you do any of the following before initializing the Adjust SDK, they won't work:
- Event tracking.
- Reattribution via deep links.
- Disable tracking.
- Offline mode.
If you want to track any of these actions with the SDK before initializing it, you will need to save add them to a queue. You can build a custom actions queueing mechanism in your app. You will need to queue any actions you want the Adjust SDK to perform and trigger them once you initialize the SDK.
Delaying the initialization of the SDK may also impact session tracking. The SDK can not track session length until you initialize it. This can have an impact on your DAU numbers.
For example: you could initialize the Adjust SDK when the user navigates to a specific screen in your app. If you do this, the Adjust SDK will not track the user when they open the app and hit the home screen. If the user then decides to uninstall the app, the Adjust SDK will not track this information either. You will not receive any information about this in the dashboard.
Event tracking
If you are tracking events, create an internal queueing mechanism. Add events to the queue for the Adjust SDK to track after you have initialized it. Attempting to track events before you initialize the Adjust SDK will not work. The Adjust SDK will not track the events and they will be permanently lost. Make sure that the Adjust SDK is enabled and that you have initialized it before tracking events.
Offline mode and enable or disable tracking
The Adjust SDK does not persist the offline state when you set it. When a new session starts up, the Adjust SDK will start in online mode. If you attempt to enable offline mode before initializing the Adjust SDK, it will not work. The Adjust SDK will toggle to online mode when you initialize it as the setting is not persistent.
Enabling and disabling tracking persists between initializations of the Adjust SDK. If you toggle this value before initializing the Adjust SDK, this will not work. The Adjust SDK will remember the state it was in when it was last initialized.
Reattribution via deep links
If you are using universal links, you will get an NSURL
object from the link. After you receive this link, you need to make the following call:
[Adjust appWillOpenUrl:url]
If you make this call before initializing the Adjust SDK, it will not work. The attribution information contained in the URL will be lost. To get the Adjust SDk to reattribute you user, you need to queue the NSURL
object. After you have initialized the Adjust SDK, trigger the appWillOpenUrl
method. This will allow the Adjust SDK to open the URL object and direct the user to the right location in your app.
Session tracking
The Adjust SDK will track sessions automatically. You need to initialize the Adjust SDK early to capture the session information. If you do not initialize the SDK straight away after launch it can lead to unexpected behavior. The Adjust SDK can not track anything if it is not initialized.
Here are a few scenarios of where tracking might fail if you do not initialize the Adjust SDK early enough:
- The user opens your app but uninstalls it before you initialize the Adjust SDK. The Adjust SDK is not able to capture the install and session information. The install is not reported in the dashboard.
- The user downloads and opens your app before midnight. You have delayed the start of the Adjust SDK so it initializes after midnight. The Adjust SDK will report the install and session data on the wrong day.
- The user opens your app before midnight. You have delayed the start of the Adjust SDK so it initializes after midnight. The Adjust SDK will report the session data on the wrong day, causing a gap in your DAU.
If your build failed with the error Adjust requires ARC
, your project is most likely not using ARC. We recommend transitioning your project to use ARC. If you don't want to use ARC, you have to enable ARC for all source files of adjust in the target's Build Phases:
- Expand the Compile Sources group.
- Select all Adjust files and change the Compiler Flags to
-fobjc-arc
. Select all and press the Return key to change all at once.
This error can occur when you are adding the Adjust SDK framework to your app. The Adjust SDK contains categories among its source files. If you have chosen this SDK integration approach, you need to add -ObjC
flags to Other Linker Flags in your Xcode project settings. Adding this flag will fix this error.
This error usually occurs when testing installs. Uninstalling and reinstalling the app is not enough to trigger a new install. The backend will determine that the SDK has lost its local session data. It will ignore the message given the information available about the device. The backend behaves this way to make sure the sandbox behavior matches production.
You can reset app session data for a device from the Testing Console. This requires Editor-level access or higher for the app you are working on.
Once you have removed the device from the Testing Console, it will return Forgot device
. If the device was already forgotten or the values were incorrect, it will return Device not found
.
Forgetting the device will not reverse the GDPR forget me call.
If you have access to the Device API, you can use this to inspect and forget devices.
This can occur if you are using Xcode to simulate an installation scenario. If you re-run the installation in Xcode, it does not wipe the information held by the Adjust SDK. When you re-run the install, the Adjust SDK will detect the existing files and will not track a new install.
To re-run the app installation scenario, do following:
- Uninstall the app from your device.
- Forget your test device from the Adjust Testing Console.
- Run your app from the Xcode on the test device. You should see the "Install tracked" message in the logs.
The Adjust SDK tracks information as you specify it in your app. The Adjust SDK does not make any changes to the information, it only passes it to the Adjust backend. The Adjust backend will then display the information it has received for you to analyze. If you are seeing discrepancies, check your revenue tracking code.
Here is an example of a revenue tracking event:
// ...
- (double)someLogicForGettingRevenueAmount {
// This method somehow handles how user determines
// what's the revenue value which should be tracked.
// It is maybe making some calculations to determine it.
// Or maybe extracting the info from In-App purchase which
// was successfully finished.
// Or maybe returns some predefined double value.
double amount; // double amount = some double value
return amount;
}
// ...
- (void)someRandomMethodInTheApp {
double amount = [self someLogicForGettingRevenueAmount];
ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"];
[event setRevenue:amount currency:@"EUR"];
[Adjust trackEvent:event];
}
If you notice a discrepancy, check the logic you are using for determining the revenue amount.
The size of the Adjust SDK is different depending on how you add it to your project. Here are some estimated sizes for supported installation methods:
- Carthage: 2,600 kb
- CocoaPods: 600 kb