Consider just one small fact: Consumers who buy groceries online usually stick to a list of must-have items. That has left some big food companies scrambling to find new ways to persuade them to add that last-minute chocolate bar or bottle of water.

Hershey Co.
, for instance, is working on a technology to make it easier for online shoppers who pick up their orders at stores to throw in a piece of candy or a pack of gum at the last minute. As customers arrive at the store and an employee prepares to bring their groceries out to their car, an offer would pop up on a smartphone app, suggesting they add something extra to their orders. The idea is to mimic the experience in the checkout lane, where 56% of shoppers always or often purchase a snack, the company says.

More in Food

Figuring out how to drive impulse purchases is just one of the challenges that multibillion-dollar food brands face as they gear up to win customers online. They also have more competition from startups on e-commerce channels, where it is possible to build a consumer following without a massive marketing budget and where newer brands perceived as less processed and more healthful tend to be popular.

As food makers and retailers test new technologies and develop e-commerce strategies to compete in this changing landscape, the overall grocery-shopping experience for customers is likely to shift dramatically, food executives and analysts say.

Critical segment

Amazon.com Inc.
’s recent acquisition of Whole Foods Market Inc. and its big push into the grocery industry is generating a new sense of urgency among food makers and traditional supermarkets to keep up with the e-commerce giant.

Campbell Soup Co.
,
Conagra Brands Inc.,Kraft Heinz Co.
and others, have said they are investing more to build sales online, hiring e-commerce experts and making adjustments to their supply chain and distribution systems to serve e-commerce needs.

The stakes are high. While e-commerce represents a small segment of food and beverage sales today, at about 4%, it is expected to account for 8% of such sales, or $70 billion, by 2021, according to Inmar Willard Bishop Analytics, a Chicago-area consulting firm.

One big challenge for behemoth brands such as Campbell’s chicken-noodle soup and
Mondelez International Inc.
’s Oreo cookies is that they don’t always have the kind of leverage online that they are used to having in brick-and-mortar stores. For decades, such brands controlled grocery-store aisles, commanding prime shelf space and funding expensive advertising displays. Online, however, the playing field is more level, as the internet has provided a quick, cheap and easy sales platform for newer, trendier food companies to reach consumers.

David Ciancio,
senior customer strategist for consumer-data firm Dunnhumby, says that foods viewed as healthful and consumed as part of a routine—such as breakfast bars made with ingredients perceived as simple or nutritious—do better online because they are habitual and therefore ripe for automatic reordering. Processed foods and items bought on impulse, such as candy, typically suffer in the transition to online, he says.

Many websites have no way of presenting impulse-related food items as pop-ups when shoppers check out, and buying online doesn’t offer immediate gratification. As such, online shopping lends itself to more “list-driven” shopping, says
Paul Weitzel,
vice president of Inmar Willard Bishop.

Hershey CEO
Michele Buck,
who took the helm in March, said on an earnings call in July that the company plans to continue working with retailers to find ways to drive impulse purchases online. “I can’t tell you I have the answer to that right now,” she said, but “we are doubling-down” on e-commerce.

Some companies are looking toward new technologies to help them drive more online sales in general. One idea, from InContext Solutions, which has developed virtual-reality software for retailers, is to provide virtual shopping to consumers who own VR headsets. By one day enabling people to virtually unwrap candy bars and look inside boxes of cereal while they shop, the technology could make food look more appealing than on a 2-D computer screen, InContext says.

Elsewhere, Instacart, an online grocery-delivery service that partners with many major retailers, is working with hundreds of brands, ranging from large companies such as
Unilever
and
PepsiCo Inc.
to smaller niche sellers, to put samples of items in customers’ deliveries.

Mondelez, which hired a vice president of global e-commerce about a year ago, says snacks are relatively underdeveloped in e-commerce today, generating just 2% of overall online grocery sales in the U.S. and 15% in China.

The company is trying a variety of strategies to drive sales online, including subscription options on Amazon, where shoppers get a lower price on products such as belVita breakfast cookies in exchange for signing up for automatic reorders.

Mondelez says it is aiming to generate at least $1 billion in e-commerce revenue by 2020, up from about a third of that now.

Previous Food Coverage

Campbell Soup recently created an e-commerce business unit for North America and named
Shakeel Farooque,
a veteran of Amazon and
eBay,
to lead it. The company says it is working with retailers to capture more sales online and investing in a network of distribution centers in states such as Texas and Ohio to better serve e-commerce customers. It aims to generate $300 million in online sales over the next five years.

An advantage

One benefit big food companies have online is that store brands, called private label, aren’t as popular as they are in stores. General Mills says that in the U.K., where online shopping is more prevalent, its market share is almost 30% higher for e-commerce than in physical stores.

Photo:
Joe Tabbacca/Bloomberg News

Company executives say getting products such as Cheerios cereal and Progresso soup into the customer’s first online order is a priority for them because people often reorder past purchases out of convenience.

General Mills say best-selling products tend to come up early in search results, though many retailers offer paid search advertising that can drive placement.

In addition to paying for placement, some food manufacturers are striking partnerships with other brands to give shoppers discounts if they purchase two products together. Companies are using customer analytics to figure out if a frozen-dinner buyer might also buy snack cakes, for example, says
Bill Bishop,
co-founder of consulting firm Brick Meets Click.

“There is a tremendous focus on paying to move up [in search results]. The question is, is it worthwhile,” said Mr. Bishop. “You have to get to the granular data.”