Object API

Method Call and Parameters Description
Indicative.initialize(apiKey); Initializes the Analytics object to be ready for use. Must contain your project’s unique apiKey.
apiKey: String
Indicative.getProperties(); Returns an object of the stateful properties.
no parameters
Indicative.addProperties(obj); 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.
obj: Obj \| Array
Indicative.addProperty(name, value); Add a single property to the object of stateful properties. Must include a String name and String, Number, or Boolean value.
name: String
value: String \| Number \| Boolean
Indicative.removeProperty(name); Removes a single property from the stateful properties object.
name: String
Indicative.clearProperties(); Clears all stateful properties.
no parameters
Indicative.setUniqueID(id); Sets a stateful uniqueID to be used for all events built without a uniqueID.
id: String
Indicative.clearUniqueID(id); Clears the stateful uniqueID. If you set id=true it will also clear the automatically generated anonymous ID
id: Boolean
Indicative.buildEvent(eventName); 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.
eventName: String
Indicative.buildEvent(eventName, id); 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.
eventName: String
id: String
Indicative.buildEvent(eventName, id, propmap); 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.
eventName: String
id: String
propmap: Obj \| Array
Indicative.buildEvent(eventName, propmap); 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.
eventName: String
propmap: Obj \| Array
Indicative.buildEvent(eventName, callback); 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.
eventName: String
callback: Func
Indicative.buildEvent(eventName, id, callback); 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.
eventName: String
id: String
callback: Func
Indicative.buildEvent(eventName, id, propmap, callback); 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.
eventName: String
id: String
propmap: Obj \| Array
callback: Func
Indicative.buildEvent(eventName, propmap, callback); 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.
eventName: String
propmap: Obj \| Array
callback: Func
Indicative.setUniqueID(id, true); 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.
id: String
Indicative.sendAlias(); 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).
no parameters

Was this page helpful?