Rich-text Reply

CTA doesnt trigger js in preview

tdOpti 07-28-15

CTA doesnt trigger js in preview

Hi there,

Im trying to set up a variation for A/B testing and the variation has 2 call to action buttons that should trigger a lightbox each. In preview mode, it doesnt trigger the lightbox, and im not sure if this is a Optimizely setting or not? If i test the CTA independantly outside of Optimizely by manually editing the DOM to show the CTA, it works. 

 

Is this something that i need to worry about? Is Optimizely suppressing the js from firing?

 

thank,

TD

Level 2

JMarchant 07-28-15
 

Re: CTA doesnt trigger js in preview

Hi TD,

 

Have you tried forcing the test to run on the site itself? To do this, add the following parameter to the URL of the page:

 

 

?optimizely_x[EXPERIMENT ID]=[VARIATION INDEX]

Where [EXPERIMENT ID] is the ID of the Experiment (this can be found in the URL of the editor window of your Experiment under the parameter “experiment_id”) and [VARIATION INDEX] with the index of you variation (0=Control, 1=Variation #1, etc.).

 

If the page comes up with an overlay saying that you can't do this, simply go Settings->Privacy within the Optimizely dashboard, and make sure that “Disable the force variation parameter” is unchecked.

 

I hope that helps.

 

James

 

James Marchant
Senior Developer at Conversion.com

 
tdOpti 07-28-15
 

Re: CTA doesnt trigger js in preview

Thanks for the tip James. I added the query string as you suggested as well as unchecked the "Disable the force variation parameter " option under Settings>Privacy, but am still getting the overlay preventing me from continuing.

Any ideas?
Level 2
tdOpti 07-28-15
 

Re: CTA doesnt trigger js in preview

This is what the overlay says "Force parameters are disabled for this project. See Project Code Settings."
Level 2
JMarchant 07-28-15
 

Re: CTA doesnt trigger js in preview

Did you make sure after unchecking the "Disable the force variation parameter" to hit the save button?
James Marchant
Senior Developer at Conversion.com

 
tdOpti 07-28-15
 

Re: CTA doesnt trigger js in preview

[ Edited ]

Ok, i spoke too soon. The overlay is now gone and i am able to do a test as you suggested,

However, as i suspected, my CTA js executions are being suppressed.

Level 2
JMarchant 07-28-15
 

Re: CTA doesnt trigger js in preview

OK, my next suggestion would be to post the details of the Optimizely log on the page. To get this up add this parameter to the page:

?optimizely_log=true

and open up the console of the page (Windows: Ctrl + Shift + J, Mac: Cmd + Opt +J). Paste the contents of the console on here.

 

Here's more info on the Optimizely log: The console, data object, and Optimizely log

James Marchant
Senior Developer at Conversion.com

 
tdOpti 07-28-15
 

Re: CTA doesnt trigger js in preview

[ Edited ]

Is there something specific i should look for? It says my experiment is failing, but that is because it is paused. It doesnt mention anything about why the js isnt being triggered.

 

I also turned on the Experiment briefly to test, and even after it was on, the js doesnt execute on the ctas.

Level 2
JMarchant 07-28-15
 

Re: CTA doesnt trigger js in preview

If you force the test as well as adding the parameter to the URL it should explain any issues with your code:

?optimizely_x[EXPERIMENT ID]=[VARIATION INDEX]&optimizely_log=true

Could you also post the javascript code you're using as well as the CTA html?

James Marchant
Senior Developer at Conversion.com