Advertising has been around forever, and it's pretty good at evolving to find potential customers where they like to gather. That is a big part of why advertising budgets are steadily going from old-fashioned mediums like print and network television to digital ones like streaming and the internet. Streaming company Roku (ROKU -10.29%) and ad-tech platform The Trade Desk (TTD 1.67%) have differences, but digital advertising sits at the core of what they both do.

The core for these two companies is facing some macroeconomic pressure at the moment as inflation slows consumer spending and rapidly rising interest rates lower short-term advertising forecasts. Ad-spend growth could dramatically slow in 2023 as recession fears overhang the economy. These concerns worried investors of both of these ad-tech stocks and lowered stock prices significantly.

In light of all this, which of these two stocks is the better buy today? Let's dig in to find out.

The Trade Desk is outperforming Roku

If your company makes money on ads, the current economic environment is troublesome. Social media companies are laying off staff and tightening budgets, citing the difficult economic conditions, which means ad spend is slowing. Research from WARC estimates global ad spending will grow 8.3% this year but will slow to 2.6% growth in 2023. But the spending drop is not impacting companies equally.

You'll see the anticipation of tough times ahead if you look at revenue guidance from Roku and The Trade Desk. Roku is guiding for third-quarter revenue of $700 million; it's just a $20 million increase (about 3%) over 2021 Q3 revenue. Compare that to a year ago when Roku's 2021 Q3 revenue of $680 million represented a 51% year-over-year increase, and it raises concerns about a dramatic slowdown. In comparison, The Trade Desk is guiding for $385 million in revenue for the third quarter of 2022, a 28% increase over the previous year's third quarter. The $301 million Trade Desk posted in revenue during Q3 of 2021 was a 39% jump over 2020, so you can see that growth is slowing for The Trade Desk, but not nearly as much as Roku's.

The Trade Desk is also a far more profitable business than Roku. The Trade Desk is a demand-side ad platform that helps brands set up and run ad campaigns; it's a software business that carries the appropriate gross margins at nearly 82%. The company's already grown large enough to generate positive free cash flow; you can see how both compare to Roku's below.

ROKU Gross Profit Margin Chart

ROKU Gross Profit Margin data by YCharts

Roku has built its demand-side ad platform called Roku OneView, but it's not a pure software business. The company sells various hardware products, dongles, and streaming sticks to consumers to get them into the Roku ecosystem. Roku intentionally sells these at a loss, which has only gotten worse as inflation has increased production costs. Roku's gross margin for its hardware business was a negative 24% in the second quarter. This drags everything down, though Roku's overall gross margins are a still a respectable 48% and should increase as the ad platform grows.

Wall Street is well aware and prices each stock accordingly

Compared to Roku, The Trade Desk is growing faster and is more profitable; thus, the stock commands a higher valuation. You can see below just how large the gap between the two is. The price-to-sales ratio (P/S) of The Trade Desk is eight times that of Roku:

TTD PS Ratio Chart

TTD PS Ratio data by YCharts

Famed investor Warren Buffett once said, "It's far better to buy a wonderful company at a fair price, than a fair company at a wonderful price." But one might argue that it's not quite that simple. For example, is The Trade Desk such a better business than Roku that it deserves an eight times more expensive valuation? Roku's in a tough battle for dominance in streaming, but it is seemingly doing well. Roku has an estimated 50% share of the connected-TV market in North America, and there are still twice as many households in the U.S. that still use broadcast or cable television. Roku is also expanding in new international markets like Germany; there seems like a lot of room left for user growth to continue, and the eventual rebound in advertising spending could bring a renewed spark to revenue growth. In other words, Roku's story doesn't appear to be over, even if short-term growth has stalled.

The verdict

An investor can own The Trade Desk and will likely do very well over the coming years. It's an industry leader thriving as an independent platform versus the "walled garden" advertising models that companies like Meta Platforms and Alphabet operate. It would be a great buy. However, I think Roku, at this valuation, is too hard to pass up and is currently the better buy.

Roku is an industry leader in its own right (streaming) that also happens to be experiencing a (potentially short-term) double-whammy headwind from slowing ad-spend growth and high inflation. That is hurting its hardware margins. Looking ahead as a long-term investor I see a potential future where Roku's user base is much larger than the 63.1 million accounts it has today. The company's financials could drastically improve if it can grow and better monetize its user base over the coming years.