How to do A/B/N testing in a Pardot Engagement Stream

Want to do A/B testing in a Pardot Engagement Stream? You can’t 🙁 Well, not without a little bit of customization.

Here’s a simple workaround for doing A/B/N testing in a Pardot engagement stream using a Salesforce APEX trigger.

I won’t get into the details of building an APEX trigger, so if you aren’t comfortable with adding code to Salesforce, ask your admin nicely for help. But it’s really pretty easy to do. The process looks like this:

  1. Create a new Lead field in Salesforce. Mine is called abRandom.
  2. Create an APEX trigger with the code below and deploy it.
  3. Create a new custom Prospect field in Pardot and sync it with Salesforce
  4. Add a rule to your Engagement Stream to branch on the random number you’ve generated.

Here’s the APEX trigger code to generate a number between 1–4 so that I can have up to 4 variations inside an Engagement Stream:

trigger assignRandom on Lead (before insert, before update) {
    for (Lead lead : {
        if (lead.Testing__c == NULL) {
            lead.Testing__c = ( (Math.random() * (4-1) + 1));
            lead.Testing__c = lead.Testing__c.setscale(0);

Testing__C is the API name for a Salesforce field I created called abRandom (I probably should update that name, eh?).

This function will look to see if the abRandom field is empty and if it is, it will generate a random number for every Salesforce Lead. You can create a random number in any range by changing the values below i.e. if you wanted a number between 1 and 2 you’d change it to:

(Math.random() * (2-1) + 1)

Once the APEX trigger is deployed, all of your Leads will get be assigned a random number that will be synced to Pardot. Here’s what a Pardot Engagement Stream looks like with A|B branching based on the random number.

This example will split test two emails.

Pardot Engagement Stream w/ an A/B test

That’s it. I hope this helps! Maybe someday Pardot will add support for native A/B testing without workarounds like this 🙂


Before you agree to widening the top of your lead funnel…

Few things cause CMOs to panic more than hearing the dreaded phrase “we need to widen the lead funnel” from the head of sales. Or the CEO. Or maybe even the board. What they all really want is more qualified opportunities and ultimately more ARR. Maybe that means widening the funnel. Maybe not. But the solution is much more complex than just delivering “more”. Let’s dig into what can go wrong when you try to widen the funnel.

Every CMO has a version of this spreadsheet, that starts with an ARR target and spits out a lead, marketing-qualified lead (MQL), and sales-qualified opportunity (SQO) goal using historical funnel conversion metrics. Here’s a simple example using made-up numbers:

In this case, I’ve taken the next quarters ARR goal of $5,000,000, assumed 75% of it comes from marketing, and that we’ll close 33% of the opportunites we create at an average deal size of $25,000. Based on these assumptions, my model spits out a lead target of 5051 and an MQL target of 1515.

When the next quarter comes along, we do the same exercise. Let’s say we’re shooting for 40% ARR growth, which means we need 40% more leads + MQLs.

Here’s where the problems start happening.

In the early days of a company most MQLs come through inbound sources, but as the MQL target gets higher CMOs feel pressured to try new tactics to hit the goal. At that often means scaling paid programs that guarantee a certain number of leads based on targeted criteria like company size, role, industry etc. The targeted criteria helps ensure these leads become MQLs as they map to the attributes in your lead scoring process.

But not all MQLs are created equal. For example, your lead scoring processes probably overweight fit (think job title, industry, company size, etc) and underweight behavior/interest. So while those new paid leads look great in the spreadsheet you received from the vendor, they aren’t going to convert at the same rate as your primarily inbound funnel did in the past. So inside sales converts less of them into opportunities, and as a result probably loosens their qualification criteria to hit their numbers. Here’s how the funnel math looks now with the less qualified MQLs added in, impacting conversion:

When we lower the SQO conversion rate and the win rate just a little bit, the MQL target starts to spiral out of control. Because we’re not as efficient, our MQL target is now 85% higher than the previous quarter. If we play it out one final quarter, assuming we continue to get slightly less efficient, here’s what the targets looks like:

In this made up example, over four quarters our ARR target increased by 173% while our MQL target went up by 307%! And we had to pay for all those MQLs — and hire inside sales capacity to process them — driving our CAC way up. Of course I’m making a bunch of assumptions here that won’t hold true for everyone, but the point is that scaling the top of the funnel alone won’t lead to growth nirvana, and could be the entirely wrong thing to do.

Some companies like HubSpot rely entirely on widening the funnel to grow. This makes sense, as they sell in the massive SMB market and get most of their leads through low-cost inbound sources. But if your company sells into larger enterprises, has a vertical go-to-market, targets a niche persona, etc. you should be more focused on acquiring, converting, and closing the right leads, which might be measured only in tens or hundreds depending on your market.

Instead of just arbitrarily widening the funnel, what happens if we focus on scaling higher converting lead sources and targeting the right buyers? Magic. We generate higher quality leads, convert more of them, and win bigger deals. Much more efficiently. Going back to our prior example, hitting our Q2 target now only requires 84% more leads vs. 307% in the inefficent model.

If this sounds like I’m advocating for account-based marketing, you’re absolutely right. ABM is a great way to reach the prospects who are most likely to buy from you, improving funnel metrics. I also recommend products like Captora that help you grow the top of the funnel by scaling higher converting channels like organic search.

The net is that more isn’t always better. Often narrowing the top of the funnel is exactly what it takes to widen what really matters — the “Closed Won” funnel stage.