iOS Set User Param Methods

In this topic:

Introduction

The User Parameters feature allows you to store data at a visitor level, and add that data into all of your collected events. Typically data collected by Oracle Infinity only contains event attributes that were either passed in on the collected event, or augmented onto the event as part of post collection processing (like Geodata and Device data). Since the User Parameter data is associated at a visitor level (not event), this means you can now store any arbitrary visitor information across devices and sessions, and then use that data in addition to the data points that are directly collected on an event to trigger and filter Actions.

To populate your user parameter datastore, you will need to modify data ingestion methods to pass the specific data you want to store with a "user" prefix. For example, if I wanted to store a user's first name, I might modify my tag to pass that data on a login event as "user.first_name". As a result, a new "User" block appears in your event payloads containing the "first_name" parameter for all events sent by that visitor ID. In this example, you can see a User block with 3 parameters, one for "Customer_Tier", and one for "First_name" and "Last_name":

In Addition default param will be append with setUserParam event as well, The list of default parameters are available here.

The Data Collector Object

The primary interface for using the Core module is the ORADataCollector class. ORADataCollector provides a singleton object that may be used throughout your project. To instantiate the singleton object, call the [ORADataCollector sharedCollector] method. This method returns a pointer to the singleton. This instance may be assigned to a variable name or used inline.

Assign the ORADataCollector singleton to a variable

Assign the ORADataCollector singleton to a variable:
ORADataCollector *collector = [ORADataCollector sharedCollector];
let collector = ORADataCollector.shared()

Alternatively, the singleton may be referenced inline using the [ORADataCollector sharedCollector] method

Set User Parameter for key

The setUserParameter:forKey: method refers to parameters that are associated with a user, instead of an event, device or session. They can be leveraged for decisioning and payload augmentation. The key word user will be added to all the keys passed to this method and added to the event. This method returns true if the user params set successfully, false otherwise.

NSString *userKey = @"id";
				NSString *userValue = @"abc123";
				BOOL success = [collector setUserParameter:userValue forKey:userKey];
let userKey = "id"
				let userValue = "abc123"
				let success = collector!.setUserParameter(userValue, forKey: userKey)
  • key: Specifies key of the user parameter.
  • value: This argument is used to specify the value of the user parameter.
Infinity Parameter Value
1 data.page-uri /userParams
2 wt.ev userParams
3 wt.dl 61
4 user.id abc123
5 wt.sys userParams

Set User Parameters

The setUserParameters: method will set the user parameters. User Parameters refers to parameters that are associated with a user, instead of an event, device or session. They can be leveraged for decisioning and payload augmentation. The key word user will be added to all the keys passed to this method and added to the event. This method returns true if the user params set successfully, false otherwise.

NSDictionary *userParams = @{@"customer_tier": @"Platinum", @"first_name": @"John", @"last_name": @"Doe"};
				[collector setUserParameters:userParams];
let userParams = ["customer_tier": "Platinum","first_name": "John","last_name": "Doe"]
				collector!.setUserParameters(userParams)
  • parameters: This argument is used as dictionary with user parameter.

The Infinity parameters and their values specific to this event are as follows:

Infinity Parameter Value
1 data.page-uri /userParams
2 wt.ev userParams
3 wt.dl 61
4 user.customer_tier Platinum
5 user.first_name John
6 user.last_name Doe
7 wt.sys userParams

Learn more

Oracle CX Infinity Module