How Do I Create a Variation that Redirects to Another Page Based on Certain Logic?

Understand Redirect Logic

Sometimes you might want that one of your A/B experiment's variations redirect to another page based on some logic. Off course you could just start writing your JS code that redirects to the new page but problem is just half solved.

Doing that, your variation will not record any stats since it redirects before allowing for the stats to be stored. 

To fix that, we introduced a JS function that you can use to redirect to another page, without losing the ability to also store stats for that specific variation:

convert.redirect("URL_here");

So, instead of using for example

document.location.href="http://www.mysite.com/my_variation_page.html"

use


convert.redirect("http://www.mysite.com/my_variation_page.html");

Note: The above code has to be used only inside the "Custom Javascript" Option inside the visual editor: 

Have more questions? Submit a request

Comments