Dev guideAPI Reference
Dev guideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

Send Optimizely Data Platform data using Advanced Audience Targeting for the Python SDK

Describes the send_odp_event method, which sends Optimizely Feature Experimentation event data to the Optimizely Data Platform (ODP) server.

📘

Note

Sending data to Optimizely Data Platform (ODP) through the Advanced Audience Targeting send_odp_event method is in beta. Contact your Customer Success Manager for more information or register now on Optimizely.com.

Prerequisites

You must enable the Advanced Audience Targeting integration before sending events to ODP from Feature Experimentation.

Minimum SDK Version

5.0.0-beta

Description

The Optimizely Client extension method send_odp_event 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 send_odp_event 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 send_odp_event. Instead, you can use the ODP API or ODP UI to manage customer profiles.

Sending events to Optimizely Data Platform

📘

Notes

The Python SDK discards the event immediately if there are any errors.

Parameters

This table lists the required and optional parameters for the send_odp_event method.

ParameterTypeDescription
typestrThe type of event to be sent. Will be "fullstack" for all Python SDK-generated events if not specified.
action
required
strSpecifies the subcategory of the event type, which is used to track the app and user lifecycle.
identifiersdict[str,str]A key-value map of user identifiers. At least one key-value pair is required.
datadict[str,str|int| float|bool|None]The event data in a key-value map. The value can be the following types: str, int, float, bool or None).

The Python SDK adds default event data to the given data dictionary. Sending the same key when creating your HashMap overwrites the default data values.

  • "idempotence_id":<UUID created by the Python SDK>

  • "data_source_type":"sdk"

  • "data_source":"python-sdk"

  • "data_source_version":<Python SDK version implemented>

Returns

This method sends event data to the Optimizely Data Platform (ODP) server. It does not provide return values.

Example

identifiers = {
    "fs_user_id": "user123",
    "email": "[email protected]"
}
data = {
    "item": "shirt",
    "price": 50.00
}

optimizely.send_odp_event("purchased", identifiers, "fullstack", data)

The network calls between your application, the Python SDK, and the ODP server when calling the send_odp_event method is demonstrated below:

send_odp_event network diagram
  1. Your application calls the send_odp_event method.
  2. The Python SDK makes a POST request to ODP.
  3. ODP responds with acknowledgement or relevant error.

Source files

The language/platform source files containing the implementation for Python are available on GitHub.