Imagine you’re just about to launch your new free trial user nurture stream in HubSpot that you have been working on for weeks. Your workflow has three different emails in it and is triggered when a user registers on your site. The goal of your workflow is to get free trial users to become paid users, but you want to be sure that the messaging in your emails is pushing your users to convert.

If you were sending a batch email through HubSpot, running an A/B test would be the perfect way to optimize your email. Unfortunately, emails sent via workflows cannot be saved for A/B testing. At ezCater we faced this exact issue when we wanted to A/B test our “refer a friend” emails. Except there is a way!

Here are steps to follow to hack together an A/B test on an email saved for workflows, no coding or scripting required!

Method 1: The HubSpot Lead Rotator

This first method to A/B test workflow emails involves the creative usage of the lead rotator feature in the workflows tool. Since the rotator evenly distributes contacts amongst every owner you have designated, you can also use it to evenly divide contacts into 50/50, 33/33/33, or 25/25/25/25 splits. With the March 2018 update that enables you to rotate leads on custom owner properties, it is possible to create a “custom owner” field specifically for A/B testing.

Step 1: Publish your emails

Clone the email you want to A/B test. Change the subject line, copy, hero image, button color, or whatever you want to test in your cloned version. Save the email for automation.

You should now have two different emails. Name the email something that makes it easy to distinguish between both versions, such as “Version C” and “Version D.” That way you don’t accidentally put the wrong email in the wrong place later on.

Step 2: Create a Custom Number Property

Create a custom number property in the contacts settings tab. You will need admin rights in your HubSpot instance to do this. Make sure you don’t accidentally check the currency tab. This field needs to stay a regular old number!

Step 3: Build a Custom Owner Property

Create a custom owner property in the contacts settings tab. You will need admin rights in your HubSpot instance to do this. I ended up calling it “A/B Testing” to make it obvious to any other user of our HubSpot instance what the field means and what it is used for.

Step 4: Build Your A/B Testing Workflow

Create a workflow. The criteria for this workflow should be whatever your trigger criteria would be. In our case, it was a user getting referred to ezCater.

The first step in your workflow should be a lead rotator step using your new custom owner property you created in the last step with two marketers who are not normally assigned contacts. Be sure to have those lucky marketers turn off lead assignment notifications. And definitely do not use salespeople for this step, as that will likely confuse them.

Next, create an “if/then” branch with the criteria being the custom owner property you created being equal to one of the marketers in the previous step. Under the “No” branch choose the “Set a contact property” step and set the number property you created in step two to “1.”

For the next step on this branch select the “Clear a contact” property action and clear the custom owner property. This is good practice in case you want to run another A/B test involving this contact in the future. For the final step in this branch, create an “Enroll in workflow” step. The workflow you should choose should be your nurture stream.

Once that is complete, repeat the same steps on the “Yes” branch with one key difference. Instead of setting the number property in this branch to “1”, set it to “2.”

Step 5: Build Your Nurture Stream Workflow

In the first step of your nurture stream workflow create an “if/then” branch step using the custom number you created. If it is equal to “1,” send them down one branch that sends them “Version A” of your email. If that number is equal to “2,” send them down the other branch and send them “Version B.”

Notice how we inserted different versions of our refer a friend email in the screenshot below!

And that’s it! You have successfully set up an A/B test on emails within a workflow. No coding required.

Method 2: Zapier, a HubSpot Integration Partner

For marketers who can’t or don’t want to use the lead rotator for whatever reason, there is another method to run A/B tests on workflow emails. This secondary method requires the use of Zapier, a HubSpot integration partner.

Instead of using the lead rotator to randomize the contacts you want to run the A/B test against, you will use Zapier’s Formatter app to give each contact a random number of either “1” or “2.”

Step 1: Publish your emails

Clone the email you want to A/B test. Change the subject line, copy, hero image, button color, or whatever you want to test in your cloned version. Save the email for automation.

You should now have two different emails. Name the email something that makes it easy to distinguish between both versions, such as “Version C” and “Version D.” That way you don’t accidently put the wrong email in the wrong place later on.

Step 2: Create a Custom Number Property

Create a custom number property in the contacts settings tab. You will need admin rights in your HubSpot instance to do this. Make sure you don’t accidentally check the currency tab. This field needs to stay a regular old number!

Step 3: Build Your A/B Testing Workflow

Create a workflow. The criteria for this workflow should be whatever your trigger criteria would be. In our case, it was a user getting referred to ezCater.

The first step in the workflow should be a “Trigger a webhook” step that hits Zapier. The webhook URL can be found within Zapier. Make sure to select “Catch Hook” as the first step of your Zap.

The second step of the workflow should be a 2-minute delay to give the Zap time to run.

The third step should be an “Enroll into workflow” step. The workflow you select should be the one where you have the emails you are A/B testing.

Step 4: Build Your Zap

Set up the Zap. Within Zapier select the Formatter by Zapier app. Then select “Numbers.” From there select “Spreadsheet-Style Formula” and put in “RANDBETWEEN(1, 2)” as the value for the formula.

What this formula will do is give a randomly assigned number of either “1” or “2” to any contact pushed through the Zap.

The final action of your Zap should be to run a “Create or Update a HubSpot Contact” step. Insert the email of the contact enrolled in the Zap in the “Contact Email” step. Then put the random number given to the contact in step two of the Zap into the custom number property you created earlier.

You’re almost done!

Step 5: Build Your Nurture Stream Workflow

In the first step of your nurture stream workflow create an “if/then” branch step using the custom number you created. If it is equal to “1,” send them down one branch that sends them “Version A” of your email. If that number is equal to “2,” send them down the other branch and send them “Version B.”

Notice how we inserted different versions of our refer a friend email in the screenshot below!

And that’s it! You have successfully set up an A/B test on emails within a workflow. No coding required.

Write for the HubSpot User Blog.

Originally published Apr 23, 2018 9:00:00 AM, updated May 07 2018