A/B testing in Shop-Script

A/B testing is a simple yet reliable method to verify whether your online store's or website's overall efficiency will increase if you change something in their design or content. A/B testing means to alternately display one (А) or other (B) version of some web page to website visitors and the subsequent analysis of each version's qualitative and quantitative parameters such as conversions , subscriptions, orders, visit duration, etc. For example, you may use A/B-testing to compare the conversion rate and the sales volume dependency on specific products displayed in the homepage. Read more about A/B testing on Wikipedia: http://en.wikipedia.org/wiki/A/B_testing.

In Shop-Script you can carry out A/B testing in various ways; e.g., using only built-in tools of Shop-Script or also using the Google Analytics service for counting test data.

A/B testing using built-in Shop-Script tools

1. Add a test

In backend section “Marketing  → A/B test” add a new test. Enter arbitrary name for your test to simply distinguish it from other tests which you may run in the future.

Decide on how many design or content variants you want to compare during this test and add the corresponding number of variants (versions) to your test. Specify a descriptive name for each test variant. For example, if you want to compare the efficiency of offering different types of products on the home page, then you may name test variants by those product types:

In addition to your custom test version names, each version by default has a letter assigned to it: A, B, C, D, etc. These letters are used in the source code of the test condition as shown below in this article.

2. Add test code to HTML template

Save the test and use the Get code button to copy the automatically generated condition snippet which will be used to automatically change the test versions in the storefront. For the two test versions in this example, the condition may look as follows:

{if $wa->shop->ABtest(1) == 'A'}
    ... your HTML for option “snowboards” here ...
    ... your HTML for option "cameras" here ...

Replace the lines with there dots with the HTML code snippets which must be alternately displayed to different customers during the A/B test. For example, if you want to display different product sets for each test version, then you may specify the appropriate product set embedding code snippets instead of those lines; e.g.:

{if $wa->shop->ABtest(1) == 'A'}
    {$products = $wa->shop->productSet("snowboards")}
    {include file="list-thumbs.html" products=$products}
    {$products = $wa->shop->productSet("photo")}
    {include file="list-thumbs.html" products=$products}

Copy the resulting condition code containing the HTML snippets to be compared and paste it to the HTML template or page where you want to run an A/B test. After that different storefront design options will be displayed to different website visitors; e.g., as shown in the picture below:

A/B testing automatically begins immediately after you save the HTML template containing the test condition code.

3. Watch the results

The results of your A/B test will become available in the common sales reports in section Reports → Sales immediately after at least one order gets paid for by a customer who has visited a page with embedded A/B test condition code.

4. Apply A/B test results

After some time (preferably after at least several weeks) compare the data registered for each tested version. If some of the versions has significantly outperformed the other and you have decided to keep it as the main version, then remove all code related to A/B testing from the storefront template by leaving only the winner's source code.


  1. Avoid making changes to your marketing campaigns or website structure during an A/B test as this may distort the data you will obtain and prevent you from getting a clear picture of your website's efficiency.
  2. Wait until you have collected sufficient amount of statistical information from your tests; avoid making decisions based on data obtained during a short period of time, which will be incorrectly affected by the random number generator.
  3. Make sure that you run only one test at a time. When you run multiple tests at the same time, each of them may have unobvious effect on the final results in combination with others; e.g., if you try to test different designs of the “Add to cart” button and the category tree. This way, you cannot obtain accurate testing results for each such element.
  4. If you feel that you need some confirmation that an A/B test, once completed, was indeed correct, you may simply repeat it at a later time. Should you obtain the same results again, you may be sure that the winning page version indeed has the right to remain on your website.

A/B testing using Google Analytics

In addition to A/B tests which you may carry out using the built-in Shop-Script testing tool, you can also run similar tests using the Google Analytics service. We have described such testing in detail in a separate article.


    Add comment

    To add a comment please sign up or login

    Раздел помощи работает на основе приложения «Хаб»