If there's one thing we learned in 2023 (and there were definitely many things to be learned), it's that we have no idea what the world will look like by the end of 2024.

Last year began with strong concerns about a coming recession, along with tepid confidence in the market. A year later, the market is coming off a 24% gain, and the Federal Reserve has successfully navigated raising interest rates without setting off a recession.

But when investing, you have to make decisions with the information at hand. One place to start is with companies boasting strong track records. Two that fit the bill today are Amazon (AMZN 3.43%) and Shopify (SHOP 1.11%). Both had incredible performances in 2023, gaining 81% and 124% respectively.

Plus, both chose to split their stocks in 2022, a move that is typically a reflection of a company's success. Can these two companies repeat their performances in 2024? Lets see.

1. Amazon stock: Up 82% in 2023

Amazon split its stock in June 2022 when it was sinking. It jumped at the time, but it only made a strong rebound in 2023. It's benefiting from a rise in e-commerce and its strength in cloud computing services as well as momentum with its advertising business. All of these segments should be even stronger in 2024.

Why? E-commerce is still increasing after taking a back seat to physical stores sales for a few years. According to Statista, e-commerce sales are expected to expand at a compound annual growth rate (CAGR) of more than 10% through 2028, while overall retail sales are expected to increase at a CAGR of about 4.5% over the next two years.

Amazon has been fiercely defending its dominant position in e-commerce, and while it has ceded market share since a high early in the pandemic, it's still well above any competitor, with about 38% of all U.S. e-commerce sales. That's more than 1 in 3 sales dollars going to Amazon.

The e-commerce behemoth strengthened its position last year through a restructuring in its logistics network and is now getting more products to more customers faster. It's well positioned to reap more benefits in 2024 and beyond, benefiting from industry trends as well as its own improvements.

In cloud computing, it also still has a much higher market share than any competitor, and it launched important generative artificial intelligence (AI) services for Amazon Web Services (AWS) that should draw even more interest and increase market share.

Sales growth was back in the double digits in the 2023 third quarter, and management is guiding for around 10% in the fourth quarter. It's also expecting operating income to quadruple from last year to $10 to $11 billion.

For Amazon stock to double, its market capitalization would surpass $3 trillion, which is higher than any other stock today. I wouldn't rule it out, but I also wouldn't say it's a given. Still, I would recommend buying Amazon stock, which should continue to gain and compound over time, which is what you want to see in a great stock.

2. Shopify stock: Up 124% in 2023

Investors just love Shopify stock. It more than doubled last year after it continued to report double-digit sales growth while demonstrating a real effort to rein in costs and return to net profitability. It also split its stock in June 2022, but it stayed flat before rising in 2023.

Shopify is benefiting from the same e-commerce trends driving Amazon's core business. In fact, its gross merchandise volume of $56 million in the 2023 third quarter was nearly the same as Amazon's $57 million in online store sales. Shopify is a platform, so it doesn't count GMV as revenue; it only gets a portion of that as fees. Shopify reported $1.7 billion in revenue, which was 25% more than last year. Monthly recurring revenue, which is the sticky kind, increased 33% over last year.

Shopify is expanding its target market from the small businesses it's known for to medium and large-sized businesses, which typically bring in higher revenue.

It launched several important new services last year, such as Shopify Components, which lets businesses choose single services instead of signing up for full packages. That's a great way to bring new clients into the Shopify ecosystem. It also developed its own line of AI and generative AI solutions to keep it on the cutting edge of technology.

The company overshot in expanding to meet skyrocketing pandemic demand, but it efficiently wrapped up some costly new ventures that were draining earnings last year and cut its workforce. Management is guiding for revenue to increase in the high teens year over year in the fourth quarter, and for improved profitability. It has not yet released any 2024 guidance, but if it sustains its momentum with new features, double-digit growth, and higher profits, it should soar in 2024.

To double, its market cap would have to hit $200 billion. At the current price-to-sales ratio of 15, revenue would have to double next year to get to a $200 billion market cap. But it's not likely to do that. At a lower price-to-sales ratio, it would need to more than double its revenue to double its market cap, which is even less likely. However, to double without doubling revenue, it would need a higher price-to-sales ratio; 15 is already very rich, so that also seems unlikely.

In other words, I don't see Shopify stock doubling in 2024. I think it could gain, and the long-term opportunity looks strong. But Shopify stock is expensive at its current price, and you might want to wait for some pullback before taking a position.