Manual Initialization

Our SDK offers two initialization modes: automatic and manual. We recommend using automatic initialization unless you need to start the SDK at a specific point in your app's lifecycle or dynamically select the App Insights Project at runtime.
Initialization Modes Comparison
| Automatic | Manual | |
|---|---|---|
| No-code solution | Yes | No |
| Moment of initialization | On app launch | When you call initialization method |
| Selecting App Insights project at runtime | No | Yes |
Recommendation
Our automatic initialization will provide maximum benefits including:
- No-code solution: You don't need to add any code to initialize the SDK.
- Moment of initialization: The SDK always initializes as early as possible, ensuring that all interactions are captured and evaluated accurately.
Enabling Manual Initialization
Before enabling manual initialization, please note that:
You must call the
initializemethod before any other SDK method. Calling any other method first will cause errors and undefined behavior.
You must disable automatic initialization. If the SDK Key is present in your platform configuration, automatic initialization takes precedence and all manual initialization calls are ignored.
See the platform guides below for how to disable it on your platform.
Platform Guides
- iOS
- Android
- React Native
-
Remove the
SdkKeyfrom theQualtricsdictionary inInfo.plist(if present) to disable automatic initialization. -
Add this code to manually initialize the SDK, replacing
YOUR_SDK_KEYwith your actual SDK Key.We strongly recommend initializing the SDK as early as possible (e.g. in your
AppDelegate) to capture and evaluate all events from app launch.import QualtricsExperience
Qualtrics.initialize(sdkKey: "YOUR_SDK_KEY") -
Launch the app and check the logs to verify successful initialization.
-
Remove the
qualtrics_sdk_keyfromres/values(if present) to disable automatic initialization. -
Add this code to manually initialize the SDK, replacing
YOUR_SDK_KEYwith your actual SDK Key.We strongly recommend initializing the SDK as early as possible (e.g. in your main activity) to capture and evaluate all events from app launch.
Qualtrics.initialize("YOUR_SDK_KEY", activity) -
Launch the app and check the logs to verify successful initialization.
-
Remove the
SDK_KEYfrom.qualtricsconfig(if present) to disable automatic initialization. -
Add this code to manually initialize the SDK, replacing
YOUR_SDK_KEYwith your actual SDK Key.We strongly recommend initializing the SDK as early as possible (e.g. in your
App.tsx) to capture and evaluate all events from app launch.import { initialize } from '@qualtrics-experience/core';
initialize('YOUR_SDK_KEY'); -
Launch the app and check the logs to verify successful initialization.