Although the economy isn't out of the woods yet, there are multiple signs that any economic downturn won't be as severe as many feared. This is excellent news for investors in one industry in particular: advertising. Advertising budgets are an easy item to cut as management looks to make companies more efficient in case of reduced business. However, as the economy recovers, advertising usually sees a quick boost as advertisers try to capture business from clients with increasing budgets.

Two companies that will benefit from this are Alphabet (GOOG -0.64%) (GOOGL -0.70%) and The Trade Desk (TTD -1.65%), which are significant players in the advertising industry. I think they will make some of the best investments as the economy recovers. Here's why. 

1. Alphabet

Alphabet derives a significant chunk (78%) of revenue from advertising services on its Google and YouTube platforms. Unfortunately, advertising revenue actually fell 3.6% year over year in Q4.

While some may contend this is Alphabet losing the arms race for artificial intelligence (AI)-powered chatbots, the reality is the advertising market is currently difficult. As the probability of a recession rises, Alphabet's revenue growth historically falls to near zero.

GOOG Revenue (Quarterly YoY Growth) Chart

GOOG Revenue (Quarterly YoY Growth) data by YCharts

Conversely, once the recession probability falls, Alphabet usually experiences above-average growth. This is my primary reason to invest in Alphabet, as its current business doesn't reflect the historical average.

Additionally, the stock trades at a historically cheap 20 times earnings, which should rise when advertising dollars return.

Alphabet isn't without flaws -- it hired nearly 34,000 employees in 2022, which caused its operating margin to drop 5%. This is a significant concern, but the bull side of this argument is that these new roles will help Alphabet tremendously as the economy recovers.

Still, I think there are more arguments for Alphabet than against it, and investors should consider picking up Alphabet shares in anticipation of a recovery.

2. The Trade Desk

The Trade Desk plays in a different area of the advertising market than Alphabet; its products are focused on advertising technology. Its software automatically bids on ad locations across the web for its clients, allowing them to use a data-driven approach to see who views the ads and if their ad campaign is working. 

Unlike Alphabet, The Trade Desk has grown revenue despite a challenging environment. That's because ad tech is still in its early innings, so companies are rushing to adopt it and make every penny of their advertising budgets count. In Q4, The Trade Desk grew revenue at a 24% pace. It's also profitable, generating $71 million in net income, a 14.5% margin.

Perhaps the best metric for gauging The Trade Desk's usefulness is its customer retention: It retained at least 95% of clients in Q4, marking nine consecutive years of meeting this level. This speaks to both the usefulness and stickiness of the platform, as customers don't typically leave once they're on the platform.

One mark against The Trade Desk is its valuation, which is relatively high.

TTD PS Ratio Chart

TTD PS Ratio data by YCharts

However, this valuation premium has been earned through consistent execution and a massive market opportunity. With the ability to place ads on connected TV, podcasts, mobile devices, and anywhere else the internet touches, the upside to The Trade Desk's reach is incredible.

The Trade Desk remains one of the best growth stocks to own in today's market, and when the advertising market recovers, it will likely see a renewed interest in companies looking to step up their advertising game. I'd be a buyer of the stock right now if you're willing to hold it for three to five years.