Transfer Query Parameters from Original to a Variation that also has Query Parameters

 

If you want to do a Split Test where your original URL may have query parameters that you want to be passed onto the variation, and your variation already has it's own query parameter that you want to retain, you have to set this up a little differently than you normally would.  Otherwise, what you would end up with is a variation URL that looks like this:

http://www.mysite.com?query1=param1?query2=param2 (note the second ? which is incorrect)

The above would be incorrect, as what you really want is this:

http://www.mysite.com?query1=param1&query2=param2 (note the & which appends the second parameter)

Example Configuration

Site Area

Include

Page URL Matches exactly http://www.mysite.com 

Note that selecting "Page URL" means that it will work whether the URL that should trigger the experiment contains query parameters or not.  You only need to use Page URL (w/Query) if you want to match *specific* query parameters.  Also, "Matches exactly" may not be right for your situation, this is only an example.

Exclude

Query String Contains query=param

Note - this excludes the query parameters that already exist in your variation.  Replace query=param with your specific parameter.

SiteAreaInclude.png

SiteAreaExcludeQueryString.png

Edit Split Url Variations

Original Url

https://www.mysite.com/([^\?]+)?\?{0,1}(.*)$

Options

Support Regular Expressions - checked on

Transfer Original URL Variables to the Variation URL - checked on

Show variation RegEx - checked on

Variation URL

http://www.mysite.com/VIDEO/?query=param&$2

 

 

 

Have more questions? Submit a request

Comments