It would have been easy enough for Dunkin' Donuts to dismiss the Internet phenomenon "Dressgate" as irrelevant to its brand. What, after all, could an online debate over optical illusions and the colour of a dress possibly have to do with pastry and coffee?

Turns out, plenty. In a shining example of real-time marketing done right, Dunkin' Donuts quickly identified the viral trend and rapidly conceived and executed a relevant promotion to insert its brand into the conversation. On the morning of Feb. 27 – just hours after the phenomenon erupted – the company tweeted an image of a black-and-blue frosted doughnut alongside a white-and-gold one. "Doesn't matter if it's blue/black or white/gold, they still taste delicious," read the accompanying text.

The payback: More than 3,300 retweets and 4,700 favorites from those who saw it.

Dunkin' Donuts was one of more than 120 brands to seize the "Dressgate" opportunity, and most benefitted with significantly higher engagement levels than they usually get for their branded tweets, according to Chris Kerns, head of analytics and research with marketing-technology vendor Spredfast.

How the Internet changed marketing

Marketing was once a one-way effort conducted at a brand's convenience. Today, the Internet has changed all that, and marketers are turning to real-time marketing technology for help keeping up with all the events and trends that affect consumers' lives. Whether it's something expected like the Super Bowl, the Oscars or the arrival of Daylight Savings Time or surprise occurrences like "the dress" or significant weather events, marketers are paying closer attention than ever before and trying to get involved.

Real-time marketing is a matter of "systematically responding to your customers in the moment, based on your ability to know how a customer is interacting with your brand through any channel," said Joe Stanhope, senior vice president of marketing at technology provider Signal.

That requires the ability to continuously gather cross-channel data about customers' actions and respond to those customers instantly in the way that they prefer.

Marketers have been tailoring messages using customer data for decades, but "the concept of 'real-time' with today's always-on consumer has become much more critical and much more literal," Stanhope explained.

Technology, of course, is a big part of making that happen, with tools for everything from data collection and analytics to message delivery. Signal's platform, for instance, aims to enable brands to collect, merge and take action on data in milliseconds, Stanhope said.

Programmatic and real-time bidding technologies have enabled the instantaneous delivery of personalized messages. Other products that may be involved in a real-time marketing effort include data-management platforms, cross-channel campaign-management tools, real-time analytics software and packages for curating content in real time.

Spredfast's intelligence tool sheds light on trends in 330 geographies around the globe on Twitter and Facebook. Within seconds, users can see not just the history of any given trend but also which other brands are jumping in to capitalize on it, Kerns said.

The Humane Society of the United States uses Spredfast's software to track hashtags and insert its brand into select online conversations. For example, on June 8 the tool revealed that #NationalBestFriendsDay was trending, said Carie Lewis Carlson, the Humane Society's director of communications marketing.

"We didn't even know it was National Best Friends Day," Carlson said. "So we pivoted from our planned post and posted a photo of a staffer with her dog and asked people to share with us photos of their furry best friends."

It was a low-risk opportunity that successfully built community around the organization, she added.

"Before, the only option we had was trying to 'create' news," she explained. "Now, we can insert our brand into conversations that are already happening."

The technology also helps the group stay aware of what people care about. "We can engage with them on issues they want to get involved in rather than trying to get everyone to sign a petition on wolves at this very moment," she said. "It's all about timing. We determine what's most relevant to our audience and serve the right kind of content to them at the right time."

The Humane Society is still relatively new to the Spredfast platform, so it doesn't have any hard ROI numbers yet. But Carlson believes it's helping her organization provide better customer service. The Humane Society is also about to integrate the technology with its call center, so she expects it to break down internal silos as well, she said.

When real-time marketing fails

Perhaps the most widely articulated caveat associated with real-time marketing is the need to be selective.

"You can't just jump on a trending hashtag and talk about your brand and expect everyone to care," Spredfast's Kerns warned.

There have been some spectacular examples of failures in this regard, such as a particularly misguided tweet from DiGiorno Pizza last fall that seemed to trivialise domestic violence. DiGiorno jumped too hastily on the #WhyIStayed hashtag that became popular after athlete Ray Rice was terminated from the Baltimore Ravens after a video became public depicting him punching his then-fiancee Janay Palmer. Whereas the hashtag's topic was abusive relationships, DiGiorno's regrettable tweet read, "#whyistayed You had pizza."

The company's followup the next day: "A million apologies. Did not read what the hashtag was about before posting."

Marketing in real time also requires a new mind-set and careful balance at many companies. It doesn't mean abandoning current business planning processes, but it also doesn't mean running off "barking at every car that drives by," said David Meerman Scott, author of books including Real-Time Marketing & PR. "Focus and collaboration are essential."

So, too, is close coordination between marketing and IT for systems integration and careful management of issues such as customer privacy, said Carl Doty, a vice president with Forrester Research.

There's no longer much doubt, however, that the benefits can be well worth the risks. "There are far more winners than losers," said Spredfast's Kerns.

"Employees, customers and other stakeholders are talking about your organization offline anyway, so unless you are participating online, you'll never know what's being said at all," Scott said. "The beauty of the Web is that you benefit from instant access to conversations you could never participate in before."