> For the complete documentation index, see [llms.txt](https://docs.shoplift.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoplift.ai/learn/guides/combo-tests.md).

# Combo Tests

A combo test pairs a price, template, theme or URL redirect test with your own code, so you can test a new price and an offer together.

A **combo test** is a price, template, theme or URL redirect test with some of your own code added to your theme. The code makes an extra change for visitors in the variant, and Shoplift measures both changes together as one result. Use it when your idea needs two changes that one test type can't make on its own.

### What a combo test can change

* **The test's own change.** The test changes what it always changes: a price, a template, your theme or the page a visitor lands on.
* **Anything else your code changes.** The code can change other parts of your storefront for the same visitors, such as a banner on other pages or a message in your cart drawer.
* **An offer at checkout.** With some checkout setup, the code can also give the variant its own discount, free shipping or free gift.

Your code can't change a product's price. Only a price test does that, so pair your code with a price test when the price is part of the idea.

### When to use a combo test

* **A lower price, announced.** A price test lowers the price, and your code adds a "New lower price" badge next to the price and in your cart drawer for the same visitors.
* **A higher price with free shipping.** A price test raises the price by $5, and your code gives the same visitors free shipping. You learn whether free shipping makes up for the higher price.
* **A new product page with a real offer.** A template test adds "Free gift over $75" to your product pages, and your code makes sure only those visitors get the gift at checkout.
* **A sale theme with a real discount.** A theme test shows your sale design, and your code applies the sale discount for the same visitors only.
* **One offer across your store.** A template test shows an offer on your product pages, and your code repeats it in your cart drawer for visitors who saw it.

### When not to use a combo test

* **To test one change**, use that test type on its own. See [Choose the right test type](https://docs.shoplift.ai/get-started/quickstart/choose-the-right-test-type.md).
* **To test an offer without a price change**, see [How can I test an offer or discount?](https://docs.shoplift.ai/learn/guides/test-offers-and-discounts.md) Many offer tests need no code.
* **To show an offer to one audience all the time**, use a [personalization](https://docs.shoplift.ai/test/personalizations.md).

### Why not run two separate tests?

Shoplift keeps each visitor out of tests that could interfere with each other, so each test's results stay clean. A visitor in a price test, for example, won't also join a theme test. So if you put the price in one test and the offer in another, almost no visitor sees both. A combo test keeps both changes in one group. To see which tests one visitor can join, read [Running multiple tests](https://docs.shoplift.ai/test/running-multiple-tests-simultaneously.md).

### How a combo test works

1. Shoplift puts each visitor in the original or the variant, the same way it does for any test.
2. Code your developer adds to your theme checks which group the visitor is in.
3. For visitors in the variant, the code makes your extra change. Visitors in the original see your store as it is.
4. The test's report compares the two groups as usual, so its result covers both changes together.

#### When visitors see your code's change

Your code can only find a visitor's group after the visitor joins the test. Before that, the visitor sees your normal store.

| Test type         | When a visitor joins                          |
| ----------------- | --------------------------------------------- |
| Price test        | When a tested price first scrolls into view   |
| Theme test        | On their first page view                      |
| Template test     | When they first reach the tested type of page |
| URL redirect test | When they first land on the tested URL        |

Place your code's change where visitors have already joined. For a price test, that means pages where the visitor has already seen a tested price, such as the tested product's page, and the pages after it, such as the cart.

### Before you start

* **A developer.** Someone needs to add code to your theme and test it. For a theme test, the code goes in the variant theme too. Shoplift's preview shows the test's own change only, so your developer checks the code's change in a private browser window.
* **The variant's ID.** Each version of a test has an ID called a hypothesis ID, and your developer's code uses the variant's ID to tell which group a visitor is in. For a template, theme or URL redirect test, it's in the info tooltip next to the variant's name on the test's draft, and later in the test report. For a price test, your developer looks it up with the Shoplift API before launch.
* **Checkout setup, for offers.** To give the variant its own discount, free shipping or gift, your developer also builds the checkout side so the offer checks the visitor's group. A discount made in the Shopify admin alone can't do this.

### Set up a combo test

You create and launch the test. Your developer adds the code in step 4 and checks both groups in step 5.

1. **Create the main test, but don't launch it yet.** Set up the price, template, theme or URL redirect test as usual. For example, see [Create a price test](https://docs.shoplift.ai/test/price-testing/create-a-price-test.md) or [Create a template test](https://docs.shoplift.ai/test/template-testing/create-a-template-test.md).
2. **Get the variant's ID to your developer.** For a template, theme or URL redirect test, copy it from the info tooltip next to the variant's name on the test's draft. For a price test, your developer looks it up with the Shoplift API, as the [developer guide](https://docs.shoplift.ai/api-reference/guides/javascript-api-tests/code-examples/add-your-own-code-to-any-test) shows. If you remove and re-add the variant, or duplicate the test, get the ID again, because it changes. Don't launch first and add the code later: visitors who join before the code is in place count toward the variant without seeing your extra change, which waters down the result.
3. **Describe the extra change.** Tell your developer what the variant should show or do, and on which pages. For an offer, also say what the variant's discount, free shipping or gift is.
4. **Have your developer add the code.** For a theme test, the code goes in the variant theme too. For an offer, your developer also builds the checkout side: a discount app that can check the visitor's group, or a custom discount. A discount made in the Shopify admin alone can't tell the groups apart. See [Give each test group its own offer at checkout](https://docs.shoplift.ai/api-reference/guides/javascript-api-tests/code-examples/offers-at-checkout).
5. **Launch the test, then check both groups.** You launch the test. As soon as it's live (for a scheduled test, once it starts), your developer opens a fresh private browser window, not one used for Shoplift's preview, and starts where visitors join the test, such as the tested product's page for a price test. Shoplift puts each new visitor in a group at random, so they close all private windows and open a new one until they've seen both groups. The variant shows your extra change and the original doesn't. For an offer, they add a product to the cart and go through to the checkout page. These few check visits count in the results like any other visits.
6. **Read the results in the test's report.** If you keep the winning variant, have your developer make the code's change permanent too. Either way, have them remove the test code when the test ends.

**For developers:** Read the visitor's test group from your own code, and act on it. See [Add your own code to any test](https://docs.shoplift.ai/api-reference/guides/javascript-api-tests/code-examples/add-your-own-code-to-any-test).

### Common mistakes

* **Running a second test for the extra change.** Two tests split your visitors, so few visitors see both changes. Put the extra change in code instead.
* **Showing the extra change before visitors join.** On a price test, a banner on your homepage only reaches visitors who already saw a tested price. Place the change where visitors have already seen a tested price, such as product pages and the cart.
* **Expecting your code to stay when you keep the winner.** When you make a winning variant permanent, Shoplift applies the test's own change only. Make your code's change permanent yourself.
* **Pausing the test with your code in place.** While a test is paused, Shoplift turns off the test's own change, but your code may still find the visitor's group. Remove or turn off your change while the test is paused.
* **Leaving the code in place after the test ends.** Remove it when the test ends, so visitors don't see a change you aren't measuring.

### Next steps

* [How can I test an offer or discount?](https://docs.shoplift.ai/learn/guides/test-offers-and-discounts.md)
* [Create a price test](https://docs.shoplift.ai/test/price-testing/create-a-price-test.md)

**Related articles**

* [Running multiple tests](https://docs.shoplift.ai/test/running-multiple-tests-simultaneously.md)
* [Price test ideas](https://docs.shoplift.ai/test/price-testing/use-cases.md)
* [Test during BFCM and other sales](https://docs.shoplift.ai/learn/guides/test-during-bfcm-and-sales.md)

***

**Still need help?** [Contact support](https://docs.shoplift.ai/support/get-help.md) to chat with the Shoplift team in the app, or email <help@shoplift.ai>. Include your store URL and the name of your test.
