Effective customer engagement is crucial to the success of virtually every business, and the pandemic has only made that more evident. Office closures and travel restrictions limited in-person meetings, forcing enterprises to implement or strengthen their digital strategies.

Those tailwinds translated into big gains for Salesforce (CRM 2.61%) and Twilio (TWLO 1.36%), both of which specialize in digital communication. In the last 12 months, shares of Salesforce are up over 40% while Twilio has surged 260%. But both of these tech stocks still look like good investments -- even if the market crashes. Here's why.

Salesforce: The customer relationship specialist

According to research firm McKinsey & Company, 58% of customer interactions occurred digitally in the first half of 2020, up from 36% at the end of 2019. That shift emphasizes the need for customer relationship management (CRM) solutions that help enterprises provide clients with positive digital experiences. And when it comes to CRM, Salesforce is the best in the business.

Digital representation of interconnected customers.

Image source: Getty Images

This tech company has steadily reinforced its market-leading position in recent years -- in fact, in the first half of 2020, Salesforce captured nearly $0.20 of every $1 spent on CRM solutions. By comparison, Oracle took second place with a market share of just over 5%.

Notably, Salesforce has benefited from its first-mover status in the space, which has given it the time to develop an unrivaled CRM solution. Its Customer 360 platform is a suite of software that helps disparate enterprise teams -- think sales, marketing, commerce, and customer service -- unify data and collaborate efficiently to better serve their customers.

Last year, Salesforce delivered solid financial results with gains driven by the digital transformations made necessary due to the pandemic. Revenue jumped 24% in fiscal 2021, gross margin hit 74.4%, and free cash flow rose 11%.

Looking ahead, management believes the company will reach $50 billion in annual revenue by fiscal 2026. And according to CEO Marc Benioff, Salesforce is growing faster than any enterprise software company of its size ever has.

As a final note, Salesforce recently launched a new product: Hyperforce. This updated version of its Customer 360 platform allows clients to deploy Salesforce apps in public clouds, giving them access to benefits like enhanced elasticity (i.e., clients can easily scale their cloud computing resources up or down as needed).

In the coming years, Salesforce's innovative culture and market leadership should drive the company to even greater success.

Twilio: The customer engagement specialist

Twilio provides a communications-platform-as-a-service (CPaaS) with software tools that make it easy for developers to add features like chat, text, voice, email, and video to their applications. This translates into reduced cost and complexity for Twilio's clients, because they don't need to provision their own infrastructure or negotiate contracts with multiple telecom carriers around the world.

Its product suite also combines these tools into more complete solutions. For instance, Twilio Flex is the company's fully programmable contact center platform. It includes features like intelligent call routing and AI-powered chatbots, both of which improve customer service. And from the client's perspective, Twilio Flex offers more flexibility than any other contact center solution on the market.

Like Salesforce, Twilio is a market leader that benefits from its first-mover status. That advantage has helped Twilio add new customers and grow its top line quickly in recent years with both of those metrics more than quadrupling between 2017 and 2020. The company ended last year with revenue of $1.76 billion and more than 221,000 active customers.

But investors should be aware that Twilio is not currently profitable. Free cash flow came in at negative $26 million last year as the company continued to prioritize revenue growth over profits. However, its revenue net expansion rate hit 137% in 2020, meaning that its average customer spent 37% more last year with the company than they did in 2019. That suggests Twilio's investments are paying off.

Finally, in Nov. 2020, Twilio acquired customer data platform operator Segment. CEO Jeff Lawson explained the move, saying that data silos were the "biggest impediment" to digital engagement and asserting that this acquisition would allow Twilio to break down that barrier for its clients, enabling them to deliver great digital experiences to their own customers. 

This should make Twilio's platform an even greater asset, further solidifying the company's dominant market position.

A final word

In terms of valuation, Twilio trades at a pricey 32 times sales, while Salesforce sits at a more reasonable 10 times sales. In Twilio's case especially, this figure is near the high end of the company's historical range. In other words, Wall Street has big expectations for this tech company.

However, both Twilio and Salesforce are market leaders with a history of strong top-line growth. I expect that trend to continue in the years ahead, which should help justify the valuation in both cases.

Moreover, building lasting customer relationships and delivering exceptional customer service are of fundamental importance to virtually every business. And that's why both of these companies are solid picks with the necessary staying power for even a major market downturn.