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 PropertyValue TypeDescription
actionStringName of the event. Used for segmentation, targeting, and reporting.
itemActionStringDefines 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.

PropertyValue TypeDescription
purposeStringThe purpose for the consent. For example, Personalization.
providerStringThe consent provider
statusStringThe 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.

PropertyValue TypeDescription
explanationsBooleanIf true, then return additional information in the response about why campaigns did or didn’t render. Requires authentication.
testMessagesStringA 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.

PropertyValue TypeDescription
noCampaignsBooleanIf true, don’t return campaigns in the response.
pageViewBooleanIf true, indicates that the event was triggered from a page load.
nonInteractiveBooleanIf 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.
doNotTrackBooleanIf 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.

PropertyValue TypeDescription
channelStringThe originating source of the event (For example, Web, MobileApp, CallCenter).
applicationStringThe originating application level source of the event (For example, ReactApp, 3rdParty, ReactNative)
pageTypeStringThe type of page from which you’re sending the event (For example, PDP, Blog, Pricing).
urlStringThe URL of the page from which you’re sending the event.
urlReferrerStringThe 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.
localeStringThe 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).
contentZonesstring[]An array of content zones on the current page.
configVersionNumberVersion number of the configuration for the SDK.
timeNumberThe 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.
userAgentStringThe user agent for the event. userAgent is populated automatically but can be overwritten if necessary
clientIpStringThe IP Address sending the event. clientIp is populated automatically but can be overwritten if necessary
operatingSystemStringOnly applicable for mobile events.
operatingSystemVersionStringOnly applicable for mobile events.
deviceStringOnly applicable for mobile events.
surveyIdStringThe ID of the survey being submitted. surveyId is populated automatically for events sent through the Survey Gear
surveyStartTimeStringThe 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.

PropertyValue TypeDescription
idStringThe ID of a known user.
encryptedIdStringThe 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.

PropertyValue TypeDescription
idStringThe 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.

PropertyValue TypeDescription
orderIdStringID of the purchased order.
currencyStringOptional currency code of purchase. Defaults to the dataset's configured currency if null.
totalValueNumberOptional total value for purchase. Defaults to the sum of line items quantity * price.
lineItemsLineItem[]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.

PropertyValue TypeDescription
singleLineLineItemUsed 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.
completeLineItem[]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.

PropertyValue TypeDescription
experienceIdStringThe experience ID of the campaign on which the given statistic is being tracked
stat"Impression" | "Click" | "Dismissal"The type of statistic being tracked.
controlBooleanIf 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.

PropertyValue TypeDescription
sdkLoadTimeNumber(Web SDK) Time, in milliseconds, for the network to load the web SDK.
pageLoadTimeNumber(Web SDK) Time, in milliseconds, for the DOM to load.
sdkParseTimeNumber(Web SDK) Time, in milliseconds, for the beacon to be parsed during page load.
networkTimeNumber(Web SDK) Time, in milliseconds, for the previous request to return.
sdkDnsTimeNumber(Web SDK) Time, in milliseconds, to perform resolution of SDK's CDN domain.
eventDnsTimeNumber(Web SDK) Time, in milliseconds, to resolve account-specific domain.
domLoadTimeNumber(Web SDK) Time, in milliseconds, for the DOM to finish loading.