Walmart's online sales are growing and Americans still flood into its stores.

Digital sales jumped 33% last quarter, Walmart said Thursday. Wall Street was glued to that number because CEO Doug McMillon is scrambling to transform the world's largest brick-and-mortar retailer for the digital era.

Walmart expects online sales to increase 40% for the full year. E-commerce makes up only 4% of sales in the United States, estimated Laura Kennedy, vice president of retail insights at Kantar Consulting.

"The real issue with Walmart is that most of what they sell is food and people don't buy food online," she said.

Walmart has embarked on an ambitious long-term plan to shift perceptions of its brand. It wants to build its customer base from low- and middle-income households to younger, wealthier Americans captivated by Amazon (AMZN).

Related: How Whole Foods will help Amazon rule the world

"We are changing from within to be faster and more digital, while shaping our portfolio of businesses for the future," McMillon said in a news release Thursday.

Retooling abroad has been Walmart's focus in recent months as it searches for growth and market share.

Walmart pulled back on a mature UK market by selling control of supermarket chain Asda and struck a $16 billion deal for Flipkart in India, the largest purchase in its history. It will take years for Flipkart to make a profit, but Walmart believes it can unlock India's approximately $200 billion online market.

Related: What is Walmart's global plan?

It has also gobbled up niche retailers such as ModCloth, Bonobos, Moosejaw and Hayneedle to expand its online muscle. On Wednesday, it announced a partnership with fashion chain Lord & Taylor for a landing page on the website.

But Walmart's biggest move in the United States, a $3 billion deal for Jet.com, has disappointed investors. Walmart is scaled back marketing on Jet except in urban areas while deploying its newly-redesigned website in mid-America.

Related: Meet the new Walmart customer: Higher-end and digital-savvy

"Walmart is just a really well-known brand for value throughout the country," McMillon said in February. "When you get into Oklahoma and Texas, in the middle of the country, it just makes a lot of sense to invest in that brand."

The retailer's success chasing online dollars has been mixed so far. In the fourth quarter, Walmart's online growth slowed to 23% after strong 50% and 60% gains the previous two quarters.

Walmart miscalculated how much inventory it would need to keep pace with soaring demand during the holiday shopping season. Those supply-chain growing pains sparked a Wall Street selloff. Walmart's stock had its worst day in 30 years, and it still hasn't recovered: It's down 13% this year.

Related: Walmart figured out its Amazon strategy. So why's the stock down 13%?

Wall Street shrugged off what McMillon called a "solid" quarter Thursday. Shares closed down 1.9%.

Sales at Walmart's 4,760 US stores that have been open for at least a year rose 2.1% and foot traffic was up 0.8%. Ticket sizes also jumped. All three measures signal that shoppers continue to head to Walmart's stores frequently and are spending more money when they shop. A colder April hurt traffic, the company said.

Walmart isn't building new stores, instead remodeling 1,500, raising employee wages, and tightening demands on suppliers to squeeze out every dollar from existing locations.

"Today's results are proof not only that Walmart is making gains in its day-to-day business, but that it is now a company firmly in the midst of a dramatic transition," Neil Saunders, managing director of GlobalData Retail, said in an email.

Walmart's expansion of home grocery delivery and curbside pickup contributed half of the same-store sales growth. Online grocery has failed to take hold in the United States, but analysts expect it to grow in the future.

Grocery accounts for more than half of Walmart's $500 billion in annual sales, and the company's future depends on its ability to compete with Amazon as it wades into the battle with Whole Foods. Kroger (KR) stepped up its digital capabilities Thursday by taking a minority stake in British online supermarket chain Ocado to leverage its delivery tech.

Walmart's link to nearly every US household — 90% of the country lives within 10 miles of a store — could give it an advantage in the race, argues Cowen analyst Oliver Chen. Walmart can offer customers a rare combination of curbside pickup and buy online, pickup in store — so-called "click and collect." That could help it keep down costly delivery charges.

But investments in online grocery are weighing on profit. Walmart's margins in the United States shrank 3.1% from a year ago.

Cheaper prices also cut into profit. Walmart has lowered prices at stores to stay ahead of competitors. "If they are nothing else, they have to be the everyday low price provider," Kennedy said.

Higher oil and third-party shipping costs dented the company's bottom line, too. America's truck driving shortage has impacted nearly every big company in the country.