Twilio's (TWLO 0.88%) stock more than tripled in 2020 as the cloud services provider generated robust growth throughout the pandemic. That wasn't surprising, since Twilio's platform processes calls, text messages, videos, and other content for mobile apps, which bored users devoted more time to throughout the crisis.

But as investors look ahead toward a post-pandemic world, they might wonder if it's time to take profits in Twilio and buy some pandemic-stricken stocks that are trading at lower valuations. Let's take a look back at Twilio's performance in 2020, including its strengths and weaknesses, and see if it will head higher in 2021.

A person uses a smartphone next to a window.

Image source: Getty Images.

Why did the bulls rush to Twilio?

In the past, developers integrated calls, text messages, and other communication tools into apps by themselves. That process was buggy, time-consuming, and difficult to scale as an app attracted more users.

Twilio simplified that process with APIs (application programming interfaces), or snippets of code that developers paste in an app. The APIs outsource features to Twilio, which does the heavy lifting with its cloud services -- which can scale alongside an app's growing user base.

For example, Twilio helps Box verify users' identities via text message, Lyft passengers message their drivers, and Airbnb guests reach their hosts. Twilio's first-mover's advantage in this niche gives it an edge against rivals like Vonage's (VG) Nexmo, Bandwidth (BAND 0.14%), and MessageBird.

That's why its revenue rose 44% in fiscal 2017, 63% in 2018, and another 75% in 2019. Its takeover of SendGrid, which it lapped last February, significantly boosted its revenue last year.

In the first nine months of 2020, Twilio's revenue rose 51% year over year to $1.21 billion. It finished the third quarter with over 208,000 active customer accounts, up 21% from a year ago, while its dollar-based net expansion rate (its revenue growth per existing customer) rose from 132% to 137%.

Twilio expects its revenue to rise by about 47% for the full year. It didn't offer any guidance for 2021, but analysts expect 32% revenue growth.

Why are the bears wary of Twilio?

Twilio's revenue growth looks robust, but it's still deeply unprofitable. On a GAAP basis, its net losses widened significantly in 2017, 2018, and 2019.

In the first nine months of 2020, its net loss widened again year over year from $217 million to $312 million. The biggest weight on its bottom line was its stock-based compensation expenses, which rose 21% year over year to $238 million.

On a non-GAAP basis -- which excludes its stock-based compensation and other variable costs -- Twilio generated a slim profit in 2018, 2019, and the first nine months of 2020. However, Twilio's massive stock bonuses boosted its number of outstanding shares by more than 70% over the past three years:

TWLO Shares Outstanding Chart

Source: YCharts

That rising share count prevents Twilio's valuations from cooling off even as it generates double-digit revenue growth every year. The stock trades at 23 times next year's sales, and it could become increasingly difficult to justify that premium if its growth decelerates in 2021.

At the same time, Twilio's adjusted gross margins -- which came in at 55% in 2017, 55% in 2018, and 58% in 2019 -- contracted quarter over year and year over year throughout the first nine months of 2020:

Period

Q1

Q2

Q3

Non-GAAP Gross Margin in 2019

58%

59%

58%

Non-GAAP Gross Margin in 2020

57%

56%

55%

Source: Twilio.

Twilio attributed that ongoing decline to new A2P (application to person) SMS fees levied by Verizon, which are now charged whenever an app accesses a carrier's SMS network. Twilio expects other major U.S. carriers to "follow suit" in the near future. It also noted that the dollar's weakness against other currencies, especially the euro, was exacerbating that pain.

Those two headwinds, which together reduced its gross margin by 230 basis points in the third quarter, won't wane anytime soon. Meanwhile, rising competition from MessageBird, which notably pulled Uber away from Twilio, could throttle its ability to raise prices.

In short, Twilio's GAAP losses will likely keep widening, its number of outstanding shares will keep rising, and its margins will remain under pressure -- even though CFO Khozema Shipchandler claimed its gross margins would gradually "creep above that 60% range" during last quarter's conference call.

There are better growth stocks to buy in 2021

Twilio's stock probably won't crash in 2021, but it also won't replicate its jaw-dropping gains from 2020. There are plenty of other high-growth tech stocks to choose from, and many of those companies generate stronger revenue growth or bigger profits, or they face less competition than Twilio.

Twilio's core business still looks solid, but I'd like to see the company reduce its dependence on stock-based compensation and stabilize its gross margins before I consider buying any shares.