Skip to main content

Manual Initialization

Manual vs automatic 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​

AutomaticManual
No-code solutionYesNo
Moment of initializationOn app launchWhen you call initialization method
Selecting App Insights project at runtimeNoYes

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 initialize method 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​

  1. Remove the SdkKey from the Qualtrics dictionary in Info.plist (if present) to disable automatic initialization.

  2. Add this code to manually initialize the SDK, replacing YOUR_SDK_KEY with 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")
  3. Launch the app and check the logs to verify successful initialization.