Event Options in the Evergage Namespace
The following code sample details the event options available in the Evergage namespace in the Personalization module of the Salesforce Interactions SDK.
| Event Property | Value Type | Description |
|---|---|---|
action | String | Name of the event. Used for segmentation, targeting, and reporting. |
itemAction | String | Defines the action taken on a catalog item. |
The Consent field accepts an array of consent objects for the user. The following table describes the various properties available in the consent object.
| Property | Value Type | Description |
|---|---|---|
purpose | String | The purpose for the consent. For example, Personalization. |
provider | String | The consent provider |
status | String | The consent status. For example, OptIn or OptOut |
The debug object contains fields that help investigate issues that could arise when developing campaigns.
The following table describes the various properties available in the debug object.
| Property | Value Type | Description |
|---|---|---|
explanations | Boolean | If true, then return additional information in the response about why campaigns did or didn’t render. Requires authentication. |
testMessages | String | A comma-separated list of campaign experience IDs to be forced to return in the event, ignoring rules that would otherwise prevent the campaign from returning. Alternatively, you can use the string value true to return all campaigns in testing mode but all rules are respected. |
The flags object contains properties that alter default event processing. By default, all flags are false if not present on the event.
The following table describes the various properties available in the flags object.
| Property | Value Type | Description |
|---|---|---|
noCampaigns | Boolean | If true, don’t return campaigns in the response. |
pageView | Boolean | If true, indicates that the event was triggered from a page load. |
nonInteractive | Boolean | If true, a visit isn’t created (or updated) for the given user in the event. Additionally, no visit referrer nor originating referrer is created for the user. |
doNotTrack | Boolean | If true, the event data is sent to the server but not processed. |
The source object contains properties that help describe where an event is coming from.
The following table describes the various properties available in the source object.
| Property | Value Type | Description |
|---|---|---|
channel | String | The originating source of the event (For example, Web, MobileApp, CallCenter). |
application | String | The originating application level source of the event (For example, ReactApp, 3rdParty, ReactNative) |
pageType | String | The type of page from which you’re sending the event (For example, PDP, Blog, Pricing). |
url | String | The URL of the page from which you’re sending the event. |
urlReferrer | String | The previous URL visited by the user. urlReferrer is populated from document.referrer by default on the web. It can be overwritten in the sitemap to any other value if necessary. |
locale | String | The locale of the current page, as defined by ISO 639 alpha-2 language codes and ISO 3166 alpha-2 country codes (For example, en_US, de_DE). |
contentZones | string[] | An array of content zones on the current page. |
configVersion | Number | Version number of the configuration for the SDK. |
time | Number | The date and time of the event, in milliseconds elapsed since the UNIX epoch. This field is optional and is auto-populated with the current time if null. |
userAgent | String | The user agent for the event. userAgent is populated automatically but can be overwritten if necessary |
clientIp | String | The IP Address sending the event. clientIp is populated automatically but can be overwritten if necessary |
operatingSystem | String | Only applicable for mobile events. |
operatingSystemVersion | String | Only applicable for mobile events. |
device | String | Only applicable for mobile events. |
surveyId | String | The ID of the survey being submitted. surveyId is populated automatically for events sent through the Survey Gear |
surveyStartTime | String | The start time of the survey being submitted. surveyStartTime is populated automatically for events sent through the Survey Gear |
The user object describes the user associated with an event.
The following table describes the various properties available in the user object.
| Property | Value Type | Description |
|---|---|---|
id | String | The ID of a known user. |
encryptedId | String | The encrypted ID returned from an event that contains the ID field. Encrypted IDs are returned in the response to events that provide a user.id. |
attributes | { [key: string]: string | number | boolean } | Key-value pairs that are stored as metadata on the user. These attributes must be defined in the platform. |
profileObjects | { [profileObjectType: string]: ProfileObject[] } | Key-value pairs of profile objects that are stored as metadata on the user. Profile objects, their attributes, and related catalog objects must be defined in the platform. |
The account object describes the account associated with an event.
The following table describes the various properties available in the account object.
| Property | Value Type | Description |
|---|---|---|
id | String | The ID of an account. |
attributes | { [key: string]: string | number | boolean } | Key-value pairs that are stored as metadata on the account. These attributes must be defined in the platform. |
The catalog object describes item data associated with the given itemAction and is used for actions pertaining to items in the catalog. For instance, the following catalog object provides the item being viewed when sending the item action "View Item".
You can use the location object to send location data on a catalog object via the Event API or using the Sitemap. The following is an example of how you to structure a catalog object to include location data.
The following examples depict sending data for locations outside the US.
The order object describes order data associated with the given itemAction and is used for Purchase actions.
The order object has the following structure.
The following table describes the properties that an order object accepts.
| Property | Value Type | Description |
|---|---|---|
orderId | String | ID of the purchased order. |
currency | String | Optional currency code of purchase. Defaults to the dataset's configured currency if null. |
totalValue | Number | Optional total value for purchase. Defaults to the sum of line items quantity * price. |
lineItems | LineItem[] | List of purchased line items. |
A LineItem represents a single item in a cart and/or transaction. A LineItem object has the following structure.
The cart object describes cart data associated with the given itemAction and has the following structure.
The following table describes the properties a cart object accepts.
| Property | Value Type | Description |
|---|---|---|
singleLine | LineItem | Used for Add To Cart and Update Line Item actions. Add To Cart adds the quantity to any existing matching items. Update Line Item overwrites the quantity of any existing matching items. |
complete | LineItem[] | Used to update the state of the cart in Personalization, setting its content to the provided line items. Previous cart contents are replaced. |
Additionally, a user's cart can be emptied by sending an event with an empty array of LineItems.
For more information, refer to the LineItem documentation.
You can use the campaignStats object to track campaign statistics for an associated event.
For more information on sending campaign statistics on the web, refer to the Campaign Stats Tracking documentation.
The campaignStats object has the following structure.
The CampaignStat object has the following structure.
The following table describes the properties a CampaignStat object accepts.
| Property | Value Type | Description |
|---|---|---|
experienceId | String | The experience ID of the campaign on which the given statistic is being tracked |
stat | "Impression" | "Click" | "Dismissal" | The type of statistic being tracked. |
control | Boolean | If true, the statistic is tracked for the control group of the given experience. |
catalog | { <ItemType>: string[] } | A mapping of catalog item types to a list of corresponding item IDs on which to attribute the given statistic. |
The following is an example of a mapping of catalog item types.
The performance object has properties that measure loading, parsing, and network performance.
The following table describes the various properties available in the performance object.
| Property | Value Type | Description |
|---|---|---|
sdkLoadTime | Number | (Web SDK) Time, in milliseconds, for the network to load the web SDK. |
pageLoadTime | Number | (Web SDK) Time, in milliseconds, for the DOM to load. |
sdkParseTime | Number | (Web SDK) Time, in milliseconds, for the beacon to be parsed during page load. |
networkTime | Number | (Web SDK) Time, in milliseconds, for the previous request to return. |
sdkDnsTime | Number | (Web SDK) Time, in milliseconds, to perform resolution of SDK's CDN domain. |
eventDnsTime | Number | (Web SDK) Time, in milliseconds, to resolve account-specific domain. |
domLoadTime | Number | (Web SDK) Time, in milliseconds, for the DOM to finish loading. |