Amazon (AMZN 1.30%) is having a challenging time adjusting to the reversal of the e-commerce surge it experienced at the pandemic's onset. Now that billions of people have been vaccinated against COVID-19, and people are, by and large, less concerned about social distancing, the amount of shopping they're doing in-store is rising again. Some investors might consider that a red flag for the stock.

Yet even with that in mind, there are at least two green flags for long-term investors in Amazon: Its more-profitable web services segment is thriving, and it has developed a robust advertising business. 

A person opening a package.

Image source: Getty Images.

1. Amazon Web Services 

In the first quarter, Amazon's overall revenue increased by 8% from the prior-year period. At the same time, revenue from Amazon Web Services rose by 37%, accelerating from 32% growth a year prior. The tech giant is benefiting from its leading position in cloud-based services as businesses look to move more of their digital infrastructure off-premises.

AMZN Revenue (Quarterly YoY Growth) Chart

AMZN Revenue (Quarterly YoY Growth) data by YCharts

For businesses and other institutions, the advantage of moving computing and data storage to the cloud is that it relieves them of sizable fixed capital investments and replaces them with recurring expenses based on usage. According to the researchers at Statista, in 2022, global spending on cloud computing is expected to grow by 20% to $495 billion. But with spending on global IT services at over $1 trillion annually, that still leaves room for the cloud industry to grow.

Amazon generated $18.4 billion from its web services segment in Q1, for an annual run rate of $73.6 billion. Perhaps more importantly, its operating income was $6.5 billion. A dominant position in a highly profitable, fast-growing business is a green flag, to be sure.

2. Advertising revenue 

Similarly, Amazon's advertising revenue increased by 25% year over year in Q1 -- faster than the overall business. Over the past four reported quarters, it generated $32.6 billion in ad revenue. To put that figure into context, roughly $114.5 billion of Meta Platforms' (META 2.98%) $118 billion in revenue in 2021 came from advertising, and $211.6 billion of Alphabet's (GOOG 1.25%) (GOOGL 1.27%) $258 billion in 2021 revenue was ad-based.

True, Amazon may not challenge the two digital advertising giants for leadership in that space anytime soon, but it is winning a meaningful share of the $763 billion global online advertising market. Amazon boasts over 200 million Prime members, and marketers covet the opportunity to influence the purchase decisions of this robust base of buyers who are one click away from purchasing. Meta and Alphabet may have billions of active users across various platforms, but people's purchasing activities happen largely outside those two companies' ecosystems.

A merchant who advertises on a Meta or Alphabet platform has to bring the user from that property over to its own website, where it must then persuade the buyer to purchase. A compelling advertisement in the right spot on Amazon can generate a purchase with far less effort. It's no surprise that Amazon has been quickly gaining favor with marketers. 

While Amazon's e-commerce sales will face headwinds as consumers return to their pre-pandemic shopping habits, AWS and its advertising business will keep supporting its long-term growth