E-commerce took a breather in 2022 as difficult comparisons with 2021 and macro headwinds cooled off growth across most of the sector.

However, that doesn't mean the high-growth days in the sector are gone for good. Technological innovations like augmented reality should help spur adoption in areas like home furnishings, and delivery speeds will continue to improve as well. Meanwhile, other external trends like remote work should also support the growth of e-commerce.

According to the Census Bureau, which tracks retail sales, e-commerce makes up less than 15% of retail sales in the U.S., even after years of double-digit growth. This shows there's still a huge opportunity, and e-commerce is an even smaller percentage of retail sales in international markets.

If you're looking for e-commerce stocks to buy and hold for the long term, keep reading to see two great candidates.

1. Shopify: The e-commerce partner brands need

Amazon has dominated the e-commerce sector since its early days and owns roughly 40% of U.S. market share thanks to its first-party business and third-party marketplace. 

However, there's a big gap in Amazon's services and that's where Shopify (SHOP -0.64%) comes in. If you're a small or medium-sized business and you want to sell on your own website, Amazon can't help you. Shopify has increasingly become the de facto solution for these online retailers. It's even attracted Fortune 500 companies that want to quickly deploy an e-commerce site.

Shopify provides a suite of software services for businesses, including web design, analytics, marketing, logistics, and payments, and its leadership in e-commerce software has driven tremendous growth for the company.

As you can see from the chart below, revenue has soared since the company's 2015 IPO. 

SHOP Chart

SHOP data by YCharts

However, the stock has plunged over the last year as growth has slowed down and profits from a year ago flipped back to losses.

That's set up a buying opportunity for Shopify -- the stock looks reasonably priced at a price-to-sales ratio of less than 9, and it's still posting solid growth in a difficult environment. For example, the company said gross merchandise volume jumped 21% to $7.5 billion over Black Friday weekend.  

Shopify's growth should accelerate once comparisons get easier and macro headwinds fade. The company is also in a strong position because it faces relatively little direct competition and is much larger than rivals like BigCommerce and WooCommerce.

If you're bullish on e-commerce over the long term, Shopify is a great way to get exposure to the sector.

2. Etsy: Carving out a unique e-commerce niche

Like Shopify, Etsy (ETSY 3.76%) has also found its own sector of e-commerce where it's protected from competition with Amazon.

Etsy's marketplace specializes in unique handmade and vintage products like jewelry, gifts, clothes, and stationery that you can't get elsewhere. That focus along with its marketplace business model has given the company a strong competitive position.

While it's also seen growth slow this year due to the broader headwinds in e-commerce, the company remains solidly profitable with an adjusted EBITDA margin of 28% in its most recent quarter. The company has generated $367 million in free cash flow through the first three quarters of the year, or a 21% margin.

Etsy continues to make updates and investments in its platform, recently adding image search functionality so users who see something they like can search with just a picture, which is especially useful when it might be hard to describe an item. It's also improving its ad experience using computer vision to serve more personalized ads.

Etsy estimates it's penetrating an addressable market of $466 billion for online sales of the categories it competes in, giving it a large market to grow into. 

Finally, Etsy is acquiring other e-commerce platforms like Reverb, a musical instruments marketplace; Depop, an app for secondhand and vintage clothing; and Elo7, a Brazilian marketplace similar to Etsy. Etsy calls the strategy "House of Brands," and it positions the company to grow beyond its namesake Etsy marketplace.

As e-commerce continues to grow and millennials and Generation Z turned to authentic marketplaces like Etsy, the company should deliver solid growth over the next decade.