Data Collection API

The Nuance Messaging SDK includes APIs to track visitor behavior in the native app. These APIs provide a way for enterprise applications to pass custom events regarding the user's behavior. The data passed in these APIs will be used to persist data in a server-side visitor profile. It can retain a single profile for a single customer across multiple devices.

The Data Collection API, in conjunction with the Server Side Visitor Profile API, maintains a local copy of the visitor profile throughout the life time of the application.

Data Collection API's are exposed from NuanceProfileManager class.

  1. Using NuanceProfileManager
  2. DataCollection Event
  3. Custom Variable
  4. Conversion Event
  5. Code Example
Public Properties

The following public methods are exposed from the NuanceProfileManager class.

Use the DataCollectionEvent convenience class to construct the attributes needed for an event. Pass the instance of this class to the sendCustomEvent API method

You should not directly instantiate DataCollectionEvent class. Instead use init method with a block parameter, which returns an instance of DataCollectionEvent class.

Public Methods

DataCollectionEventBuilder

Public Methods
Public Properties

CustomVariableBuilderBlock

Public Methods
Public Properties

ConversionEventBuilderBlock

Public Methods



            let customVariable = DCCustomVariable.init(block: { (builder) in
                builder?.addCustomVariable("test1", andValue: "true", andAction: CustomVariableAction_SET, andPersistenceState: CustomVariablePersistence_PERSISTENT);
                builder?.addCustomVariable("test2", andValue: "value3", andAction: CustomVariableAction_APPEND, andPersistenceState: CustomVariablePersistence_PERSISTENT);

                builder?.addCustomVariable("test3", andValue: "value4", andAction: CustomVariableAction_APPEND, andPersistenceState: CustomVariablePersistence_PERSISTENT);
            })

            let customEvent = DataCollectionEvent.init(block: { (builder) in
                builder?.addCustomEvent("email", andValue: "ppp@att.com", andType: CustomEventType_VISITOR, andAction: CustomEventAction_APPEND, andIsUnique: "yes")
                builder?.addCustomEvent("email", andValue: "ppp@att.com", andType: CustomEventType_VISITOR, andAction: CustomEventAction_REMOVE, andIsUnique: "yes")
                builder?.add(customVariable)
            });

           NuanceProfileManager.getInstance().sendCustomEvent(customEvent)