What happened

Shares of Alphabet (GOOG -2.71%) (GOOGL -2.56%) have climbed roughly 20% so far in 2017, according to data provided by S&P Global Market Intelligence, after the company beat analysts' earnings consensus in two of three quarters this year. 

So what

The first few months of this year weren't all that impressive for Alphabet investors. The company's share price was relatively flat for the first two months of 2017. Investors likely weren't enthused that the company didn't beat analysts' earnings estimates in the fiscal fourth quarter.

But things started turning around for the company's share price leading up to Alphabet's first-quarter fiscal 2017 report in late April. That optimism didn't leave investors disappointed, as Alphabet reported revenue of $24.7 billion, up 22% year over year, and earnings per share of $7.73 beat analysts' consensus estimate of $7.38.

Stock chart on dark background.

Image source: Getty Images.

Alphabet's share price retreated a bit toward the end of June and early July, but started ticking back up before the company's second-quarter results in late July. Google's parent company ended up beating analysts' consensus estimates once again, with revenue rising 21% to $26 billion and EPS coming in at $5.01, which was much higher than the $4.44 that analysts expected. Alphabet had to pay out a massive $2.7 billion European Commission antitrust fine in the quarter, which investors certainly didn't like, but it didn't do much to take away from the company's share price gains this year.

Now what

Alphabet didn't provide guidance for the upcoming quarter, but investors should be optimistic about the company's future. Ruth Porat, Alphabet's CFO, said on the call:

Almost two years after the creation of Alphabet, we see the benefits of our focus within Google and Other Bets and are pleased with the opportunities we have for sustained revenue and earnings growth. ... Longer-term, we see great opportunity in the businesses we are building in Other Bets.

Alphabet's ad sales continue to drive the company's revenue, but the company's other bets -- like cloud computing -- remain a bigger part of the business, and that should help investor sentiment to stay positive going forward.