Alphabet (NASDAQ:GOOG) (NASDAQ:GOOGL) reported its first-quarter earnings at the end of April, beating expectations handily. Revenue grew 26%, marking an acceleration over the previous quarter, but operating earnings only grew 7% year over year. That margin compression has investors worried.

If you're an Alphabet shareholder, or thinking about buying, this rise in costs needs to be understood -- if these are investments that drive high returns in the future, that would be a reason to buy. However, if increasing costs won't drive as much growth as in the past, they would be a reason for caution. Let's dig in to how Alphabet's executives are allocating your investment dollars.

a young woman makes it rain by flinging dollar bills at camera.

Is Alphabet investing for growth or just spending more? Image source: Getty Images.

TAC-y spending

The costs on which most analysts are fixated are Alphabet's traffic acquisition costs, or TAC. According to Alphabet's annual report, TAC payments go to a variety of outside parties, including "browser providers, mobile carriers, original equipment manufacturers, and software developers" to feature Google Search and AdWords on their platforms. This is important, because despite all of the ventures Alphabet is involved in, it still generates the majority of its revenue from advertising.

More and more of Alphabet's searches are coming on mobile, which carries higher TAC costs than desktop, leading to a 36% rise in TAC to almost $6.3 billion, making up 24% of revenue last quarter (up from 22% last year). Some believe rising costs are a result of a new agreement with Apple to remain the featured search engine on its Safari mobile browser.

This could be worrisome, as it seems Alphabet's basic costs of doing business are going up. However, CFO Ruth Porat explained TAC increases should decelerate starting in the current quarter, so this quarter may in fact be "peak TAC" growth. That would be a great sign, but we won't know until next quarter.

Hardware

Of course, the TAC problem would be mitigated if consumers were searching on Alphabet-manufactured devices. Thus, another major cost driver has been the development of hardware, including Pixel phones and the Google Home smart speaker. In fact, Alphabet acquired roughly 2,000 engineers from smartphone-maker HTC last September. Previously, Pixel phones had been designed by Google and manufactured by HTC, but now Google is taking more of these capabilities in-house.

Google is still early in the hardware game, and CEO Sundar Pichair said, "if you think about silicon, etc., the longer you can do it, the more advantages you have." Of course, in order to get there, investments in R&D, sales, and marketing will have to happen.

The big cloud

Alphabet isn't only resting on its core advertising business but branching out into the exploding world of cloud computing. Building out cloud infrastructure services is extremely expensive, with only a handful of companies with both the financial resources and technical expertise to compete. Alphabet is one of those companies, and it's investing furiously in order to catch up to established leaders. This entails not only building out data centers globally but also constructing massive undersea cables to connect them.

That's why cloud-related expenses (likey depreciation of data centers) made up the largest portion of non-TAC costs of revenue, according to management. Data centers in Tennessee and Alabama drove costs this quarter, with construction also going on at 20 different sites on four continents. The company's capital expenditures exploded to a whopping $7.3 billion last quarter, up from $2.5 billion a year ago. While $2.4 billion went toward the purchase of the Chelsea Market office building in New York, capital expenditures nearly doubled outside of that.

Content

Finally, Alphabet is ramping its Youtube video service by investing in proprietary content, both for ad-supported original shows and higher-end fare for its YouTube Red subscription. Paying for original content can get quite expensive, but again, Alphabet is one of the few companies with the resources to play in the streaming video world.

It would be remiss not to, as basically every other tech giant is looking to invest in proprietary original video content in some form or another. As the leader in user-generated video with Youtube, Alphabet can't afford to stay out of the streaming race.

Extraordinary opportunities

According to CFO Ruth Porat, "We the think the opportunity set ahead of us is quite extraordinary." Indeed, the chance to be one of only a handful of companies that can play in cloud computing, smart speakers, and streaming video is compelling, and with over $100 billion in cash to spend, Alphabet is forging ahead.

While investors never like to see margins contract and capital expenditures balloon, long-term investors should support the company for not resting on its laurels. Stick with Alphabet -- the company is investing in its future. 

Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Billy Duberstein owns shares of Alphabet (C shares) and Apple. The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), and Apple. The Motley Fool has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.