VWO Logo
Request Pricing

We tweet useful stuff daily

Related content:

New Feature: Custom URLs for your A/B and Multivariate tests

4 Min Read

VWO has a feature that allows running of same A/B or multivariate test on multiple pages at once. For example, if your site has several product categories and you would like to run a test only on one category, all you need to do is to enter a URL pattern like https://example.com/shoes/* in VWO.

The URL pattern above will make the test run on all pages in the shoes directory. This feature is very handy because you can test common call-to-actions, headers, footers, sidebars, etc. consistently on multiple pages at one go. What’s more, a consistent variation is shown on all the pages in a test. So if a user sees red variation on one shoes page, he will always see the same red variation on all other shoes pages.

Sometimes (primarily due to SEO reasons) there is no clear pattern in the URLs. That is, it may be possible that there are several independent URLs for category or product pages without any apparent pattern. For example, if there are URLs such as “https://example.com/adidas/, https://example.com/reebok/, https://example.com/microsoft/, https://example.com/adobe/”, etc. and you wish to run the test on only on shoes pages (the first two URLs), how are you going to do that? Until now it wasn’t possible to setup such a test, but with our new feature Custom URLs it is very simple to setup such tests.

How do I setup a 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 https://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 VWO Asynchronous Smartcode:

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

// Only on pages where this test is to be run var _vis_opt_url = ‘https://example.com/my_shoes_pages’; var _vwo_code=(function(){ var account_id= ACCOUNT_ID, // your VWO 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()); … …

Example VWO Synchronous Smartcode:

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

<head> … // 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() … </head>

Sounds Complicated? We’ll help you implement

We do realize that the implementation is bit complex but we wanted to roll out the feature to all customers (many enterprise customers have been using it already). We are here to help you implement VWO Smartcode for custom URLs. Simply contact support@vwo.com if you need our help and assistance.

Paras Chopra
Paras Chopra Founder and Chairman of VWO
More from VWO on A/B Testing

5 Reasons Your A/B Test Fails (And How Not To)

There are umpteen case studies out there that will be no less than a miracle……

Read More
Aditi Gupta

Aditi Gupta

7 Min Read

Your Intuition is Wrong – A/B Testing Results that Surprised the Experts

One of the things I absolutely love about split testing is its inherent ability to…

Read More
Justin Rondeau

Justin Rondeau

7 Min Read

Multi-Armed Bandit (MAB) – A/B Testing Sans Regret

Most readers of this blog would be familiar with A/B Testing. Just as a quick…

Read More
Shubhankar Gupta

Shubhankar Gupta

11 Min Read
Shanaz Khan from VWO

Hi, I am Shanaz from the VWO Research Desk.

Join our community of 10,000+ Marketing, Product & UX Folks today & never miss the latest from the world of experience optimization.

A value for this field is required.

Thank you!

Check your inbox for the confirmation mail