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

Understand Redirect Logic

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

Doing that will result in your variation not recording 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 the following, instead:

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

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

mceclip0.png

Passing Convert Cookie Data for cross-domain tracking.

If your second-page domain is in a separate domain, you will need to transfer Convert cookie data to the second page, you are transferring users to.

For that, you will need to append some code to the convert.redirect one, to achieve cross-domain tracking:

 

convert.redirect("http://www.mysite.com/my_variation_page.html"+ "?_conv_v=" + convert.getCookie("_conv_v") + "&_conv_s=" + convert.getCookie("_conv_s"));

 

Need assistance? Start a conversation with our Support Team.
CONVERT MORE

Reliably Convert More Site Visitors, Even If Everything Else is Changing in Your Business.

START 15-DAY FREE TRIAL
✓ No Credit Card  ✓ Easy Set-Up  ✓ Access All Features

Comments