Optimizely

Server-side event delivery to Optimizely for experiment tracking, feature flag analytics, and conversion goal measurement via the Event API.

Prerequisites

Before configuring Optimizely in Datafly Signal, you need an Optimizely account with a Feature Experimentation project and your SDK key and datafile URL.

Step 1: Create an Optimizely Account

  1. Go to optimizely.com and click Get Started or sign in.
  2. If you are new to Optimizely, sign up for a Feature Experimentation plan.
  3. Complete the onboarding wizard.

Step 2: Create a Feature Experimentation Project

  1. In the Optimizely dashboard, go to Settings > Projects.
  2. Click Create New Project.
  3. Select Feature Experimentation as the project type.
  4. Enter a project name (e.g. “My Website - Production”).
  5. Click Create Project.
  6. Note the Project ID from the project settings or URL.

Feature Experimentation (formerly Full Stack) is the server-side experimentation product. This is different from Optimizely Web (client-side). Ensure you are using the correct project type.

Step 3: Find Your Account ID

  1. Go to Settings > Account.
  2. Your Account ID is displayed on the account settings page.
  3. Copy this value.

Step 4: Find Your SDK Key

  1. Go to Settings > Environments within your project.
  2. Each environment (Production, Staging, Development) has its own SDK Key.
  3. Click to reveal and copy the SDK key for the environment you want to use.
⚠️

Use the Production SDK key for live traffic. The Development and Staging SDK keys point to different datafiles and may have different experiments and feature flags enabled.

Step 5: Get Your Datafile URL

  1. On the Settings > Environments page, locate the Datafile URL for your chosen environment.
  2. The URL follows the format: https://cdn.optimizely.com/datafiles/{sdk_key}.json
  3. Copy the full URL.

The datafile contains your project’s experiment and feature flag configuration. Datafly Signal periodically fetches this file to stay in sync with your Optimizely project.

Step 6: Create Events for Conversion Tracking

  1. In your Optimizely project, go to Events.
  2. Click Create New Event.
  3. Enter an event key that matches the event names you will track in Datafly Signal (e.g. purchase, signup, add_to_cart).
  4. Add the event as a metric to your experiments.

Optimizely events must be created in the dashboard before they can be tracked. Events sent with keys that do not match any configured event will be silently ignored.

API Endpoint

POST https://logx.optimizely.com/v1/events

Conversion events are sent as JSON payloads to the Optimizely Event API. The payload includes the account ID, project ID, and visitor information.

Configuration

FieldTypeRequiredDescription
account_idstringYesYour Optimizely account ID. Found in Settings > Account.
project_idstringYesThe Optimizely project ID. Found in Settings > Projects or in the project URL.
sdk_keysecretYesThe SDK key for your Optimizely environment. Found in Settings > Environments. Use the production key for live traffic.
datafile_urlstringYesURL to the Optimizely datafile for your environment. Found in Settings > Environments (format: https://cdn.optimizely.com/datafiles/{sdk_key}.json).

Management UI Setup

  1. Go to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Optimizely or filter by Analytics.
  4. Click Install and fill in the required fields:
    • Enter your Account ID from Step 3.
    • Enter your Project ID from Step 2.
    • Paste your SDK Key from Step 4.
    • Enter your Datafile URL from Step 5.
  5. Click Install Integration to create the integration with a ready-to-use default blueprint.

Management API Setup

curl -X POST http://localhost:8084/v1/admin/integration-catalog/optimizely/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Optimizely",
    "variant": "default",
    "config": {
      "account_id": "12345678",
      "project_id": "98765432",
      "sdk_key": "your_sdk_key",
      "datafile_url": "https://cdn.optimizely.com/datafiles/your_sdk_key.json"
    },
    "delivery_mode": "server_side"
  }'

Event Mapping

Datafly Signal maps events to Optimizely conversion events:

Datafly EventOptimizely Event KeyNotes
Order CompletedpurchaseRevenue and item count sent as event tags
Product Addedadd_to_cartProduct details as event tags
Checkout Startedbegin_checkoutCart value as revenue tag
Form Submittedform_submitForm details as event tags
Custom eventsMatched by event key_df.track("signup") maps to Optimizely event key signup

Event keys in Optimizely are case-sensitive and must match exactly. Ensure your Datafly event names (or the mapped keys in your blueprint) match the event keys configured in Optimizely.

Revenue Events

Optimizely tracks revenue as a special event tag. When Datafly Signal receives an Order Completed event:

Datafly PropertyOptimizely Event TagDescription
total or revenuerevenueTotal value in cents (Optimizely expects revenue in the lowest currency unit)
currencycurrencyISO 4217 currency code
_df.track("Order Completed", {
  order_id: "ORD-5521",
  total: 89.99,
  currency: "GBP"
});
⚠️

Optimizely expects revenue values in cents (or the lowest currency unit). Datafly Signal automatically converts decimal values (e.g. 89.99) to cents (e.g. 8999) before sending.

Testing

Once your integration is active and events are flowing, verify in Optimizely:

  1. In the Optimizely dashboard, go to your experiment and click the Results tab.
  2. Check that conversion counts are incrementing for the metrics you configured.
  3. Use the Event Inspector (under Events) to see raw event data arriving.
  4. Verify that visitor counts match expectations — each unique visitor should be counted once per experiment.
  5. In Datafly Signal, check the Delivery Logs for the Optimizely integration to verify successful API responses.

Optimizely results may take up to 10 minutes to update after events are received. The Event Inspector shows events in near real-time.

Troubleshooting

SymptomCauseFix
No conversions in experiment resultsEvent key mismatchVerify that the event key in Datafly Signal matches the event key in Optimizely exactly (case-sensitive)
Events sent but not attributed to experimentVisitor not bucketedVisitors must be activated in an experiment before their conversions count — ensure experiment activation events are sent
400 bad requestIncorrect account or project IDVerify the account ID and project ID match your Optimizely dashboard settings
Revenue not trackedRevenue not in centsVerify that revenue values are being converted to cents (lowest currency unit)
Stale experiment configurationOutdated datafileCheck that the datafile_url is accessible and Signal is fetching updated versions periodically
403 forbiddenInvalid SDK keyRegenerate the SDK key in Settings > Environments or verify you are using the correct environment key
Visitor count higher than expectedAnonymous ID changesEnsure consistent visitor identification — use _df.identify() to provide stable user IDs

Delivery

Events are delivered server-side from your Datafly Signal infrastructure directly to the Optimizely Event API. No client-side Optimizely scripts are loaded for this integration.

Visit the Optimizely Feature Experimentation documentation for full API reference and advanced configuration options.