As brick-and-mortar retailers redouble their efforts to compete against e-commerce giants, their survival might depend on using online and mobile to know where the consumer is — and what the consumer wants at any given time.

Retailers that embrace 'contextual commerce' know the context of individual shoppers, anticipating their particular buying needs while providing easy, frictionless transactions. And finding a way to engage consumers is key.

"These guys have to do something major; otherwise they are all dead," says Ashok Narasimhan, cofounder and chief executive officer of OmnyPay, an e-commerce startup headquartered in San Francisco. "In five years, a lot of them are going to be out of business."

With traditional retailers under siege from Amazon, they will need to use contextual commerce to reach customers.

"It's all about being where your users are," says Azita Habibi, business development manager for contextual commerce product at Braintree, a payment gateway and processor. "If you rely on them coming to you, finding you, there is something at stake."

With traditional retailers under siege from Amazon, they will need to use contextual commerce to reach customers.

Amazon is a classic example of contextual commerce. When users log in, Amazon uses buying and browsing history to anticipate the needs of the customer, and makes it easy to place an order within a few clicks. Other examples include Uber letting users check into a Hilton while on the way to the hotel. 'Buy buttons' on websites such as Facebook, Pinterest and Twitter mark an early step toward getting to the consumer.

Steady flow out the door

The problem for brick-and-mortar retailers is that commerce continues to shift online and to mobile. Online volume reached $342 billion in 2015, representing 10.6 percent of retail sales in 2015, excluding fuel, autos, restaurants and bars, according to Internet Retailer. That's roughly a 76-percent increase versus 2011, when online volume accounted for 6.3 percent of retail sales.

The problem for brick-and-mortar retailers is that commerce continues to shift online and to mobile.

While some traditional retailers have plowed resources into e-commerce and are finding success, what's killing a number of them is their inability to understand the context of the shopper, all the while losing out on price, Narasimhan notes. This has led to the common practice of 'showrooming,' where consumers visit a local store, such as an electronics retailer, to visually inspect items before looking them up on Amazon and placing an order online for additional savings. Here is where the retailer stumbles, he says, since it misses the chance to match price, entice the shopper with discounts and build loyalty by offering rewards.

Traditional retailers are feeling the pinch. Macy's last year announced it would close 100 of its 700 stores. The Limited closed almost all of its 250 stores in January, going entirely online. CVS, with more than 9,600 locations nationwide, has announced it would close 70 stores early this year. Sears Holdings Corp., which owns Kmart, has bled cash over time, with a deteriorating balance sheet of liabilities outpacing assets, resulting in negative equity and leading to rumors of a bankruptcy.

Getting out there

When it comes to consumer engagement, mobile will likely play a big role, as traditional retailers spend millions of dollars transforming their businesses to a digital world. For example, Kohl's app allows customers to automatically redeem offers, earn Kohl's Cash and rewards points, all saved to a mobile wallet. The rewards can be used to pay for purchases in conjunction with a Kohl's private-label card. Shoppers can also use the app elsewhere, to snap pictures of items in competitor stores to check prices of similar items at Kohl's. When customers are at a Kohl's store, the app also alerts them of special discounts at that location.

"This is the context," Narasimhan says. "If the retailer knows it's you, and knows who you are in terms of the offers they would like to make to you, and which specific products you are looking at, they make the sale instead of losing the sale."

Still early days

OmnyPay is also working on other initiatives to help consumers more easily buy on impulse. One feature in its pipeline is the ability to scan items in a catalog with a smartphone, then have them delivered. Another is being able to scan a Facebook ad and order the featured item from a mobile device.

"If I want to do something with a Facebook ad, I don't want to leave Facebook to place an order," Narasimhan says. "I want this to be instinctively done in my context. My context is, 'Right now, I'm engaged with Facebook.'"

The challenge for retailers will be, in part, making it easy for customers to buy, but at the same time providing adequate information. "You just want to give enough information to users so that they feel like they are making an informed purchase," Habibi says.