Alphabet (GOOGL 0.49%) (GOOG 0.59%) reported second-quarter 2022 results after the market close on Tuesday. Following the release, Class A (GOOGL) and Class C (GOOG) shares of the Google parent and technology giant popped 4.9% and 4.8%, respectively, in Tuesday's after-hours trading session.

Given investors' positive initial reaction, one might assume earnings beat the Wall Street consensus estimate. However, this wasn't the case. The bottom line fell short of the analyst expectation, while revenue came in roughly on target. 

What's going on? Investors were relieved that the overall results weren't worse. Specifically, they were relieved that Alphabet's slowdown in ad sales wasn't as bad as many feared it might be. These concerns largely stemmed from Twitter and Snapchat parent Snap releasing Q2 results last week that were quite disappointing. 

Here's an overview of Alphabet's second-quarter results centered around four key metrics.

Exterior view of Alphabet headquarters with "Google" sign on glass wall of the multi-story building.

Image source: Alphabet.

1. Revenue rose 13%

Alphabet's net sales increased 13% year over year (and 16% in constant currency) to $69.7 billion, which was essentially in line with the $70 billion Wall Street had expected. Growth was driven by Google Search and Google Cloud. 

The company's top-line result was quite solid given the current challenging macroeconomic environment and the fact that it faced a tough comparable. The year-ago quarter's robust revenue growth of 62% year over year reflected "elevated consumer online activity," CFO Ruth Porat said in that quarter's earnings release. The pandemic-driven increase in consumer internet use is probably largely over.

Traffic acquisition cost (TAC) took a $12.2 billion bite out of revenue, up 12% from the year-ago period. 

For context, in the first quarter, Alphabet's revenue increased 23% year over year (and 26% in constant currency) to $68 billion. 

Here's how Q2 revenue broke out:

Segment Q2 2022 Revenue Change (YOY)
Google Search and other (advertising) $40.7 billion 14%   
YouTube advertising $7.3 billion 5%
Google Network (advertising) $8.3 billion 9%
Google advertising total $56.3 billion 12%    
Google other $6.6 billion (1%)
Google Services total $62.8 billion 10%
Google Cloud $6.3 billion 36%
"Other bets" $193 million Flat
Hedging gain (loss) $375 million Loss of $7 million in the year-ago period
Total  $69.7 billion 13%

Data source: Alphabet. YOY = year over year.

For context, in the first quarter, total ad revenue jumped 22% year over year. Ad revenue for Google Search and other, YouTube, and Google Network rose 24%, 14%, and 20%, respectively.

Of the company's ad segments, YouTube's year-over-year growth decelerated the most from the first quarter. Competition from TikTok was no doubt a factor, as various analysts and financial writers are opining. That said, investors should keep in mind that YouTube had an extremely tough comparable. The video-streaming platform's ad growth was a torrid 84% in the year-ago period.

2. Operating income inched up 0.5%

Operating income based on generally accepted accounting principles (GAAP) edged up 0.5% year over year to $19.5 billion. Operating margin (operating income divided by revenue) was 28%, down from 31% in the year-ago period.

Google Services contributed all the operating income (and then some), as the Google Cloud and "other bets" segments had operating losses. 

Google Services' operating income rose 1.9% year over year to $22.8 million. Google Cloud's operating loss widened 45% to $858 million, and other bets' operating loss widened 21% to $1.7 billion. (Segment operating results don't add up to the company's total operating income because there was $773 million in unallocated corporate costs.) 

3. EPS declined 11%

GAAP net income landed at $16 billion, down 14% from the second quarter of last year. That translated to earnings per share (EPS) falling 11% to $1.21. Wall Street was looking for EPS of $1.30, so the company missed this expectation.

4. Operating cash flow fell 11%

Alphabet's operating cash flow was $19.4 billion, down 11% from the prior-year's quarter. The company ended the period with cash and cash equivalents of $17.9 billion, down from $23.6 billion in the year-ago period.

Alphabet's Q2 in one word: resilient

Alphabet's Q2 results were certainly not ideal. That said, they were decent in the context of the challenging macroeconomic environment, which includes high inflation, slowing economic growth, and recessionary fears. So, it makes sense that investors seemed to be satisfied with the company's report.

On Thursday after the market close, investors will learn if Amazon's second-quarter results -- including its ad sales -- were as resilient as Alphabet's. Click here for Amazon's earnings preview.