Send Optimizely Data Platform data using Advanced Audience Targeting
This topic describes the sendOdpEvent method, which sends Optimizely Feature Experimentation event data to the Optimizely Data Platform (ODP) server.
Note
Advanced Audience Targeting and sending ODP data through
sendOdpEvent
are currently beta. Contact your Customer Success Manager for more information or register now on Optimizely.com.
Prerequisites
You must enable the Optimizely Data Platform (ODP) Advanced Audience Targeting integration before sending events to ODP from Feature Experimentation.
JavaScript (Node) SDK Version
5.0.0-beta
Description
The Optimizely Client extension method sendOdpEvent
lets you send data to the ODP server. You can then use this data to analyze user behavior and optimize experiences across different channels and touchpoints.
Use the sendOdpEvent
method to
- merge or stitch users together and determine which event is associated with which customer.
- send various types of events and actions, such as pageviews, clicks, form submissions, and others. You can include additional data to provide more context and information about the event being tracked.
For example, by connecting an email address identifier with a fs_user_id
identifier, you can use the sendOdpEvent
method to send events that are associated with both identifiers. This enables you to track and analyze the behavior of a specific user across different touchpoints and devices.
You cannot create or update user profile data like name or address with sendOdpEvent
. Instead, you can use the ODP API or ODP UI to manage customer profiles.
Sending events to Optimizely Data Platform
The JavaScript (Node) SDK discards the event immediately if there are any errors(sdkNotReady
, odpNotIntegrated
, or odpNotEnabled
).
Parameters
This table lists the required and optional parameters for the sendOdpEvent
method.
Parameter | Type | Description |
---|---|---|
action required | String | Specifies the subcategory of the event type, which will be used to track the app and user lifecycle. |
type | String | The type of event to be sent. Will be "fullstack" for all JavaScript (Node) SDK-generated events if not specified. |
identifiers | Map<string, string> | A key-value map of user identifiers. At least one key-value pair is required. |
data | Map<string, unknown> | The event data in a key-value map. The value can be any type (string, number, or boolean.) Null values are allowed but will be interpreted as empty strings. The JavaScript (Node) SDK will add default event data to the given data dictionary. The default data values can be overwritten by sending the same key when creating your dictionary.
|
Returns
This method sends event data to Optimizely Data Platform (ODP). It does not provide return values.
Example
Method signature for sendOdpEvent
:
sendOdpEvent(action: string, type?: string, identifiers?: Map<string, string>, data?: Map<string, unknown>): void;
const identifiers = new Map([["fs_user_id", "user123"], ["email", "[email protected]"]]);
try {
optimizelyInstance.sendOdpEvent("purchased","fullstack", identifiers, data);
} catch (error) {
// handle error here
}
Source files
The language/platform source files containing the implementation for JavaScript (Node) are available on GitHub.
Updated 3 days ago