Good investing doesn't always feel good; we all want to buy when stocks are ripping higher and run away when the markets fall lower. But buying high-quality stocks when they go on sale can be a profitable strategy over the long term.

Here are three stocks that have been beaten and bloodied yet continue to show long-term promise.

1. Pinterest

Investors soured on visual search engine platform Pinterest (PINS 0.89%) after its monthly active users declined sequentially from 478 million in first-quarter 2021 to 454 million in second-quarter 2021. It's considered a social media stock, where engagement is the number one factor most investors tend to look for because more eyeballs can lead to more revenue from advertisers.

Person posting a picture of a satchel for sale online.

Image source: Getty Images.

The stock sold off from its highs near $90 earlier in the year to near $50 per share today. But is this steep drop deserved? CEO Benjamin Silbermann attributed the decline to users spending less time on their phones as the pandemic started to fade. He noted that most of Pinterest's lost users were desktop users, who tend to be less engaged on the platform. This seems reasonable, and when put in context with the company's monetization opportunity, the drop becomes more noise than substance.

Pinterest is incorporating e-commerce-friendly features into the app, giving users the ability to shop via its user posts, called "Pins." In Q2 2021, Pinterest's average revenue per user grew 89% year over year, helping drive overall revenue growth of 125% for the quarter compared to 2020, despite tough 2020 comparables. This doesn't seem like a company struggling to grow, but rather a business with strong operating momentum, making the stock attractive at the forward price-to-sales ratio of 12 it now trades at.

2. Fiverr

The return to post-COVID life has caused online freelancing marketplace Fiverr International (FVRR 4.07%) to stub its toe during its most recent quarter as well. Management reduced its full-year 2021 revenue guidance, originally ranging from $302 million to $308 million, to a lower range from $280 million to $288 million. Investors responded by sending the stock lower, and it now sits in the $170s from its high of $336.

But after doing $189 million in revenue in 2020, the height of pandemic lockdowns, the company's newly guided revenue would still amount to 52% growth for the year. Fiverr is seeing more active buyers (up 43% year over year in Q2) and spend per buyer (up 23% year over year in Q2), so the primary levers of revenue growth remain strong.

Fiverr and its chief competitor Upwork are the two primary online freelancing platforms in an industry that is large, fragmented, and largely offline still; management estimates that the company's addressable market is approximately $115 billion. The stock's price-to-sales (P/S) ratio has fallen to 22, so while the stock isn't a "bargain," its valuation has improved dramatically from its highs and seems reasonable for an investor holding for the long term.

3. Marqeta

Stocks sometimes sell off months after going public, and cloud-based payment card issuing company Marqeta (MQ 4.05%) is experiencing a post-IPO hangover of its own. Shares are down to $20 per share after hitting as high as $32 shortly after the stock started trading.

The company has only reported one quarter as a public company. The results were impressive, including 76% year-over-year growth in revenue and gross payment volume in its 2021 second quarter. Marqeta powers fintech companies' payment cards, both digital and physical, including Square, Uber, Doordash, Instacart, and various companies in the growing Buy Now, Pay Later industry such as Affirm, Klarna, and Afterpay. These customers are all experiencing rapid growth in their businesses, which should trickle through to Marqeta because this company provides the infrastructure behind their operations.

The stock wasn't cheap when it went public. With analysts expecting Marqeta's full-year revenue to come in around $478 million, the stock's current P/S ratio of 23 seems reasonable for long-term investors because of the company's big-time customer list and long-term growth opportunities. The fintech industry is worth trillions, and these growing customers could help Marqeta grow steadily over time.