The Next Generation of Visual Website Optimizer is launching on 29th April 2014 See What's Coming

Categories

Find Articles

How do I run a test on multiple pages?

There are two cases:

1. If the pages have a consistent pattern: To run a test on multiple different pages, you need to specify a URL pattern while creating a test. URL Patterns allow you to specify wildcard (*) patterns so that you can run a test on more than one page of your website.

Example: Let’s say you have a domain name www.mydomain.com which has many categories. Now you want to run the test on all the pages under the category named “products” at www.mydomain.com/products .

Multiple pages test

So in order to run your tests on all the pages under www.mydomain.com/products/ what you can do is define a Test Pattern and provide its value as www.mydomain.com/products*

This will tell Visual Website Optimizer to run on all the pages under the category “products”.

2. If the pages don’t have any pattern: Sometimes the multiple pages pages you want to test might not have a consistent pattern. In such cases the “URL Pattern” we defined earlier won’t work. What will work instead is Custom URL Test.

Example: Let’s say you have URLs such as http://example.com/adidas/http://example.com/reebok/http://example.com/microsoft/http://example.com/adobe/, etc. and you wish to run the test on only on pages of shoe brands which is Adidas and Reebok in our case. Since these URLs have no pattern we will use Custom URL Test.

Actually, there are three easy steps if you want to use custom URLs:

  • Come up with an imaginary custom URL for all pages that need to be tested: note that the actual custom URL may not exist as we just want to come up with an identifier. For example, custom URL can be http://example.com/my_shoes_pages
  • Use that URL in VWO: while creating a test in VWO, enter that custom URL in the field where it asks whether test is to be run on multiple pages (URL pattern field)
  • Output that custom URL on your page in _vis_opt_url JavaScript variable: since the custom URL is imaginary, you need to output it in a _vis_opt_url variable on all pages you need that page to run the test.You also need to modify (common) VWO code snippet a little to accommodate custom URLs.

Example Code (Asynchronous):

On all pages where you need to run a specific test, output _vis_opt_url variable and modify VWO code as following (bold parts are extra modifications):

<script type="text/javascript">
// Only on pages where this test is to be run 
var _vis_opt_url = 'http://example.com/my_shoes_pages';

var _vwo_code=(function(){
var account_id= ACCOUNT_ID, // your Visual Website Optimizer Account ID 
_vis_opt_url = window._vis_opt_url || document.URL,
settings_tolerance=2000, library_tolerance=1500, use_existing_jquery=false, ... ... ...
this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(_vis_opt_url)+'&r='+Math.random()); ... ...
</script>

Example Code (Synchronous):

On all pages where you need to run a specific test, output _vis_opt_url variable and modify VWO code as following (bold parts are extra modifications):

<script type="text/javascript">
// Only on pages where this test is to be run
var _vis_opt_url = 'http://example.com/my_shoes_pages';
... ... ... 
// Common VWO Code
var _vis_opt_url = typeof(_vis_opt_url)=="undefined" ? document.URL : _vis_opt_url;
.... '&url='+encodeURIComponent(_vis_opt_url) +'&random='+Math.random()
... 
</script>
 

Note: If you are using Custom URLs and are also using Asynchronous code, make sure you don’t put the “var _vis_opt_url = ‘http://example.com/my_shoes_pages’;” within the Async code i.e. within var _vwo_code=(function(){…. Keep it separate in its own script tag or before the var _vwo_code=(function(){.. line as shown above.

VN:F [1.9.22_1171]
Rating: 2.6/5 (28 votes cast)
How do I run a test on multiple pages? , 2.6 out of 5 based on 28 ratings
No Comments

No comments yet.

Leave a comment →


Raise Support Ticket

Top

Raise a Support Ticket!

Your Name

Your Email

Your Phone

Your Query

Or, contact us through email support@wingify.com

A B Testing Tool