Catch all Regex Recipe for Split URL Experiments

Sometimes there are issues with Split Test experiments where you see that the Original shows much more visitor traffic on the report than the Variation does.  One thing that can cause this is when your Site Area is broad and allows many conditions to trigger the experiment, but the Original URL used to configure the Split Test is narrow.

Example:

Site Area is URL contains convert.com (this would match https://www.convert.com or https://convert.com and many other combinations)

In the configuration area for "Edit Split URL Variations", Original URL is:

https://convert.com/{0,1}(([\?&]{1}[^=]{1,}=[^=]*[&]{0,1})*)$ (this will only match URLs starting exactly with https://convert.com)

The problem here is that the Site Area will match (for example) www.convert.com, and a visitor will trigger the experiment, but for certain visitors (those who are randomly selected to receive the Variation), when we compare the URL in the visitor's browser to the Original URL in your configuration as shown above (ie https://www.convert.com compared to https://convert.com), it will not match.  In that case they will not be redirected to the Variation and will not be counted on the report.  That will result in the Variation showing very few visits compared to the Original.

To solve this, the following regex formula matches every URL bucketed by the Site Area and appends any parameters from the visitors' URL to the end of the Variation URL. This prevents uneven experiments that may have unknown URLs being bucketed on the experiment.

It also transfers URL parameters.

Original URL

([a-z]{1,2}tps?):\/\/((?:(?!(?:\/|#|\?|&)).)+)(?:(\/(?:(?:(?:(?!(?:#|\?|&)).)+\/))?))?(?:((?:(?!(?:\.|$|\?|#)).)+))?(?:(\.(?:(?!(?:\?|$|#)).)+))?(?:(\?(?:(?!(?:$|#)).)+))?(?:(#.+))?

Variation 1:

https://convert.com/blog/$6

Tip

 

 

Have more questions? Submit a request

Comments