Rich-text Reply

My snippet is not triggered onload onready at all

hubenet 12-28-16

My snippet is not triggered onload onready at all

The optimizely snippet (optimizely X) is in the HEAD of my document. I make simple test with window.onload = function(){console.log("Hello");} but it doesnt work. The snippet is in there and I can use the optimizely code in the browsers console, but the experiment and preview urls are not working like: ?optimizely_x123456789=1 oroptimizely_x=123456789. How can I make sure I have a working preview? I neeed to preview..

Level 2

RyanC 12-28-16
 

Re: My snippet is not triggered onload onready at all

I'll actually write the code "console.log("Hello");" on its own.

To make sure your code is running I would:
- create an audience which is limited to have a test cookie
- run the experiment on 100% traffic on the variation
- in your console type "optimizely.push("log") to see the details of the Optimizely snippet.
Ryan
------------------------------------------------
The best solution is the simplest.
Experimentation Hero
hubenet 12-28-16
 

Re: My snippet is not triggered onload onready at all

[ Edited ]

Hi Ryan, thanks for your response. In my snippit I see old javascript from an old version of the test that is not from the variation I am trying to preview. Does that mean anything?

Question: in optimizly classic I preview with optimizely_x123456789=1 in the url. With this new optimizely X how do I get that easy preview link working?

Level 2
RyanC 12-28-16
 

Re: My snippet is not triggered onload onready at all

Use the command "optimizely.revision" to make sure you are testing the latest version, because sometimes the changes are not immediately and may take 5mins or more.
Ryan
------------------------------------------------
The best solution is the simplest.
Experimentation Hero
hubenet 12-28-16
 

Re: My snippet is not triggered onload onready at all

Hi Ryan, apparently I have been editing a test in optimizly classic while it is a optimizely X test. Thank you for your time I have it working.
Level 2