Since its initial public offering in spring 2015 running up to its all-time high in November 2021, shares of Etsy (ETSY 0.34%) skyrocketed 890%. Driven by robust demand for its differentiated product offerings, the company grew rapidly.

But it's been a wildly different story since then. As of this writing, the e-commerce stock is down 76% from that peak. Investors are now staring at what might be a compelling buying opportunity.

It might be a good idea to invest $1,000 into Etsy's beaten-down shares, with the intention of holding for the next five years.

Recognize the near-term challenges

Gross merchandise sales (GMS) measure the dollar volume of transactions that occur on Etsy's various marketplaces during a specific period of time. In 2023, the business reported total GMS of $13.2 billion. This was down 1.2% from 2022, and it was down 2.5% compared to 2021. In other words, in the last 24 months, we've seen total spending activity on the platform essentially remain flat.

Consequently, we can't ignore that Etsy's business has hit the brakes. Management has called out a challenging macroeconomic environment that is pressuring spending on consumer discretionary purchases. Some of Etsy's largest product categories are home furnishings, jewelry, and apparel, items that people can delay buying when times get tough and budgets get stretched.

Data from the Federal Reserve shows that e-commerce spending has somewhat leveled off in the past couple quarters in the U.S. This doesn't bode well for Etsy.

The positive spin, though, is that Etsy's 2023 GMS total was up 165% compared to pre-pandemic 2019. This is a much larger business than it was just a few years ago, and it doesn't appear to be giving up any meaningful GMS gains. That's certainly an encouraging sign.

Think about the bigger picture

For an investor who can adopt a long-term mindset, this business possesses no shortage of positive attributes. Over a five-year time horizon, it's best to focus on the factors that really matter to Etsy's success.

For starters, Etsy is a massive online marketplace, with 96.5 million active buyers and 9 million active sellers. This means the company benefits from a powerful global network effect, which is a strong source of an economic moat. This protects Etsy from the threat of competitive forces.

That's because it would be almost impossible to start a two-sided marketplace like this from scratch, as you would need to find enough buyers and sellers. And as Etsy gets larger, it becomes more valuable to its user base. Buyers have more places to spend money. And sellers gain exposure to a worldwide customer base.

Another reason to like the company is because it consistently posts positive earnings. Even in a difficult operating period, Etsy reported net income of $308 million last year. And its 2023 operating margin of 12.7% was much higher than just five years back.

Generating positive free cash flow is also a normal occurrence. Etsy not only has enough capital to reinvest in growth opportunities, marketing efforts, or product development improvements, but it also has extra cash left over to direct toward share buybacks. This is the mark of a financially sound business.

Like many other tech enterprises that registered monster growth during the pandemic days, but that are now dealing with more subdued demand trends, Etsy has embarked on efforts to streamline its operations, including laying off a sizable portion of its workforce. The hope is that this creates a more efficient and focused organization going forward.

Investors who can look past those previously mentioned challenges, particularly around the state of the economy, should be rewarded over the long term. The economy spends more time in expansionary mode than it does in downturns. And even better, Etsy benefits from the ongoing rise of e-commerce spending.

Given that the shares trade at a dirt-cheap forward P/E ratio of 15.4, spending $1,000 on the stock and holding for the next five years could prove to be an extremely lucrative financial decision.