The First Session Delay feature allows you to delay SDK initialization during the very first SDK session only. While in this delay mode, the Adjust SDK records all activity (such as installs and events) in memory, but does not transmit any data to Adjust servers.
This gives your app an opportunity to gather additional data that may not be available at launch and, if needed, modify the SDK configuration before any data is sent. Once the delay ends, SDK will apply all the settings configured during the delay before tracking an install.
When and Why to Use First Session Delay
Use this feature if you need to:
- Set COPPA compliance for the user.
- Indicate that the user falls under the Play Store’s “Designed for Families” (kids) category.
- Assign an external device ID.
In addition to the features supported by a dedicated first session delay API, you can also perform the following actions during the delay:
- Show the App Tracking Transparency (ATT) dialog and act on the user’s response.
- Set third-party sharing settings.
- Set DMA consent parameters.
- Set consent measurement for specific users.
- Set global partner or callback parameters.
Enabling First Session Delay
To initialize the SDK in delayed mode, use the following setup:
AdjustConfig2dx adjustConfig = AdjustConfig2dx(appToken, environment);adjustConfig.enableFirstSessionDelay();
Adjust2dx::initSdk(adjustConfig);After this, the SDK will be initialized in memory and will not process anything until you explicitly call:
Adjust2dx::endFirstSessionDelay();Configuration changing while on delay
Set COPPA compliance
While the SDK is in first session delay mode, it is possible to change COPPA compliance, as if it were set in the config during initSdk.
To enable COPPA compliance:
Adjust2dx::enableCoppaComplianceInDelay();To disable COPPA compliance:
Adjust2dx::disableCoppaComplianceInDelay();Set Play Store kids compliance
While the SDK is in first session delay mode, it is possible to change Play Store kids compliance, as if it were set in the config during initSdk.
To enable Play Store kids compliance:
Adjust2dx::enablePlayStoreKidsComplianceInDelay();To disable Play Store kids compliance:
Adjust2dx::disablePlayStoreKidsComplianceInDelay();Set external device ID
While the SDK is in first session delay mode, it is possible to set the external device ID, as if it were configured during initSdk.
To set the external device ID:
Adjust2dx::setExternalDeviceIdInDelay("ExternalDeviceId");