The past few years have been a roller-coaster ride for growth stocks. One company on a wild ride is PayPal (PYPL -1.71%). As the pandemic forced spending online and drove contactless payments, PayPal emerged as a clear winner. Its business was growing rapidly, and the stock price skyrocketed.

However, the past year-and-a-half hasn't been so smooth. Challenging market conditions and a shift in strategy have weighed on the company's performance. For those investing in PayPal at the start of 2020, the returns have fluctuated wildly, reflecting the company's turbulent journey.

A pandemic-era winner

PayPal saw staggering growth during the pandemic, which shifted consumer habits more toward online purchases. Over two years ending in 2021, the company added 122 million accounts, increased revenue by 43%, and surpassed $1 trillion in total payments volume. In February, management discussed doubling its active accounts and free cash flow by 2025.

However, things changed in the latter part of 2021. For one, eBay's move to its own self-managed payments system and abandoning PayPal happened faster than anticipated, which put pressure on PayPal's top line. Second, management's forecasts for revenue growth last year were reduced several times amid slowing growth as economic conditions tightened.

Finally, the company shifted away from adding customer accounts and toward boosting its transactions per active account (TPA). It did this because of slowing customer growth and sees growing TPA as a more cost-effective approach to increasing revenue.

If you bought $1,000 in PayPal stock at the beginning of 2020, you'd have this much

Investors who put $1,000 into PayPal at the start of 2020 have seen volatile swings in their investment. At one point, that investment would have reached $2,852 midway through 2021. However, if you held the stock through today, that investment would now be worth just $680.

PYPL Total Return Level Chart

PYPL Total Return Level data by YCharts

Moving toward efficiency

PayPal closed out last year with revenue growth of 8%, but its net income fell by 42%. One thing that altered the trajectory for PayPal was a $2 billion stake by the activist investor Elliot Investment Management last August. The investor wanted PayPal to focus on cutting costs and pursuing high-conviction, high-margin opportunities.

In the fourth quarter, revenue and earnings growth over the prior year were 7% and 19%, respectively. PayPal also saw its TPA rise 13% in the quarter, a sign that its plan to increase user activity is working. One growth driver was Braintree, a full-stack payment processing platform for large businesses. Braintree was largely responsible for PayPal's 5% year-over-year transaction growth last year. 

What to watch for

A slowdown in consumer discretionary spending due to inflationary pressures has hurt PayPal. That's because of its focus on online transactions, which are primarily on things that are nice to have but not essential. Chief Financial Officer Gabrielle Rabinovitch told investors during the fourth-quarter earnings call that PayPal's "revenue growth is highly correlated to discretionary e-commerce spending in our core markets."

PayPal will likely face headwinds in the near term if discretionary spending continues to slow. The stock trades at a cheap valuation relative to recent history. Its price-to-earnings (P/E) ratio is more than 35, but that ratio is just 15 based on projected earnings for this year. Its price-to-sales (P/S) ratio is also near its lowest valuation since going public in 2016.

PYPL PE Ratio Chart

Data source: YCharts, PYPL PE Ratio

PayPal stock has undergone much volatility over the past few years, but it continues to be the most widely accepted digital wallet in North America and Europe, with 79% of retailers accepting it. Given its cheaper valuation and widespread acceptance, PayPal is an appealing stock for investors willing to ride out any short-term volatility and hold it for the long haul.