Rich-text Reply

Where do i paste the manual activation javascript API?

Loui 12-01-16

Where do i paste the manual activation javascript API?

I'm looking to try and run my test through manual activation because there's a few ajax calls on the site.

But where do I paste the activation code? Is it in the "Experiment javascript" tab in the editor, or is the code suppose to be placed on the sites code? And where to place the code exactly?

 

And do I keep the original optimizely script if so?

 

These two codes: 

 

window.optimizely.push(["activate", 7886120858]);

 

 

//ajaxComplete:
$(document).ajaxComplete(function() {
window.optimizely.push(["activate", 7886120858]);
});

Level 2

CouchPsycho 12-01-16
 

Re: Where do i paste the manual activation javascript API?

Well,

it depends. You may add it to your ajax-scripting on your website, which means "outside" optimizely. Your ajaxComplete-function may probably fire to often, so be careful.

I usually add custom events to any ajax-function on the website, so i can add event-listeners within my variation or experiment-code, which trigger the execution of the variations.

As far as i know you can not "activate" an experiment from within an experiment which has not been activated.

It is a chicken-and-egg problem :-)

Kind regards

Michael



"the essence of the creative act is to see the familiar as strange." (anonymous)