---
title: "Run A/B tests on your store"
source: https://support.storeconnect.com/articles/run-an-ab-test
type: article
format: markdown
site: StoreConnect Support — product and developer documentation for StoreConnect
site_index: https://storeconnect.com/llms.txt
docs_index: https://support.storeconnect.com/llms.txt
note: Append .md to any page or article URL on this site to get its Markdown form.
---
# Run A/B tests on your store

You can show different visitors different versions of the same page or content section, and see in Salesforce which version brought in more orders or gifts. This is known as A/B testing. This topic shows you how to build the different versions in StoreConnect, split visitors between them with a testing tool, and report on the results.

## How an A/B test works with StoreConnect

An A/B test on your store has three parts, each handled in a different place.

-   **The split** — your testing tool, such as VWO, Optimizely, or AB Tasty, decides which version each visitor sees. StoreConnect does not split traffic itself.
-   **The versions** — pages or content blocks you build and publish in StoreConnect, kept out of your menus.
-   **The results** — each version's address carries a `utm_content` value, which StoreConnect records on the order, so a Salesforce report can compare versions.

## Choose how to build the versions

| Build each version as | Use it when | Visitors see |
|---|---|---|
| [A separate page](#build-versions-as-separate-pages) | The versions differ in layout, sections, or most of the content | Each version at a separate address, such as `/give-monthly-b` |
| [A content block chosen by a URL parameter](#build-versions-as-content-blocks) | The versions share most of the page and differ in one section | One address, with the parameter deciding which block shows |

## Before you start

-   Your testing tool's script is added to the store's head content. See [adding custom JavaScript, CSS, and head content](adding-custom-javascript-css-and-head-content).
-   If your store uses Privacy Compliance, the testing tool's cookies are listed so visitors can consent to them. See [cookie management and privacy compliance](cookie-management-and-privacy-compliance).

## Build versions as separate pages

1.  Create a page for each version besides the original, for example with the paths `give-monthly-b` and `give-monthly-c`. See [content pages](content-pages).
2.  Build each version's content. Start from the same sections as the original and change only what you are testing.
3.  On each version's **Page** record, select **Hide Page from Navigation and Menus** (`s_c__Hide__c`) and leave **Publish the page on the site** (`s_c__Visible__c`) selected.
4.  If you built the versions in the Website Builder, submit the changes and have them approved and published. See [review and approve a content change](review-and-approve-a-content-change).

Each version now opens at a separate address, such as `https://shop.example.com/give-monthly-b`, and does not appear in your menus. Clearing **Publish the page on the site** instead makes the page return a page not found error.

## Build versions as content blocks

A content block template can read the address of the page through `current_request.params` and show only the matching version. Use `utm_content` as the parameter, so the value that picks the version is the same value recorded on the order.


```liquid

{%- assign version = current_request.params.utm_content -%}
{%- assign hero_title = content_block.title -%}
{%- if version == "give-monthly-b" -%}
  {%- assign hero_title = "Become a monthly partner today" -%}
{%- elsif version == "give-monthly-c" -%}
  {%- assign hero_title = "Feel the joy of making an impact every month" -%}
{%- endif -%}

<h1>{{ hero_title }}</h1>
```


A visitor with no parameter, or an unrecognized one, sees the block's own **Title**, so the original stays editable in the Website Builder. To create a template like this, see [content block templates](content-block-templates).

Keep two limits in mind:

-   **The parameter only reaches the page it is on.** A visitor who moves to another page and comes back sees the original. Test a single landing page this way, and use separate pages for anything a visitor returns to.
-   **Do not cache the block on a key that leaves out the parameter.** The base theme does not cache content blocks, but a `{% cache %}` tag in a custom template that omits `current_request.params.utm_content` from the key serves one version to everyone.

## Set up the split in your testing tool

1.  In your testing tool, create a split URL test. Testing tools name this differently, for example a split URL or redirect test.
2.  Give every version, including the original, a different `utm_content` value:

    | Version | Address |
    |---|---|
    | Original | `https://shop.example.com/give-monthly?utm_content=give-monthly-a` |
    | B | `https://shop.example.com/give-monthly-b?utm_content=give-monthly-b` |
    | C | `https://shop.example.com/give-monthly-c?utm_content=give-monthly-c` |

    For content block versions, every row uses the original page's address with a different `utm_content` value.

3.  Start the test, then open each address and confirm it shows the right version.

StoreConnect records the value when the visitor adds to or changes their cart, so a visitor who lands on a version and completes an order is attributed to it. See [UTM tracking codes](utm-tracking-codes) for what can stop a value being captured.

## Report results in Salesforce

Each completed order holds the captured values on **Order Campaign** records (`s_c__Order_Campaign__c`) in the **Order Campaigns** related list.

1.  Create a report of orders with their order campaigns. If no report type includes both, ask your Salesforce administrator to create one.
2.  Filter to the test's dates, and group by **UTM Content** (`s_c__UTM_Content__c`).
3.  Add the order total as a summary.

The report now shows how many orders, and how much in sales or gifts, each version brought in.

## End the test

1.  Stop the test in your testing tool.
2.  Make the winning version the page everyone sees, either by moving the winning content to the original page or by pointing your menus at it.
3.  On each losing version's **Page** record, clear **Publish the page on the site**.

## What this does not do

-   StoreConnect does not split traffic or calculate statistical significance. Your testing tool does both.
-   Draft content changes and theme preview links are for reviewing work, not for serving visitors. See [preview and stage theme changes](preview-and-stage-theme-changes). Anyone holding one of those links can open it, and a theme preview shows a preview bar across the top of the store. Publish each version before the test starts.
-   A store shows one theme to every visitor. To test a different design, build it into a version's pages or content block templates.

---

## Follow StoreConnect

- [Email Newsletter](https://storeconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://storeconnect.com/partners)
- [Become a Partner](https://storeconnect.com/become-a-partner)
- [News](https://storeconnect.com/articles/news)
- [Events](https://storeconnect.com/articles/events)
- [Feature Comparison](https://storeconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://storeconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

## Machine-readable

- [Site index for agents](https://storeconnect.com/llms.txt): curated map of the StoreConnect site in llms.txt format
- [Documentation index for agents](https://support.storeconnect.com/llms.txt): full technical and product documentation map

Every page and article on this site has a Markdown rendering: append `.md` to its URL.

Continue in Markdown: [Help documentation](https://support.storeconnect.com/help-documentation.md) · [Developer reference](https://support.storeconnect.com/developer-reference.md) · [Videos & tutorials](https://support.storeconnect.com/videos-tutorials.md) · [Release notes](https://support.storeconnect.com/release-notes.md)

---

StoreConnect Support — https://support.storeconnect.com/articles/run-an-ab-test