Methods
(static) ping() → {void}
Pings the sdk which logs 'pong' in the console if reachable
Returns:
- Type
- void
setAttributes(attributes) → {void}
Set attributes object
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Object.<string, string> | Attributes object in the form key:value |
Returns:
- Type
- void
addAudience(audience) → {void}
Add audience to addedAudiences array
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
audience |
object | Audience Object Properties
|
Returns:
- Type
- void
addAudiences(audiences) → {void}
Add audiences to addedAudiences array
Parameters:
Name | Type | Description |
---|---|---|
audiences |
Array.<Object> | Audiences array with audience objects with the properties id and an optional affinityScore |
Returns:
- Type
- void
removeAudience(audience) → {void}
Add audience too removedAudiences array
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
audience |
object | Audience Object Properties
|
Returns:
- Type
- void
removeAudiences(audiences) → {void}
Add audiences to removedAudiences array
Parameters:
Name | Type | Description |
---|---|---|
audiences |
Array.<Object> | Audiences array with audience objects with the properties id and an optional affinityScore |
Returns:
- Type
- void
(async) sendData() → {void}
Send data to endpoint
Returns:
- Type
- void
(async) getAudiences(options) → {Object.<string, Array.<Audience>>}
Get audiences of current visitor
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options how to display audiences Properties
|
Returns:
Audiences of the current visitor divided in interests and properties
- Type
- Object.<string, Array.<Audience>>
(async, static) trackEvent(eventKey, eventValueopt, eventLabelopt) → {void}
Track a new event with a given event name
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eventKey |
string | Name of the event to track |
|
eventValue |
number |
<optional> |
Value of the event to track |
eventLabel |
string |
<optional> |
Label of the event to track |
Returns:
- Type
- void
(static) getVisitor() → {string}
Code duplicate of global js storage module getter
Returns:
encrypted visitor
- Type
- string