Dev guideAPI Reference
Dev guideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Send Optimizely Data Platform data using Advanced Audience Targeting

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

Prerequisites

You must set up Advanced Audience Targeting before sending events to ODP from Feature Experimentation.

πŸ‘

Beta

Advanced Audience Targeting is currently in beta. Contact your Customer Success Manager for information or register now on Optimizely.com.

Minimum SDK version

v2.0.0 or higher

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 lets you 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 Create and update customers API endpoint or ODP UI to manage customer profiles.

Send events to Optimizely Data Platform

The Flutter SDK discards the event immediately if there are any errors (sdkNotReady, odpNotIntegrated, or odpNotEnabled).

Parameters

sendODPEvent method parameters.

ParameterTypeDescription
typeStringThe type of event to be sent, which is "fullstack" for all Android SDK-generated events if not specified.
action
required
StringSpecifies the subcategory of the event type, which is used to track the app and user lifecycle.
identifiersMap<String, String>A key-value map of user identifiers.
dataMap<String, dynamic>The event data in a key-value map. The value can be any type (string, number, or Boolean.) Null values are allowed, but are interpreted as empty strings.

The Android SDK adds default event data to the given data dictionary. You can overwrite the default data values by sending the same key when creating your Map.

  • "idempotence_id" – <UUID created by the Flutter SDK>

  • "data_source_type" – "sdk"

  • "data_source" – "flutter-sdk"

  • "data_source_version" – <Flutter SDK version implemented>

Returns

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

Example

Map<String, String> identifiers = { 
   "fs_user_id": "user123", 
   "email": "[email protected]" 
}; 
Map<String, dynamic> data = {"item": "shirt", "price": 50.00}; 
await flutterSDK.sendOdpEvent("purchased", type: "fullstack", identifiers: identifiers, data: data); 

The following diagram shows the network calls between your application, the Flutter SDK, and the ODP server when calling the sendODPEvent method:

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

Source files

The language and platform source files containing the implementation for the Flutter SDK are available on GitHub.