Using Linear Regression as an Attribution Secret Weapon

    A playbook on using linear regression to understand a company's growth drivers, including which variables to include, how to build the model, and how to interpret and validate the insights.

    Chris TaylorJuly 22, 20265 min read
    Using Linear Regression as an Attribution Secret Weapon

    My first move to understand what is driving a company’s business is actually one of the oldest approaches around (sorry / not sorry for the click-baity lead-in): linear regression.

    Example of a regression analysis I did in the past (data obscured) for a b2c healthcare company

    I’ve come across exactly one other marketer that does this – also someone who works across a large number of companies. I know the data scientists and MMM people have all kinds of objections, but the technical objections don’t change the fact that it often works for high-level insights. In my experience the value you can get from a small time investment makes it a foundational part of understanding a company.

    I built my first new customer regression model at E*TRADE in 2006 and it went into QBRs and board decks for the next seven years. I’ve since built models for businesses including consumer lead gen, doctors-office software, pet food e-commerce, tele-health, and many others.

    Typical insights that come out:

    • Incremental CAC estimates for key channels

    • Quantified seasonality

    • Quantified impact of weekends and holidays

    • Impact of promotional periods / sales / events

    • Impact of changes in economic conditions

    I’ve also used regression to reveal the impact of linear TV when all of the other traditional methods failed.

    Those are all pretty good things to know, right? The catch is that you need:

    1. Experience doing regression analyses

    2. A good basic understanding of the business you’re looking at and the known or probably drivers

    3. A good understanding of how marketing channels work

    4. The relevant historical spend, acquisition, and any other data

    How I approach it

    Start with the hypotheses about what the right output to predict should be. This needs to be whatever new customer acquisition event is closest to the media event that would cause it – for instance, at E*TRADE this was a complete application, not a funded account, which might happen days or even weeks later. Also exclude any events that aren’t driven by marketing – partner-driven, sales-drive, etc.

    Then consider the most likely primary drivers. In a lot of earlier-stage businesses, this is Google non-brand search spend, Meta prospecting (ex remarketing) spend, and maybe one other channel. You want to make sure the channels and tactics you include are the ones driving scale, not efficiency – that’s why I exclude non-brand search and remarketing, and why I’d also never include something like bottom-of-funnel affiliate spend.

    Collect all of this data on a daily basis for as much time as is feasible. How much history you’ll need depends on how much variation is in the data, whether the impacts can be captured on a daily basis or have to be done at the weekly level (which is generally determined by the consideration level of the action), and how many inputs you have. Here’s a sample of what it would look like:

    Sample raw data for dependent (Customers) and independent variables

    I also always build a calendar with days of week, holidays, and any key seasonal periods labeled. Then add to it any key promotional periods or other specific events that occurred that would have a significant impact on acquisition: annual sale, etc. Below is an example of what the calendar looks like. Here’s I’ve added Black Friday-Cyber Monday as an example of a time-based input:

    Sample calendar variables

    Then the fun part (depending where you are on the nerd scale): actually building the model. You can do it in Excel or (god forbid) Google Sheets. But now I’d just do it with Claude, which will build the analysis behind the scenes in Python. If you haven’t built regression models before, I’d work with someone who has.

    I won’t go into all of the finer details of linear regression modeling (nor am I really an expert in them), but in short, you want all of your coefficients to be significant and your Adjusted R-Squared to be as high as possible – I aim for 80%+ usually, but that’s not always feasible. You get there by looking at your predicted acquisition vs the actual over time and where there are large gaps, look for reasons: did we change something substantive (pricing, new channels, etc) or did something happen to us (covid, stock market change, etc)? Add those things as inputs – either as dummy (0 or 1) variables or using a proxy variable (e.g. VIX has worked for me in financial businesses, monthly consumer confidence has helped in discretionary spend businesses). Add and subtract variables until you get a good, efficient explanation of acquisition performance.

    Claude Code is super helpful in doing this and will help identify technical issues like multicollinearity (highly correlated input variables), which tends to be an issue for fast-growing companies.

    Below are a couple of views of analyses I’ve done over the years (data modified but fit not). The first is predicted vs. actual new customers for a consumer brand. I did this analysis at the start of an engagement with a company and the key insights were:

    • The company had been under-attributing customers to Meta

    • TikTok was much less effective than reported

    • Google pMax was also not effective

    We then tested each of these hypotheses in geo lift tests and they all bore out. Note that this was a couple of years ago and TikTok and pMax have both changed a lot since.

    And here is a 2-month view of new customers vs. just Meta prospecting spend for a different company, which worked because Meta was such a large part of the brand’s mix. In this case we were able to show that some changes to tracking in the Meta platform that skewed in-platform results weren’t actually impacting the channel’s performance.

    Like any other attribution view, regression analysis like this isn’t going to work for all companies and even when it works very well, it’s not the final answer. I’d use this to suggest incrementality tests to run to support or refute the findings. But it’s a valuable, very overlooked tool to have in your kit.