HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Auto Integration

This topic describes how to set up an auto integration between your app and Optimizely Data Platform (ODP).

Install CocoaPods

If you do not already have CocoaPods installed, you can do so by running the following command in your terminal:

gem install cocoapods

Create Project Podfile

If you do not already have a Podfile associated with your project, create one. To do this, execute the following in the top level of your project’s directory:

pod init



This will result in a Podfile being added to the top level of your project’s directory.

Modify the Podfile

The newly created Podfile will be pre-populated with content.

  1. Start by making sure that at the top of your file you have the line platform :ios, '9.0'.
  2. Next, add the line use_frameworks! which will instruct CocoaPods to use the ODP dynamic framework.
  3. Finally, you'll notice that the Podfile contains an entry for each target of your project. Add the line pod 'Zaius' which will indicate to CocoaPods that the target is dependent on the ODP SDK and will install it into that target.

Install ODP CocoaPod

pod install

Once this command completes execution, a new Xcode project workspace will be created (YOUR-PROJECT-NAME.xcworkspace).

You should now open the project workspace instead of the project file (YOUR-PROJECT-NAME.xcodeproj).

Then you may simply import the SDK into your AppDelegate like so:

#import <ZaiusSDK_iOS/ZaiusSDK_iOS.h> //iOS

#import <ZaiusSDK_tvOS/ZaiusSDK_tvOS.h> //tvOS
import ZaiusSDK_iOS //iOS

import ZaiusSDK_tvOS //tvOS

Initialize the SDK

Add this code into your application:didFinishLaunchingWithOptions: call within your AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Zaius autoIntegrate:^(ZaiusBuilder *_Nonnull builder) {

      builder.trackerId = @"ZAIUS_TRACKER_ID";
      builder.appId = @"APP_ID";
      builder.launchOptions = launchOptions;
      builder.collectTokenWhenAnonymous = YES;

  // Initialize your application

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  Zaius.autoIntegrate() { (builder) in
    builder.trackerId = "ZAIUS_TRACKER_ID"
    builder.appId = "APP_ID"
    builder.launchOptions = launchOptions
    builder.collectTokenWhenAnonymous = true
    // Initialize your application

The Zauis Tracker ID and the App ID are both found on the integrations page. The Tracker ID is in the upper-right, while the App ID is the short identifier under the Mobile Apps integration tile.



ODP registers for all notification types UIUserNotificationTypeAlert, UIUserNotificationTypeBadge, UIUserNotificationTypeSound.

Additional Options

builder.sandbox // if this app is setup as a Sandbox app within ODP
builder.collectTokenWhenAnonymous // collect push tokens when customer ID is not set (not recommended to disable)
builder.enablePushNotification // request push permissions on app initialization



An incorrect sandbox setting may result in a certificate mismatch (for example, sending with a sandbox certificate to an app in "production" mode). Ensure this is set to false or NO before releasing to production.

Delay Push Notification Prompt

If you would like to delay prompting the user to accept push notifications, set the builder property as follows:

builder.enablePushNotification = NO

When you are ready to prompt the user for push permissions, call the following:

[Zaius enablePushNotifications:YES]