E-commerce stocks aren't getting much love these days. The ProShares Online Retail ETF is down 59% from highs set in February 2021. E-commerce giant Amazon (AMZN -0.15%) has done better a bit better but still has seen its stock price drop into correction territory. Shares of the tech giant are down 24.5% from all-time highs set last summer. Compare that with the 20.3% drop in the tech-focused Nasdaq-100, and you'll see that investors are wary of tech growth stocks and the e-commerce sector specifically.

After e-commerce blossomed at the start of the pandemic, a reopening economy has brought more consumers back into brick-and-mortar stores, putting pressure on online shopping platforms. And while Amazon has diversified its business over the years through categories like Amazon Web Services (AWS), Amazon Prime, and digital advertising, the company's top line is still largely dominated by online retail.

Hand scrolling online shopping site on cellphone.

Image source: Getty Images.

Amazon reported its second-quarter earnings on July 28, giving investors an update on the direction of its business moving forward in this volatile time. Let's review the tech behemoth's existing situation and see if it offers any clues on whether Amazon stock is a smart investment today.

How goes it for the e-commerce leader?

In its latest quarter, Amazon's top line overall sales climbed 7.2% year over year to total $121.2 billion. On the bottom line, Amazon reported a rare net loss of $0.20 per share, marking the second consecutive quarter of being in the red. As is the case with many other e-commerce companies at the moment, the primary cause of the loss was ongoing macro headwinds, including high inflation related to sharp rises in fuel, energy, and transportation costs.

Sales in Q2 from Amazon's e-commerce segment fell 4.3% year over year to $50.9 billion. E-commerce sales account for about 42% of total sales for the quarter. The drop can partially be attributed to tough comparisons to a strong Q2 in 2021. Even so, growth for the e-commerce leader was uneven, and it'll likely take an improvement in the economic environment for Amazon to get growth levels back to their five-year norms. 

Its closely watched Amazon Web Services cloud platform saw sales surge 33.3% to $19.7 billion, while its subscription services and advertising services categories expanded 10.1% and 17.5%, respectively, up to $8.7 billion and $8.8 billion. It was a pleasant surprise to see its advertising segment perform so well, given that ad-driven tech companies like Snap and Meta Platforms have struggled of late.

For the full fiscal year, Wall Street analysts expect the company's total revenue to increase 10.6% year over year to $519.5 billion, and its earnings per share to decline a whopping 80.9% to $0.62. In fiscal 2023, which is when year-over-year comparable metrics will come back to earth, analysts are forecasting top- and bottom-line growth of 15.8% and 303.2%, respectively.

Amazon management wasn't inclined to offer an update of full-year guidance with this latest report, but it did discuss what it expects for the third quarter. Management said net sales in Q3 would total $127.5 billion at the midpoint and grow 15% compared to Q3 2021. The guidance was tempered by concerns about unfavorable foreign exchange rates. Operating income is expected to be positive and hit $1.75 billion at the midpoint, compared with $4.9 billion in Q3 2021. This guidance doesn't account for business acquisitions, restructurings, or legal settlements, including the just-announced acquisition of Roomba robot vacuum maker iRobot for roughly $1.7 billion. 

What should investors do?

For investors with extended time horizons, Amazon stock remains a fail-safe long-term bet. Whenever the market falls out of love with a best-in-class stock, smart investors should interpret that as a clear buying opportunity. That's what we're watching unfold these past few months with Amazon -- the e-commerce company has confronted a string of headwinds, all of which are primarily short-term in nature. Hence, long-term investors can profit from this current sell-off by accumulating shares of the e-commerce leader today.