Considering that most of its sizable digital ad competitors produced lackluster results during the December 2022 quarter, investors were pleasantly surprised after The Trade Desk (TTD 3.96%) reported results that beat analysts' earnings expectations while giving an overall upbeat view of its prospects in 2023, sending the stock soaring 33%.

Although the stock has returned some gains since its earnings report, the market still has a very high valuation on its shares, despite highly valued growth stocks being out of favor in this highly uncertain market.

Given the still-bleak outlook of the current economy, should you consider buying this stock? Let's take a look.

A fantastic quarter and year

During the last six months of 2022, The Trade Desk began to differentiate and outperform the rest of the digital ad industry. And in the fourth quarter, its solid relative outperformance over its adversaries became even more apparent. While most of its large competitors only produced between -9% and -2% revenue growth in the December 2022 quarter, The Trade Desk posted fourth-quarter revenue growth of 24% to $491 million.

According to Dentsu's estimates, total global ad spending only grew 8% last year. What is impressive is that advertisers spent three times more than that on The Trade Desk's platform in 2022. The company reported its platform ad spending rose to $7.8 billion, driving full-year 2022 revenue growth of 32% to $1.58 billion.

A chart shows The Trade Desk's revenue growth.

Data source: The Trade Desk

Even more impressive is that in addition to producing revenue growth, it is one of the few high-growth companies that can consistently generate profits and free cash flow (FCF) during this downturn. The company created a full-year 2022 net income of $53 million and a positive FCF of $457 million.

TTD Free Cash Flow Chart

TTD Free Cash Flow data by YCharts

The company also has an outstanding balance sheet, with $1.45 billion in cash and short-term investments and no long-term debt. A significant plus is that management is so confident in its balance sheet and ability to generate FCF in the future that it also announced a $700 million buyback of its shares when reporting its fourth-quarter earnings.

The cherry on top is that, unlike many other ad technology companies, The Trade Desk responsibly managed its growth during the pandemic, focusing on profitable growth when the ad market was roaring. So as the ad market declined, it remained positioned to continue funding key initiatives that today are helping the company take market share and stay profitable. In contrast, many of its competitors are in retreat, canceling programs and laying off thousands of workers, as many companies overextended themselves when times were good.

The digital ad market is changing

A few trends are today combining to drive The Trade Desk's market share growth, with none more important than Connected TV (CTV). For close to a decade, Alphabet's Google and Meta Platforms have dominated the online ad market, but that dominance could be coming to an end. According to Insider Intelligence, 2022 was the first year in a decade that Meta and Google's combined share failed to exceed more than 50% of the digital advertising market.

Advertisers are starting to prefer CTV over apps like Facebook, Instagram, and YouTube. Those apps prevent aboveboard comparisons of advertising effectiveness and disappoint advertisers that require more transparency on ad pricing. On the other hand, CTV advertising is transparent in its pricing and allows the comparison of ad performance openly and objectively. Thus, advertisers can determine their return on investment much better on CTV -- important in this down market, where companies are looking to save money and do more with less.

The Trade Desk CEO Jeff Green believes the shift from traditional cable TV to CTV is accelerating and will soon reach a sharp tipping point, where viewers and advertisers will entirely shift to CTV -- fantastic for The Trade Desk, as the shift of advertising dollars from traditional to connected television is a core driver of its business.

Should you buy the stock?

The stock trades at a price-to-sales (P/S) ratio of 17.61 and a price-to-earnings (P/E) ratio of 549.70, a very lofty valuation that may prevent some from considering buying the stock. 

However, when you throw in the fact that the Department of Justice has a solid ongoing lawsuit against Google that will likely prevent it from putting up substantial opposition to The Trade Desk, there is a strong possibility that Jeff Green's company will rise to become a dominant player in what is a $1 trillion opportunity. Considering that the company is winning market share and has only penetrated 0.15% of the growing global advertising market, you can make a strong case that The Trade Desk is not valued highly enough.

If you are willing to accept the risk of investing in a highly valued stock in a down market, The Trade Desk is an excellent investment for those with a long-term mindset.