Rich-text Reply

how to find how many experiments are running on a page?

chedick 04-06-17

how to find how many experiments are running on a page?

I would like to be able to see how many (and their experiment IDs) are running on a given page. Is there a way to do that?

 

For example: let's say there's a page called abc.com/example. How can I get a list of the experiments currently running on that page by experiment ID or experiment name? 

Level 1

JasonDahlin 04-06-17
 

Re: how to find how many experiments are running on a page?

It's all in he optimizely object. (optimizely.activeExperiments to get the experiments on the page and the other nodes to get the IDs for the variation and then the names of everything)

 

Here is a bookmarklet I wrote for Classic that alerts the name and variation of any experiments running on the current page.

javascript:(function()%7Bvar%20pgExp%20%3D%20%22%22%3Btry%7B%24(optimizely.activeExperiments).each(function(i%2Cd)%7Bvar%20experiment%20%3D%20optimizely.allExperiments%5Bd%5D.name%3Bvar%20variation%20%3D%20optimizely.variationNamesMap%5Bd%5D%3BpgExp%20%2B%3D%20experiment%20%2B%20'%20-%20'%20%2B%20variation%20%2B%20'%5Cn'%20%3B%7D)%3B%7Dcatch(e)%7B%3B%7Dalert(pgExp)%7D)()
--Jason Dahlin
Analytics and Testing Guru Smiley Happy


Experimentation Hero