Alphabet's (GOOGL -0.99%) (GOOG -1.01%) big reliance on digital advertising can be a boon in robust economic times, but a headwind in weaker ones.

The company's revenue was up just 3% in the most recent quarter (ended March 31), a sharp slowdown from previous years, showcasing this new macro reality. And Alphabet is focused on cutting costs where it can, with the layoffs of 12,000 employees making headlines. 

The market is reacting positively, though, with shares up 40% in 2023. But they are still down 17% from their all-time high. Does this make Alphabet stock a buy right now? Let's look at why I believe the answer to that question is a resounding yes. 

Still a leader in the global search market 

With the popularity of artificial intelligence (AI) and OpenAI's ChatGPT amassing 100 million monthly active users, many investors are wondering how this game-changing technology will alter the corporate landscape. Microsoft's Bing search engine, which has integrated ChatGPT, has gotten a lot of attention as a potential up-and-comer ready to threaten Google's dominance of the search industry. But this fear has so far been way overblown. 

According to Statcounter, Google Search, representing 58% of Alphabet's total ad revenue in the first three months of 2023, commanded a 92.8% share of the global search market in April, up from 92.6% in December, right after ChatGPT was introduced. Bing, on the other hand, has seen its share shrink from 3% in December to 2.8% in April. So to think that Google's incredible lead is going away anytime soon would be a terribly improbable take. So far, the numbers just don't show any signs of this happening. 

Alphabet is up in the clouds 

Google Cloud Platform (GCP) is Alphabet's answer to Amazon Web Services and Microsoft's Azure. In the most recent quarter, GCP increased revenue 28% year over year, a faster rate of growth than the 16% clip that AWS was able to post. This means GCP might be stealing market share.

And this segment turned its first operating profit in the first quarter, possibly a sign of increased profitability as we look ahead. 

GCP has a laundry list of top-tier companies as its client base, including Etsy, UPS, and Cardinal Health. With annualized revenue of close to $30 billion, and a market estimated to be worth $1.6 trillion by 2030, it's obvious that GCP has a huge growth runway. 

A culture of innovation 

Alphabet has long been a leader in AI, using the technology to improve search capabilities, provide updated traffic information in Maps, and to filter spam in Gmail, for example. Recently, however, CEO Sundar Pichai announced at the company's annual I/O developer conference that Alphabet will be using AI in its Workspace products, among numerous other tools. These AI initiatives show that innovation is far from dead at this big tech company. 

And while digital advertising gets the lion's share of attention at Alphabet -- not surprising given that it's the main revenue driver of the business -- the company's Other Bets segment is making moves. More specifically, Waymo, Alphabet's autonomous driving unit, just inked a partnership with Uber that would allow Uber customers to book Waymo rides starting in the Phoenix area. This might just be the first major step in getting Waymo's technology to the masses. 

Sizing up Alphabet's valuation 

Even though Alphabet shares have been on quite the run in 2023, they trade at a trailing price-to-earnings (P/E) of 27.6 and a forward P/E of 23.2 right now. I don't think this valuation is asking too much of shareholders. 

That's because Alphabet is still a dominant company with multiple growth drivers working in its favor. Digital advertising is a huge and growing industry, as is the cloud infrastructure market and the streaming industry, the latter of which is led by YouTube. 

Alphabet generated $17.2 billion of free cash flow last quarter, up 12% year over year. And the business' balance sheet currently has $115 billion of cash, cash equivalents, and marketable securities, giving it almost unlimited resources to continue investing in new initiatives to move the needle. 

Alphabet's stock looks like a solid buy today. Moreover, it could be a staple in your portfolio for the long term.