Indicative Object API

Indicative Object API

Method Call and Parameters Description
Indicative.initialize(apiKey);

apiKey: String
Initializes the Indicative object to be ready for use. Must contain your project's unique apiKey.
Indicative.getProperties();

no parameters
Returns an object of the stateful properties.
Indicative.addProperties(obj);

obj: Obj | Array
Adds a list or object of properties to the object of stateful properties. Can be an object or an array, see docs for further info.
Indicative.addProperty(name,value);

name: String
value: String | Number | Boolean
Add a single property to the object of stateful properties. Must include a String name and String, Number, or Boolean value.
Indicative.removeProperty(name);

name: String
Removes a single property from the stateful properties object.
Indicative.clearProperties();

no parameters
Clears all stateful properties.
Indicative.setUniqueID(id);

id: String
Sets a stateful uniqueID to be used for all events built without a uniqueID.
Indictive.clearUniqueID();

no parameters
Clears the stateful uniqueID.
Indicative.buildEvent(eventName);

eventName: String
Records an event with the given eventName, using the unique ID stored as a cookie (Random UUID if not set manually using Indicative.setUniqueId(id)). Refer to building an event above for more information.
Indicative.buildEvent(eventName, id);

eventName: String
id: String
Records an event with the given eventName and unique id. It will only set this event's unique id. Refer to building an event above for more information.
Indicative.buildEvent(eventName, id, propmap);

eventName: String
id: String
propmap: Obj | Array
Records an event with the given eventName, unique id, and property map. The property map can be an object or array and will only be used for this event. Refer to building an event above for formatting guidelines.
Indicative.buildEvent(eventName, propmap);

eventName: String
propmap: Obj | Array
Records an event with the given eventName and property map. The property map can be an object or array and will only be used for this event. Refer to building an event above for more information.
Indicative.buildEvent(eventName, callback);

eventName: String
callback: Func
Records an event with the given eventName and callback function. It will use the default unique id. The callback function will be called after successful or unsuccessful POST. Refer to building an event above for more information.
Indicative.buildEvent(eventName, id, callback);

eventName: String
id: String
callback: Func
Records an event with the given eventName, unique id, and callback function. It will record this event's unique id. The callback function will be called after successful or unsuccessful POST. Refer to building an event above for more information.
Indicative.buildEvent(eventName, id, propmap, callback);

eventName: String
id: String
propmap: Obj | Array
callback: Func
Records an event with the given eventName, unique id, property map, and callback function. The property map can be an object or array and will only be used for this event. The callback function will be called after successful or unsuccessful POST. Refer to building an event above for more information.
Indicative.buildEvent(eventName, propmap, callback);

eventName: String
propmap: Obj | Array
callback: Func
Records an event with the given eventName, property map, and callback function. The property map can be an object or array and will only be used for this event. The callback function will be called after successful or unsuccessful POST. Refer to building an event above for more information.
Indicative.setUniqueID(id,true);

id: String
This will automatically call Indicative.sendAlias() after setting the new unique ID. If you just call Indicative.setUniqueID(id) without 'true', it will not send the alias call.
Indicative.sendAlias();

no parameters
The Indicative client automatically generates a default unique ID (a UUID) to use on all events until Indicative.setUniqueID(id) is called. At that point, Indicative.sendAlias() can be called to alias the UUID to the 'id' parameter set within Indicative.setUniqueID(id).
0 users found this helpful