Twitter (NYSE:TWTR) investors have had a lot to cheer about in 2018: GAAP profitability for four straight quarters, continued daily active user growth despite pressure on monthly users, and strength in first-party ad revenue.

Shares are up about 40% on the year thanks to Twitter's continued focus on profitable users, increasing engagement, and growing its advertising business. Meanwhile, competitors such as Facebook (NASDAQ:FB) and Snap (NYSE:SNAP) are down about 21% and 56%, respectively, for the year, and the S&P 500 is up just 2% on the year.

Here's why Twitter has outperformed in 2018.

A reception desk surrounded by wood paneling with a Twitter bird emblazoned on the left side.

Image source: Twitter, Copyright Aaron Durand (@everydaydude) for Twitter, Inc.

A return to revenue growth

Twitter's revenue declined through the first three quarters of 2017 and was down 3% for the full year. At the start of the year, Twitter said it expects to show sequential growth consistent with what it saw in 2017. So far, Twitter has shown significant revenue growth acceleration.

Revenue grew 21% in the first quarter, and that climbed to 29% growth in the third quarter.

Period

Revenue Growth (YOY)

Q1 2018

21%

Q2 2018

24%

Q3 2018

29%

Data source: Twitter. YOY = year over year. 

Revenue growth is fueled by growth in ad impressions, particularly video ads. More than half of Twitter's revenue comes from video ads, and the company has been investing heavily in live video.

Twitter has signed nearly 100 new agreements for video content. Unlike Facebook, which is paying up front for video content from its partners, Twitter has signed revenue-sharing agreements. That pushes the company to monetize these videos quickly, and it's done just that.

Twitter's focus on video has provided opportunities for it to show more video ads, both within users' timelines and within live videos. But those impressions aren't worth as much as Twitter's old direct-response advertisements. As such, Twitter's average cost per ad impression has declined considerably. That said, the rapid growth in ad impressions has offset the price decline.

Daily active users still growing

While monthly active users declined this year, daily active users continued increasing. DAUs climbed 9% in the third quarter, breaking a streak of seven straight quarters with double-digit year-over-year growth in DAUs. Meanwhile, MAUs are down 2% from the start of the year.

Monthly users have declined for various reasons. Twitter has redoubled its efforts to reduce spam and abuse on its platform, deleting millions of accounts to improve the overall health of its service. The company developed systems to identify spammy automated accounts, which has a greater impact on monthly users than daily users.

There's still a big opportunity for Twitter to grow engagement. Less than half of its monthly users log in on any given day. Continuing to push users to new video content could be the driving force behind DAU growth. Snap is taking a similar approach to reinvigorate DAU growth, investing heavily in original video content for its platform.

A profitable company

Twitter's fourth-quarter report, released in February, showed that the company is capable of producing a profit on a GAAP basis. Twitter continued that trend through the next three quarters, posting better-than-expected earnings over the last three quarters.

Twitter is expected to improve its profitability next quarter and next year, although analysts expect bottom-line growth to slow.

Twitter's continued efforts to improve the health of its platform, its investments in video content, and its push to drive more advertisers to its platform could put a bit of pressure on profits next year. Still, analysts expect to see some profit expansion. Facebook, likewise, is making efforts to improve the safety and security of its platform, and it said investments on that end will negatively impact operating margin for 2019.

Twitter's strong results in 2018 haven't gone unnoticed by the market. It appears well-positioned to keep growing both the top and bottom lines in 2019, but that growth could slow considerably, especially if it can't reaccelerate daily active user growth and engagement back into the double-digits. After the market drove the stock price up about 40% this year, investors may want to consider if all of the upside of continued profit growth is already priced into shares.

Adam Levy owns shares of Facebook. The Motley Fool owns shares of and recommends Facebook and Twitter. The Motley Fool has a disclosure policy.