Rich-text Reply

Is it possible to get a list of all experiment API names that are not currently running?

swest 04-03-19

Is it possible to get a list of all experiment API names that are not currently running?

[ Edited ]

We use adobe analytics implementation which adds (ExperimentID) : (VariationID) to a prop. I want to be able to quickly get this information without manually copying the IDs. Is there an API I can call for experiments that are not currently running?

Level 2

0 Likes
0 Likes
optijon 04-04-19
 

Re: Is it possible to get a list of all experiment API names that are not currently running?

Hey @swest, can you elaborate on what you're looking to do? Is this part of your process for analyzing your data in Adobe Analytics?

Level 1
0 Likes
0 Likes
smcurrey528 04-08-19
 

Re: Is it possible to get a list of all experiment API names that are not currently running?

You could possibly use:

var state = window["optimizely"].get("state");

state.getExperimentStates(function(experimentState) {
return !experimentState.isActive;
});

https://developers.optimizely.com/x/solutions/javascript/reference/index.html#function_getexperiment...
0 Likes
0 Likes
JasonDahlin 04-10-19
 

Re: Is it possible to get a list of all experiment API names that are not currently running?

Presuming you are looking in your browser's console and not through an API call.  Here are the building blocks for what I use on a page I write that lets our Operation team see a list of active experiments, the pages, and the audiences used for each:

 

1- This gets you a list of experiments that pass URL Targeting. They may or may not be running on the current page:

var state = window["optimizely"].get("state");
state.getExperimentStates;

2- This gets you a list of experiments that are running on the current page (they pass URL Targeting and also pass Audience Conditions)

var state = window["optimizely"].get("state");
state.getExperimentStates(function(experimentState) {
  return experimentState.isActive;
});

3- This gets you a list of experiments that are not running on the current page because they fail Audience Targeting (but they do pass URL Targeting):

var state = window["optimizely"].get("state");
state.getExperimentStates(function(experimentState) {
  return experimentState.isActive;
});

4- This gets you a list of all experiments that are Running anywhere in your project (Paused and Draft are not included)

optimizely.get('data').experiments

If you want to know a list of all experiments that are running that are not running on the current page, you would build a list from #4 and then remove the items from #2.

 

Pretty sure they removed being able to include Draft and Paused experiments in the snippet, but maybe I'm just missing where they moved it to. With it not being included, you would need to use an API call to get information about those experiments.

--Jason Dahlin
Analytics and Testing Guru Smiley Happy


Experimentation Hero
0 Likes
0 Likes