Migrating from Optimizely Classic
We’re excited to release the v2 REST API, providing read-and-write access to your Optimizely X data and read-only access to your Classic Optimizely data. This version of our REST API has been completely re-built from the ground up. This API has been written to support the new data models in Optimizely X causing the endpoints to vary from v1. We have also incorporated many new features requested by developers like pagination, enhanced error handling and improved input validation. This guide will walk you through the key differences between versions.
First, we’ve added the Campaign model, which is a collection of Experiments that share the same objective. Campaigns should now be leveraged when creating a personalization campaign that shares the same focus. With this addition, Projects will now consist of Experiments and/or Campaigns.
In v2, variations are a property of experiments. Variations cannot be queried outside of the experiment context, so there is no /variations endpoint like there was in the v1 API. We have also introduced the concept of a Page which controls where experiments can run. Previously, this was defined in url_conditions in an experiment.
The notion of Goals has transformed into Metrics and Events. Events most closely resemble goals, as they are specific actions you can track. For example, an Event could be button clicks within a page, or page views. Metrics define how to add up the data we receive from Events. Audiences remain the same between versions.
- Read about the new Optimizely X data model concepts
- Read about authentication with Personal Tokens and OAuth 2.0
- Familiarize yourself with our v2 documentation and how it maps to v1 REST API.
- Make your first request. Check out our getting started guide
- Update your application to use v2 routes and handle v2 errors.
Mapping v1 to v2
|Optimizely X||Optimizely Classic|
|Campaigns||New in Optimizely X|
New in Optimizely X.
Previously lived in edit_url & urls_condtions in the Experiment object.
|Experiment Results||Experiment Results|
|Campaign Results||New in Optimizely X|