Optimizely is a personalization and experimentation platform that allows users to personalize messaging and run experiments on any part of their website.

Once integrated, FullStory can give you powerful insights into how users interact with your Optimizely tests as well as provide ideas on what new tests to run in Optimizely.

Follow the instructions below or see Getting Started with FullStory for more details on getting FullStory up and running. Once you’ve added the FullStory snippet to your site, follow the instructions in Step 2 to pass in experiment, campaign, and variations names and IDs. Be sure the FullStory snippet is placed above your Optimizely snippet.  

Step 1: Add FullStory snippet directly to your website

  1. Create a FullStory account at www.fullstory.com (note: be sure to click the link in the confirmation email you received after submitting your email).

  2. Once you’ve confirmed your email, login to your FullStory account, go to Settings > FullStory Setup, and copy your recording snippet.

  3. Paste your snippet into the <HEAD> element either via your Content Management System (CMS) or directly into your application’s code.

FullStory will now start recording sessions for your site visitors. Though we highly recommended adding FullStory directly to your website, it’s also possible to add the FullStory snippet via Optimizely. If you prefer to add the FullStory snippet via Optimizely, follow these steps:

  1. Create a FullStory account at www.fullstory.com/signup (note: be sure to click the link in the confirmation email you received after submitting your email).

  2. Once you’ve confirmed your email, login to your FullStory account, go to Settings, and copy your recording snippet.

  3. In your Optimizely dashboard, go to Settings > Javascript.

    Optimizely (5).png

  4. Paste in the FullStory snippet that you copied previously. NOTE: you do not need to copy the <script> tags at the beginning and end of the snippet.

Step 2: Passing in Experiment & Variation Name/ID  

When A/B or multivariate testing, Optimizely users often want to compare how people interact with the different variations of their pages. By passing custom variables from Optimizely to FullStory, it’s possible to see and compare user sessions by things like experiment name, variant name.

If you’ve added FullStory to your site, you can pass in Experiment Name/ID and Variation Name/ID by following the simple steps below:

  1. Before adding FullStory to Optimizely, reach out to your Optimizely account contact to request they whitelist the feature ‘Custom Analytics’. Right now, Custom Analytics is in beta and needs to be turned on for your account.

  2. In your Optimizely X account, go to Settings and uncheck “Mask descriptive names in project code and third-party integrations” (found under Privacy Settings).

  3. In Settings, select Integrations, and click on the Create Analytics Integration button.

  4. Select Using Visual Editor in the drop-down menu.

  5. Name the integration (e.g. “FullStory IDs”), select Create Custom Analytics Integration, and paste and save the code below (thanks, David!):
    (function () {
      utils = window.optimizely.get('utils');
      utils.waitUntil(function () {
        return typeof window.FS == "function";
      }).then(function () {
        var campaignStates = window.optimizely.get('state').getCampaignStates({ "isActive": true });
        var experiments = [];
        var variations = [];
        var campaigns = [];
        for (var campaignId in campaignStates) {
          var c = campaignStates[campaignId];
          if (c.isInCampaignHoldback !== true) {
            if (c.id && c.campaignName) { 
              campaigns.push(c.campaignName + " (" + c.id + ")"); 
            if (c.experiment && c.experiment.id && c.experiment.name) { 
              experiments.push(c.experiment.name + " (" + c.experiment.id + ")"); 
            if (c.variation && c.variation.id && c.variation.name) { 
              variations.push(c.variation.name + " (" + c.variation.id + ")"); 
        if (campaigns.length > 0) {
            "campaign_str": campaigns.join(", "), 
            "experiment_str": experiments.join(", "), 
            "variation_str": variations.join(", ") 
  6. Go to Experiments, click the name of your experiment, select Integrations in the left sidebar, and check the “tracked” checkbox for the FullStory integration that you just created. Repeat this step in each experiment where you want the integration to run.  

You will now be able to search by experiment and variation name and IDs in FullStory—just search for “experiment”, “campaign”, or “variation” and the values for those fields in FullStory. 

You can find experiment and variations IDs in Optimizely by navigating to Experiment > API Names.

Passing in Additional Data (Optional)

If you’re interested in passing in custom variables other than experiment and variable names, you can learn how to easily do so here; if you’d like to pass in usernames or emails for users that you’ve already identified, you can learn how to here. Once complete, simply add the script you’ve created to your pages by following the instructions you used to add the FullStory snippet (Step 1).

Can’t find what you’re looking for?

The FullStory team awaits your every question.

Contact Us