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
- Go to optimizely.com and click Get Started or sign in.
- If you are new to Optimizely, sign up for a Feature Experimentation plan.
- Complete the onboarding wizard.
Step 2: Create a Feature Experimentation Project
- In the Optimizely dashboard, go to Settings > Projects.
- Click Create New Project.
- Select Feature Experimentation as the project type.
- Enter a project name (e.g. “My Website - Production”).
- Click Create Project.
- 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
- Go to Settings > Account.
- Your Account ID is displayed on the account settings page.
- Copy this value.
Step 4: Find Your SDK Key
- Go to Settings > Environments within your project.
- Each environment (Production, Staging, Development) has its own SDK Key.
- 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
- On the Settings > Environments page, locate the Datafile URL for your chosen environment.
- The URL follows the format:
https://cdn.optimizely.com/datafiles/{sdk_key}.json - 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
- In your Optimizely project, go to Events.
- Click Create New Event.
- Enter an event key that matches the event names you will track in Datafly Signal (e.g.
purchase,signup,add_to_cart). - 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/eventsConversion events are sent as JSON payloads to the Optimizely Event API. The payload includes the account ID, project ID, and visitor information.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | Your Optimizely account ID. Found in Settings > Account. |
project_id | string | Yes | The Optimizely project ID. Found in Settings > Projects or in the project URL. |
sdk_key | secret | Yes | The SDK key for your Optimizely environment. Found in Settings > Environments. Use the production key for live traffic. |
datafile_url | string | Yes | URL to the Optimizely datafile for your environment. Found in Settings > Environments (format: https://cdn.optimizely.com/datafiles/{sdk_key}.json). |
Management UI Setup
- Go to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Optimizely or filter by Analytics.
- 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.
- 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 Event | Optimizely Event Key | Notes |
|---|---|---|
Order Completed | purchase | Revenue and item count sent as event tags |
Product Added | add_to_cart | Product details as event tags |
Checkout Started | begin_checkout | Cart value as revenue tag |
Form Submitted | form_submit | Form details as event tags |
| Custom events | Matched 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 Property | Optimizely Event Tag | Description |
|---|---|---|
total or revenue | revenue | Total value in cents (Optimizely expects revenue in the lowest currency unit) |
currency | currency | ISO 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:
- In the Optimizely dashboard, go to your experiment and click the Results tab.
- Check that conversion counts are incrementing for the metrics you configured.
- Use the Event Inspector (under Events) to see raw event data arriving.
- Verify that visitor counts match expectations — each unique visitor should be counted once per experiment.
- 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
| Symptom | Cause | Fix |
|---|---|---|
| No conversions in experiment results | Event key mismatch | Verify that the event key in Datafly Signal matches the event key in Optimizely exactly (case-sensitive) |
| Events sent but not attributed to experiment | Visitor not bucketed | Visitors must be activated in an experiment before their conversions count — ensure experiment activation events are sent |
400 bad request | Incorrect account or project ID | Verify the account ID and project ID match your Optimizely dashboard settings |
| Revenue not tracked | Revenue not in cents | Verify that revenue values are being converted to cents (lowest currency unit) |
| Stale experiment configuration | Outdated datafile | Check that the datafile_url is accessible and Signal is fetching updated versions periodically |
403 forbidden | Invalid SDK key | Regenerate the SDK key in Settings > Environments or verify you are using the correct environment key |
| Visitor count higher than expected | Anonymous ID changes | Ensure 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.