With two consecutive quarters of negative GDP, it's becoming more clear that the U.S. economy is slowing. While there is some disagreement about whether we are in a recession (recessions aren't official until the National Bureau of Economic Research says so), The sustained negative GDP doesn't bode well for businesses, including those focused on advertising.

The advertising budget is one of the first expenses to get cut by a business during difficult economic periods. Investors have noticed this fact and begin to shun stock from any company that primarily derives its revenue from advertising.

This goes a long way to explaining Alphabet's (GOOG 0.74%) (GOOG 0.74%) stock price drop in 2022, as it is down more than 21% from its all-time high. It also partly explains why the stock rallied about 10% on the day following the release of its second-quarter earnings as news about ad revenue was encouraging.

While this short-term volatility in the stock price can be stressful, investors with a long-term (three to five years) investing strategy should look at the volatility for its buying potential. It's pretty clear that some investors did after seeing the Q2 earnings. So, with Alphabet's Q2 results in mind, how are the company's prospects shaping up over the next three years? Let's find out.

Short-term ad headwinds

As mentioned, ad revenue is getting harder to come by. Alphabet's advertising segments reported revenue of $56.3 billion, which is up only 11.6% year over year. That growth rate is comparable to Alphabet's lower growth rate in pandemic-affected 2020. Overall revenue came in at $69.7 billion, a 12.6% increase year over year. Additionally, Alphabet's operating margin fell to 28%, down from 31% the prior year, causing earnings per share to fall from $1.36 in Q2 2021 to the current $1.21.

What insights do these metrics offer about Alphabet going forward? Well, first thing to note is that revenue is still growing at double-digit percentages, even in a down year. Then there's the fact that Google Search's advertising segment is exceptionally resilient. It grew 14% year over year in Q2 and proved to investors that businesses will continue to spend their reduced ad budgets where they will get the best returns, which points to that being Google. Although advertising as a whole may not be recession-proof, Google search might just be.

Another insight from the report suggests that YouTube does not hold the same advertising power as the Google search engine. YouTube revenue was only up 5% for the quarter, indicating advertisers are pulling back on some discretionary ad spending. But even here, Alphabet management was touting the strength of YouTube as an advertising vehicle. On the earnings call, management pointed out that connected TV (CTV) ads like those found on YouTube were 3.1 times more effective than traditional TV ads. While this segment is seeing short-term headwinds, it could produce great results as more advertisers discover the benefits of advertising through CTV channels instead of cable.

Google Cloud continues to grow

But the advertising segments that currently power Alphabet's revenue growth are not what excites me about Alphabet's three-year prospects. My thoughts about Alphabet's future are more in the clouds. The big three providers in the cloud computing market are Amazon (AMZN -1.64%) Web Services (AWS), Microsoft (MSFT 0.37%) Azure, and Google Cloud. As of Q1 2022, the three companies' market share in the first quarter of 2022 looked like this:

Amazon Microsoft Alphabet Next 10 Companies Combined
33% 22% 10% 21%

Data source: Synergy Research Group.

Clearly, Alphabet is a distant third in the cloud computing race at this point on the track. But to keep the analogy going, we are still very early in this race. The market opportunity in cloud computing is so big that Alphabet doesn't need to claim first place for the cloud to have a big positive effect on its revenue growth.

Altogether, the cloud computing market had trailing-12-month revenue of $191 billion in the first quarter of 2022. By 2030, the market opportunity is projected to be over $1.6 trillion. No cloud-focused company has scratched the surface of what the final market will be, which is excellent news for Alphabet.

In Q2, Google Cloud revenue grew 36% year over year to $6.3 billion, exceeding the growth rate of market leader AWS (33%), but trailing the growth rate of Azure (40%). Unfortunately, the strong focus on growth means that Google Cloud's bottom line has been negative to this point, while AWS is profitable (investors have no visibility of Azure's profit margins).

Management is committed to growing Google Cloud and will continue spending heavily on it while cutting back in other areas. If Alphabet can take market share and reach AWS levels of profitability (AWS' operating margin was 29% in Q2), it should have a massive impact on the company's financials in three years.

Say Alphabet grows its Cloud business by 35% annually into 2025. That means its Q2 revenue would be about $15.4 billion. While still less than AWS' current $19.7 billion Q2 revenue, if added to Alphabet's Q2 total, the Google Cloud growth would only increase total revenue by about 13%. However, if it can turn the profitability corner and generate a 30% operating margin, Alphabet's operating income will rise 28% in Q2 2025 if nothing changes from Q2 2022.

Where will Alphabet be in three years?

Google Cloud has the potential to influence Alphabet's future results substantially. Although it gets lost under Alphabet's massive advertising business, it is one of the best growth reasons to own this stock.

There's a lot that could happen over the next three years, but the resilience of the Google Search engine, the coiled spring of YouTube ads, and a massive industry shift propelling Google Cloud make this a top stock to own for the next three to five years. Investors can't afford to miss this stock and should use any opportunity to open or add to a position.