Product Experience

Begin setting up your iOS app's Product Experience!


  • Product Experience SDK is available for integration from Smartech SDK v3.1.0 onwards.
  • Smartech Product Experience SDK only supports Xcode 11 and above.

Step 1: Complete basic setup

Go to Basic Setup to start integrating your iOS project with Smartech.

Step 2: Add Hansel to podfile

  1. Cocoapods initialization

Open terminal, go to the project directory and run the following command:

pod init

This will create a podfile in your project directory.

  1. Add Smartech-Nudges to target

In the podfile, add the following line to app's target:

pod 'Smartech-iOS-SDK' , '~> 3.2.3'
pod 'SmartechNudges', '~> 8.5.9'

For e.g. if you want to install Smartech-Nudges pod to "Gretel" target, your podfile will look like:

target 'Gretel' do
    pod 'Smartech-iOS-SDK' , '~> 3.2.3'
    pod 'SmartechNudges', '~> 8.5.9'
  1. Pod install

Open terminal, go to the project directory and run the following command:

pod install

This will install the SDK in your project. Once that is done, close the Xcode project and open <app_name>.xcworkspace in the project directory.


Using .xcworkspace

Henceforth, .xcworkspace should be used to open this project in Xcode.

Step 3: Create Bridging Header for Swift

If you are using Swift, add the following import to your app bridging header file. If your project doesn't have a bridging header, follow this FAQs to create a bridging header:

#import <SmartechNudges/Hansel-umbrella.h>

Step 4: Updating Capabilities

In Xcode target, go to Signing & Capabilities, and click on "+Capability" as shown below, if you do not have any "Keychain Groups" setup. If you do, you can directly proceed to the next step.

Click on "+Capability" to get startedClick on "+Capability" to get started

Click on "+Capability" to get started

Add a new Keychain Group (as shown below) and enter hansel_public_key (Hansel uses KeyChain Sharing for decryption of Hansel SDK's responses)

Create a new Keychain Group with the value as shownCreate a new Keychain Group with the value as shown

Create a new Keychain Group with the value as shown

Step 5: Configure Apps Info.plist with Hansel Keys

You need to add a key named HanselKeys with type Dictionary. Init add the following keys and values with their types.

KeyData typeDescription
HanselAppIdStringPlease get in touch with your account manager to create app on Hansel dashboard
HanselAppkeyStringPlease get in touch with your account manager to create app on Hansel dashboard

Following is the source code snippet of apps Info.plist for key Hansel Keys:

        <string>value of app id</string>
        <string>value of app key</string>

Following is the image representation of apps Info.plist for key HanselKeys:

Step 6: Using existing analytics events for triggers and goals

You need to link Product Experience SDK with your analytics provider to measure the impact of the changes you make on the dashboard. Track multiple variations of the user experience ( for e.g. variations of the target button with different colors, CTAs, fonts, size, placement etc.) on your analytics dashboard. Product experience SDK sends all the related data to your analytics provider, without you having to add any extra line of code.

Please note that the goal events sent to these analytics providers will have the below system parameters in addition to parameters that you will configure. These can be used to filter goal events data specific to an interaction map name and branch where the user falls into.

  hsl_counter: "2" //this is counter of how many hsl_data keys are present
  hsl_data: "J01:0123321,J02:2355235" //format:InteractionMapNameHash:BranchId
  hsl_data1: "J03:0123321"


Above analytics integrations, with exception of Smartech, are local to the device and none of the PII Information is shared back to Netcore servers.

Setting up page load events
You may use page load/page view events as triggers for Product Experience. You can check here on how to set them up .

Send nudge events to your own analytics system
If you wish to get nudge events shared back to your own analytics system, please follow the steps given here.

Step 7: Audience targeting based on user profile data

Server-side segments
If you want to use server-side segments as the target audience - please follow the steps given for user tracking & event tracking.

This will send data back to the Smartech servers and allow you to create segments based on user profile attributes & event payload data.


We recommend that you implement user tracking step if you plan to use feedback nudges

Client-side user profile data
If you want to keep user profile data at the client-side and use this information to target specific user ids, please follow the below steps.


Client side user profile data is local to the device and none of the PII Information is shared back to Netcore servers.

  • User ID
    This is a pre-defined attribute that can be the user's email id, account id, or any other identifier that you use to uniquely identify a user. If not set, Smartech SDK will generate a device-specific unique string to uniquely identify the app user.
#import <SmartechNudges/Hansel-umbrella.h>

//Setting User ID
[[Hansel getUser] setUserId:@"user_id"];

//Reset User ID and User attributes.
[[Hansel getUser] clear];
//Setting User ID

//Reset User ID and User attributes.
import {NativeModules} from 'react-native';

//Setting User ID

//Reset User ID and all User attributes.
  • Custom Attributes

Custom Attributes allow you to target users based on any data that you want. For example, to set a value for a custom attribute called “age”, you need to do the following:

#import <SmartechNudges/Hansel-umbrella.h>
[[Hansel getUser] putDoubleAttribute:25 forKey:@"age"];
Hansel.getUser().putDoubleAttribute(25, forKey: "age")
import {NativeModules} from 'react-native';

//For double attribute
NativeModules.HanselUserRn.putDoubleAttribute(key, value);

//For string attribute
NativeModules.HanselUserRn.putStringAttribute(key, value);

//For boolean attribute
NativeModules.HanselUserRn.putBooleanAttribute(key, value);

Step 8: Setting up Test Device

Once you have successfully integrated the SDK, ensure that you set up test devices. To learn more, click here .

Step 9: Firing events from test devices

Ensure that you fire the events which you added in step 5, from a test device. This can be done by invoking all the flows within the app, where the events have been added. To learn more on setting up test device, please click here .

Step 10: Advanced Features

Defining Actions
Product Experience SDK can also invoke a method in the registered listener whenever an action has been triggered for a given nudge. You can add additional logic in this method to perform any relevant tasks related to the action.

To implement this, follow the steps given here.

Updated 13 days ago

Product Experience

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.