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 conjuction with the Server Side Visitor Profile API maintains a local copy of the visitor profile through out the life time of the application.

  1. ProfileManager
  2. Using CustomEventBuilder
  3. Using CustomVariableBuilder
  4. Using ConversionEventBuilder
Public Methods

The following public methods are exposed from the ProfileManager class.

SDK provides AttributeBuilder convenience class to construct the attributes of an event.

Public Methods

You can use the following builder public methods to construct the attributes comprising a custom event Object. Builder exposes its public method in such a way that you cannot invoke Builder instance build method until calling all of the required fields. You can add more than one attribute in the same event object.

CustomVariableBuilder convenience class provides a way to add custom variables associated with a particular event attribute.

SDK provides ConversionBuilder convenience class to construct conversion event object.

SDK provides ExposedEventBuilder convenience class to construct exposed event object.


	NuanMessaging.getInstance().getProfileManager().setUniqueCustomerId("email", "testssvp@att.com");


	NuanMessaging.getInstance().getProfileManager().startSession("10003715", "ssvp test app", ProfileManager.Interval.THIRTY_SECONDS, new OnSuccessListener() {
            @Override
            public void onResponse(ProfileResponse response) {


                System.out.println("Session created");

				NuanMessaging.getInstance().getProfileManager().sendCustomEvent("onAnyEvent",DCEvent.builder().addName("email").addValue("test1@gmail.cm").
	addType(CustomEvent.Type.VISITOR_ATTRIBUTE).addAction(CustomEvent.Action.APPEND).isUniqueCustomerID(CustomEvent.UniqueID.YES));


	NuanMessaging.getInstance().getProfileManager().sendCustomEvent("onPageLanding",DCEvent.builder().addName("phone").addValue("1234567").
	addType(CustomEvent.Type.APPLICATION_ATTRIBUTE).addAction(CustomEvent.Action.SET).addCustomVariable(CustomVariable.builder().addName("cust1").addValue("custval1").addAction(CustomVariable.Action.APPEND)));


	NuanMessaging.getInstance().getProfileManager().sendConversionEvent(ConversionEvent.builder().addProductName("samsung").addCount(2).addValue(100).addProductAttrs("test1","test2").addOrderId("1000")
                                   .addConversionAttrs("con1","con2").addOtherDCAttrs(DCEvent.builder().addName("test").addValue("val").addType(Event.Type.APPLICATION_ATTRIBUTE).addAction(Event.Action.APPEND)));


            }
        }, new OnErrorListener() {
            @Override
            public void onErrorResponse(Response response) {

            }
        });