2022 has been a year of struggle for many stocks. While some stocks that are down on the year may not recover to their former highs, there are plenty of otherwise strong businesses that got caught up in the recent bear market.

Before the calendar turns to 2023, smart investors should be searching for strong businesses with long-term tailwinds that may be trading at attractive discounts. Two in particular that fit this description are Roku (ROKU -1.90%) and Amazon (AMZN -0.16%). Let's find out a bit more about these two discounted stocks you'll want to consider buying before 2023.

1. Roku's important growth metrics are heading in the right direction

After Roku reported its third-quarter earnings on Nov. 2, the stock took a hit as its results and guidance fell below expectations. However, beneath the headlines, the company posted encouraging results on the metrics most important to its future success.

While many consumers know Roku from its streaming devices and its integration into smart TVs, the business is built on advertising. Essentially, Roku's business model is to grow its active accounts, get users to stream more hours of video on its platform, and then monetize those users. On these three metrics, Roku continued to deliver.

Roku Key Operating Metrics

Q3 2021

Q3 2022

Growth (YOY)

Active accounts

56.4 million

65.4 million

16%

Streaming hours

18.0 billion

21.9 billion

21%

Average revenue per user

$40.10

$44.25

10%

Data source: Roku.YOY = Year over year.

These results are more impressive considering the challenging macro environment. Roku continues to absorb the higher cost of producing its hardware in order to remain a low-cost provider and grow active accounts. This is likely to remain a drag on margins until these production costs come down, but it has been necessary for the growth of the user base. 

Roku's user-friendly operating system makes it easy to navigate the ever-growing landscape of streaming content providers. The company also offers its own purchased and produced content through The Roku Channel, which was one of the five most popular channels on the platform in terms of streaming hours for the third consecutive quarter.

Perhaps most impressive was Roku's ability to increase its average revenue per user even in a challenging environment for advertising. The pressure on advertising budgets is likely to continue in the near term, and Roku's Q4 guidance reflects this. However, these should be short-term concerns. The shift from traditional linear TV viewing to streaming continues to outpace the shift in advertising spending to streaming. Roku stands to benefit for years to come as that gap closes.

2. Is Amazon becoming an advertising company?

Amazon became known to the world because of its e-commerce dominance. However, over the years, Amazon Web Services (AWS) emerged as a vital part of the business, consistently outpacing the other segments in both revenue and operating income growth.

Over the last several quarters, though, another revenue stream is picking up steam for the company -- advertising. In Q3, its advertising services revenue grew by 28% year over year, matching the growth rate of AWS. 

Advertising still only accounts for 7.5% of Amazon's revenue, but the share is rising. In Q3 2021, it accounted for 6.7%. Additionally, this growth was consistently strong for several quarters. Since Q2 2021, advertising revenue growth has never been below 20% year over year.

It will be some time before advertising becomes a material part of Amazon's business, but there are other reasons to be excited. AWS posted another strong quarter, with revenue increasing 27% and operating income growing 11%.

After the company reported its Q3 results, the stock sold off because it missed revenue estimates and offered weak Q4 guidance. These should be short-term concerns, but the market's reaction provided investors with an appealing discount. 

Amazon is still the dominant player in U.S. e-commerce, even as it adjusts its spending coming out of the pandemic, and AWS is the leader in a cloud infrastructure market that continues to rapidly expand.

The fact that Amazon can grow its advertising revenue in this challenging macro environment is a testament to how monetizable its user base is. It's reasonable to expect its advertising revenue growth will accelerate once economic conditions improve.

Buying shares at a discount

Both Roku and Amazon trade below their 5-year average price-to-sales multiples, and not far above their all-time lows.

ROKU PS Ratio Chart

ROKU PS Ratio data by YCharts.

Considering that most of their recent struggles can be tied to the macroeconomic environment and not to material business weaknesses, I think both companies are compelling at today's discount prices.