Walmart (WMT 0.57%) disappointed investors when its digital sales grew just 6% in the second quarter. The e-commerce business is a key piece of Walmart's future growth, and it's falling further behind its bigger competitor, Amazon.com (AMZN -1.65%).

But a small slice of Walmart's e-commerce business nearly doubled: the company's advertising business. It saw very strong demand, which should lead to sustainable growth, and the high-margin revenue stream could fuel Walmart's e-commerce growth with good execution.

Walmart sign on exterior of a store.

Image source: Walmart.

Small business, big growth

Revenue from Walmart Connect -- the retailer's e-commerce advertising program -- grew 95% in the second quarter. That outpaces Amazon's stellar growth of about 87% for its advertising business. Granted, Amazon's ad sales are more than 10-times Walmart's, making its growth much more impressive even if slightly slower.

Walmart also shared that active advertisers grew 170% year over year. That bodes well for the future of the business. If demand continues to outstrip the growth in supply, it should lead to higher average ad prices and strong revenue growth for Walmart Connect.

One detail missing from Walmart's report, however, is just how much revenue the ad business brings in. Earlier this year, analysts at eMarketer projected it would bring in $1.55 billion for the full year of 2021. That barely moves the needle on Walmart's top line, which analysts expect to total $555 billion this year. It's even just a tiny fraction of its total e-commerce business, which management expects to top $75 billion for the year.

But advertising carries significantly higher margins than the rest of the business, and it's key to making e-commerce profitable for Walmart. Walmart's e-commerce investments and operations reportedly lost around $1 billion in 2019, but profitability improved in 2020. Advertising has been a key reason for the improvement.

Investing in the future

Management isn't going to let the profits from the booming advertising business go straight to the bottom line. CFO Brett Biggs said growth in higher-margin businesses like Walmart Connect "gives us flexibility to invest aggressively for the future while growing profit near term," during the company's second quarter earnings call.

In other words, the retailer will take a balanced approach between making e-commerce consistently profitable versus growing it as big as possible. This year, specifically, it's invested heavily in its supply chain and fulfillment capabilities. 

Those require big cash outlays, and despite long amortization schedules for things like warehouses, they can be unprofitable for some time as capacity ramps up. Amazon has seen the impact of its massive fulfillment center buildout last year on its financial results this year.

But Walmart is already showing strong results from its investment, as its fulfillment service is on pace to account for a double-digit percentage of its total e-commerce merchandise volume this year. Ramping third-party sales is another key to creating a profitable e-commerce business, and fulfillment services can bring more merchants (and advertisers) to the platform. Third-party merchants account for the majority of Amazon's merchandise volume, and third-party seller services are a significant contributor to its profits.

That said, merely growing fulfillment capacity is just half the battle. It's great that Walmart has the luxury of being able to invest in its fulfillment network, but it also needs to invest in driving more customers to its website when they're shopping online. Last year, online grocery drove customers to its website, but Walmart's having trouble keeping them coming back in 2021. Walmart may need to invest on the consumer side of the e-commerce business to see sales growth return next year. 

Walmart has the opportunity to invest, thanks in part to its growing advertising business, but it still needs to execute.