Skip to main content

Setting up an A/B test for the Subscription First widget

Jeroen Roosenboom avatar
Written by Jeroen Roosenboom
Updated over a month ago

To test different variant selections, merchants can create two sets of featured variants (A and B) and split traffic between them. In this guide, we’ll show how to define new metafields for variant B, assign them to products and a new template, and then run an A/B test using ABConvert.

Step 1: Add new metafield definitions for the B variant

In Shopify Admin, go to Settings > Custom data > Products and click Add definition. Create two new metafields for the B variant, similar to the original ones. For example:

  • Featured Subscription Variants (B) – Name: Firmhouse: Featured Subscription Variants (B), Namespace and Key: firmhouse.featured_subscription_variants_b, Type: Product variant, List of variants.

  • Featured One-Time Variants (B) – Name: Firmhouse: Featured One-Time Variants (B), Namespace and Key: firmhouse.featured_one_time_variants_b, Type: Product variant, List of variants.

These new metafields will hold the featured variants for the B version of your widget.

Step 2: Set the featured variants on each product

Next, edit each product that will be part of the A/B test. In the product editor, scroll to Metafields. For each product:

  • Subscription Variants (B): Click the entry next to Firmhouse: Featured Subscription Variants (B) and then Select variants. Pick which product variants to feature for subscriptions, and click Add to save.

  • One-Time Variants (B): Click the entry next to Firmhouse: Featured One-Time Variants (B) and select the variants to feature for one-time purchases.

Repeat this for all products in the test. (If you don’t set the one-time metafield, all variants remain available as one-time options by default.)

Step 3: Create a new product template for variant B

In your theme, duplicate the existing product page template used for Subscription First widget and assign your B-group products to this new template. In the theme editor for the B template, add or select the Subscription First block. In the block’s Advanced settings (or Content settings), set the keys to your new metafield keys:

  • Featured Subscription Variants Key: featured_subscription_variants_b

  • Featured One Time Variants Key: featured_one_time_variants_b

(Note: the block settings use just the key names without the firmhouse. prefix.)

These values link the widget to the B-variant metafields defined earlier. Save the template when done.

Step 4: Run a Template Test in ABConvert

Now use the ABConvert app to split traffic between template A and B. In ABConvert:

  • Create a new Template Test: Go to Create New Test and choose Template Test.

  • Configure the test: Give it a name and set the traffic split (for example, 50/50).

  • Select templates: Choose your original product template as the control (A) and the new B template as the variant.

  • Launch the test: Start the test to activate it.

ABConvert will mark the test “Active” and begin directing visitors to either version A or B.

Did this answer your question?