If this error persists, please let us know at our support page.
Our engineering team has been notified.
Be brave, experiment everywhere, and transform your customer experiences with Optimizely X.
Enable everyone in your organization to improve every experience, whether your marketing team is seeking to understand the best way to apply advertising dollars or your product team is learning how to build the most engaging product onboarding experience.
Learn MoreDeliver targeted content and experiences in real time. Bring together what you know about your customers and your most successful experiments to deliver personalized customer experiences with measurable improvements to your bottom line.
Learn MoreAutomatically add product, category, and content recommendations to any website. Leverage machine learning to continuously improve your recommendations to deliver hands-off ROI. Experiment on algorithms, placement, and presentation to understand the best way to engage your customers.
Talk to Us
import optimizely
optimizely = optimizely.Optimizely(datafile)
# Activate an experiment
variation = optimizely.activate('my_experiment', 'user_123')
if variation == 'variation_a':
# Execute code for variation A
elif variation == 'variation_b':
# Execute code for variation B
else:
# Execute default code
# Track an event
optimizely.track('purchase_completed', 'user_123')
import com.optimizely.ab.Optimizely;
Optimizely optimizely = Optimizely.builder(datafile).build();
// Activate an experiment
Variation variation = optimizely.activate("my_experiment", "user_123");
if (variation != null) {
if (variation.is("variation_a")) {
// Execute code for variation A
} else if (variation.is("variation_b")) {
// Execute code for variation B
}
} else {
// Execute default code
}
// Track an event
optimizely.track("purchase_completed", "user_123");
require "optimizely"
project = Optimizely::Project.new(datafile)
# Activate an experiment
variation = project.activate('my_experiment', 'user_123')
if variation == 'variation_a'
# Execute code for variation A
elsif variation == 'variation_b'
# Execute code for variation B
else
# Execute default code
end
# Track an event
project.track('purchase_completed', 'user_123')
var optimizely = require('optimizely-server-sdk');
var optimizely = optimizely.createInstance({ datafile: datafile });
// Activate an experiment
var variation = optimizely.activate('my_experiment', 'user_123');
if (variation === 'variation_a') {
// Execute code for variation A
} else if (variation === 'variation_b') {
// Execute code for variation B
} else {
// Execute default code
}
// Track an event
optimizely.track('purchase_completed', 'user_123');
#import <OptimizelySDKiOS/OptimizelySDKiOS.h>
OPTLYManager *manager = [OPTLYManager init:^(OPTLYManagerBuilder * _Nullable builder) {
builder.projectId = @"projectId";
}];
// Asynchronously initialize the Optimizely client
[manager initializeWithCallback:^(NSError * _Nullable error, OPTLYClient * _Nullable client) {
// Activate an experiment
OPTLYVariation *variation = [client activate:@"my_experiment" userId:@"user_123"];
if ([variation.variationKey isEqualToString:@"variation_a"]) {
// Execute code for variation A
}
else if ([variation.variationKey isEqualToString:@"variation_b"]) {
// Execute code for variation B
}
else {
// Execute default code
}
// Track an event
[client track:@"purchase_completed" userId:@"user_123"];
}];
import OptimizelySDKiOS
let optimizelyManager = OPTLYManager.init {(builder) in
builder!.projectId = "projectId"
}
// Asynchronously initialize the Optimizely Client
manager?.initialize(callback: { [weak self] (error, client) in
// Activate an experiment
let variation = client?.activate("my_experiment", userId: "user_123")
if (variation?.variationKey == "variation_a") {
// Execute code for variation A
}
else if (variation?.variationKey == "variation_b") {
// Execute code for variation B
}
else {
// Execute default code
}
// Track an Event
client?.track("purchase_completed", userId: "user_123")
})
import com.optimizely.ab.android.sdk.OptimizelyClient;
OptimizelyClient optimizelyClient = optimizelyManager.getOptimizely();
// Activate an experiment
Variation variation = optimizelyClient.activate("my_experiment", "user_123");
if (variation != null) {
if (variation.is("variation_a")) {
// Execute code for variation A
} else if (variation.is("variation_b")) {
// Execute code for variation B
}
} else {
// Execute default code
}
// Track an event
optimizelyClient.track("purchase_completed", "user_123");
use Optimizely\Optimizely;
// Initialize an Optimizely client
$optimizelyClient = new Optimizely($datafile);
// Activate an experiment
$variation = $optimizelyClient->activate('my_experiment', 'user_123');
if ($variation == 'variation_a') {
// Execute code for variation A
} elseif ($variation == 'variation_b') {
// Execute code for variation B
} else {
// Execute default code
}
// Track an event
$optimizelyClient->track('purchase_completed', 'user_123');
using OptimizelySDK;
// Initialize an Optimizely client
Optimizely OptimizelyClient = new Optimizely(datafile);
// Activate user in an experiment
var variation = OptimizelyClient.Activate("my_experiment", userId);
if (variation != null)
{
if (variation == "control")
{
// Execute code for variation A
}
else if (variation == "treatment")
{
// Execute code for variation B
}
}
else
{
// Execute default code
}
// Track conversion event
OptimizelyClient.Track("my_conversion", userId);
Engage customers where they are, regardless of device, by running experiments on apps built on iOS and Android. Instantly roll out new features without waiting for App Store or Google Play review.
Deliver great over-the-top TV experiences by running experiments in any application built for tvOS or Android, such as navigation, app layout, site design, featured content or integrated message testing.
We're here to help. Optimizely Customer Success has worked to support thousands of teams. Learn how we can partner with you to add capacity and expert resources to accelerate the success of your experimentation program.
Learn MoreIf Atlassian couldn't experiment on our user's journey, we would lose a major lever in making our customers more successful with our products.– Cameron Deatsch, VP of Growth, Atlassian
Try Optimizely free for 30 days
You can get the very best of Optimizely without spending a dime.
Try it out for 30 days, on us.
Something went wrong
If this error persists, please let us know at our support page.
Our engineering team has been notified.
Contact Sales
Please tell us about yourself and your company (all fields required):
Thank you
Create a developer account
Get a free account with full access to Optimizely's APIs and SDKs.