There's a bloodbath going on in the digital advertising industry.

Industry leaders like Meta Platforms (META -0.68%) and Alphabet (GOOG 1.15%) (GOOGL 1.01%) just posted some of their slowest-growth quarters ever. In fact, for the Facebook parent, it was its worst top-line growth on record as revenue fell 4%, though it was up 2% in constant currency.

Those two companies and peers like Snap (SNAP -1.92%) pointed their fingers at the macroeconomic climate. Advertisers are getting cold feet as they hunker down in preparation for a recession. As a result, digital advertising stocks like these three, as well as Pinterest (PINS 0.94%) and Roku (ROKU -4.98%), have all fallen sharply over the past year. 

META Chart

META data by YCharts

However, it shouldn't surprise investors that advertising businesses are among the first to get hit in anticipation of a recession. Advertising is a cyclical business, and it's highly sensitive to consumer demand and corporate budgets, meaning it's one of the first expenses to get cut in tough times, especially as digital advertising spend can be instantly ramped higher or lower.

For a reminder of what happens to the digital ad sector in a recession, it's worth going back to 2009.

When digital advertising was young

The digital ad market was much smaller back during the financial crisis. The mobile internet had just started. Facebook had only begun to build its advertising business, and connected TV barely existed.

During that bear market, like the current one, ad spend slowed substantially as the economy crumbled. Here's a look at Alphabet's revenue growth, nearly all of which came from advertising, from the beginning of 2007 through the first half of 2009.

GOOGL Revenue (Quarterly YoY Growth) Chart

GOOGL Revenue (Quarterly YoY Growth) data by YCharts

That looks pretty scary. The fast-growing company went from revenue growth of more than 60% to essentially nothing in a little more than two years. At the time, Alphabet noted a slowdown in consumer demand and macroeconomic challenges due to the financial crisis.

Based on the chart above, you might be surprised by how quickly revenue growth rebounded. 

GOOGL Revenue (Quarterly YoY Growth) Chart

GOOGL Revenue (Quarterly YoY Growth) data by YCharts

As you can see, growth bounced back in the next few quarters just as fast as it disappeared and was back above 20% by the first quarter of 2010. Even though the economy was still struggling then, it had reached a turning point and businesses were willing to spend more on advertising than they had been.

What's also telling about Alphabet then is that the stock price bottomed several months before its actual revenue growth did, a reminder that stock prices are leading indicators because investors are anticipating what's coming next.

GOOGL Revenue (Quarterly YoY Growth) Chart

GOOGL Revenue (Quarterly YoY Growth) data by YCharts

After the stock lost nearly two-thirds of its value from its peak in late 2007, it had recouped nearly all of those losses by the end of 2009.

The same advertising trends that impacted Alphabet were happening across the industry. According to eMarketer, online ad spending actually fell in 2009 for the first time ever, dropping 4.6%. However, ad growth rebounded to 15% in 2010 and topped 20% the following year.

What it means for investors

No one knows how long or how deep this bear market will go, and the current economy is different from the recession of 2008-2009. This time around, inflation and rising interest rates have spooked investors and advertisers.

However, the lessons from the financial crisis still apply. Advertising is cyclical and growth will reaccelerate once businesses feel more confident in the economy and consumer spending. Since these stocks control much of the digital ad market, they are likely to rebound when ad spend improves. There's a lot of fear right now, both among investors and advertisers, and these stocks have fallen far enough that their prices could look like bargains in a few years or even less.

Alphabet's stock performance during the financial crisis is also informative. Social media and digital ad stocks are likely to bottom out not when revenue growth hits a nadir but when the fear factor peaks, which is likely to happen before revenue growth rates bottom out. While these companies have forecast more headwinds in the fourth quarter, market sentiment could shift once the Federal Reserve begins to cool its interest rate hikes.

Take a lesson from history and buy digital ad stocks while they're down. They're likely to be in a much stronger position in a few years when the current economic troubles are a distant memory.