Rich-text Reply

Getting variation names in optimizely classic

GabrielStrauss 02-20-17
Accepted Solution

Getting variation names in optimizely classic

Hi,

I'd like to recover the variation names in Optimizely Classic. I've renamed two variations "Original" and "Variation1". Is there any way to recover which of these two variations is active from the console, based on their name? Alternatively, is there any way (from the Optimizely web app) to determine the id of each variation?

 

FWIW the code in https://community.optimizely.com/t5/Developers/Getting-experiment-name-and-variation-name-key-value-... did not seem to work, probably because I'm using Optimizely classic.

 

If this isn't something that's possible in classic, I can upgrade to X, although I'd rather not have to yet.

 

Thank you,

Robert

RyanC 02-21-17
 

Re: Getting variation names in optimizely classic

For variation id, I usually refer to the URL in the browser. The last set of digits would be the variation id you are currently editing.
Ryan
------------------------------------------------
The best solution is the simplest.

https://www.linkedin.com/in/ryan-camilleri
http://midnightknights.com
Experimentation Hero

Re: Getting variation names in optimizely classic

Hi Ryan,
My apologies if this gets posted twice; the first did not seem to go through.
Thanks for your reply. Unfortunately, I don't see any variation IDs in any URLs. The URLs I'm looking at are of the form:
`https://app.optimizely.com/projects/Smiley TonguerojectId/experiments/:experimentId` for the tabular view
and
`https://app.optimizely.com/edit?experiment_id=:experimentId` for the editor view.

Should I be looking at a different page?
RyanC 02-21-17
 

Re: Getting variation names in optimizely classic

You are right, for a moment there I was referring to X. For classic the far right tab is referred to as Variation 0, next tab is 1, then 2 ...etc

So it most cases your original key value is 0 and variation key value is 1.
Ryan
------------------------------------------------
The best solution is the simplest.

https://www.linkedin.com/in/ryan-camilleri
http://midnightknights.com
Experimentation Hero

Re: Getting variation names in optimizely classic

Ryan,
`optimizely.data.variations` gives me an object with keys 8252271711 and 8246942749. They don't have codes and their names are "Var 8252271711" etc. How do I map these to the original and the variant?

Thank you so much for your help!

Re: Getting variation names in optimizely classic

Hi Ryan,

Looks like I needed to disable the setting `Mask descriptive names in project code and third-party integrations` in my project settings. Now, the variations have descriptive names.

 

Thank you for helping out!

-R

JasonDahlin 02-23-17
 

Re: Getting variation names in optimizely classic

In case this helps... here's a bookmarklet I made that gives an alert of the experiment names and varaitions 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