If were online a few weeks ago, you may have seen a Unicorn Frappuccino in its natural habitat: Instagram.

The drink dominated social media, with more than 1.3 billion impressions on Twitter, according to the analytics firm Brandwatch. On Instagram, more than 150,000 posts were tagged #unicornfrappuccino. Countless more photos and videos made their way onto Snapchat and Facebook.

And then, as quickly as it had appeared, the Unicorn Frappuccino was gone. Starbucks offered it for only five days. So if you missed it, you really missed it.

The limited-time-only pink-and-blue sugary swirled behemoth seemed like it was designed with Instagram in mind. And it almost certainly was.

Chains like Starbucks have always created menu items based on customer behavior. Among the key 18-to-34 demographic, the current consumer behavior is to take a photo and post it online. So when new foods are being developed, companies are making sure they’re optimized for a filtered selfie.

“Food is today’s hottest social currency,” said Christine Couvelier, an executive chef and president of Culinary Concierge, a company that tracks food trends and developments. She said one-third of people in that critical millennial age bracket regularly post photos of their food online, so it makes sense that companies would want to capitalize on that by designing Instagram-friendly offerings.

Some foods are naturally appealing: colorful cocktails, frosted desserts, artisanal lattes crowned with delicate foam art. Fast food is traditionally less photogenic. But chains are trying to change that.

In 2015, Brinker International, parent of the Chili’s chain, announced that it would spend $750,000 a year to improve how its food looked in photos. An egg wash would be applied to the hamburger buns to give them an eye-catching sheen, the French fries would be served in stainless steel baskets, and the ribs would be separated and stacked instead of being served as a single slab.

When the initiative was launched, Chili’s had 25,000 followers on Instagram, according to news reports. As of today, it has just shy of 200,000.

Yum Brands owns Taco Bell, Pizza Hut and KFC — the respective homes of the Doritos Locos Taco, the Hot Dog Bites Pizza and the Double Down sandwich, which substitutes pieces of chicken for bread. In a recent interview with Business Insider, Liz Matthews, Taco Bell’s chief innovation officer, said the company’s food development team is always considering how a new menu item will look in photos.

“We want people to talk about it, and blog about it,” Matthews said. “And share their pictures.”

Starbucks wanted that, too. And by tapping into the unicorn trend, the brand ensured that its drink would resonate with its intended audience. Unicorn-themed toast, cakes, coffee drinks and doughnuts have proliferated across Instagram in the past few months. More than 4.8 million posts on Instagram are tagged #unicorn.

“Unicorns have these various metaphors that people use — they’re magical, they’re special, they’re original,” said Ira Kalb, an associate professor of clinical marketing at USC’s Marshall School of Business. Furthermore, he said, unicorns are bright and colorful. And, like the Starbucks drink, you only see them for a short period of time before they disappear.

Denise Lee Yohn, the author of the book “What Great Brands Do,” said she was surprised by the Unicorn Frappuccino.

“I thought it was completely off brand for them,” she said. “I thought it was a cheeky effort to get social sharing about their brand. That’s something Starbucks usually doesn’t do.”

But overall, she said, brands are definitely thinking more about social media when they’re developing their products: “Five years ago, three years ago, that wasn’t a consideration.”

She said creating social-media-mindful food is a hot marketing trend, and that “like every trend, it will get overdone, and it will get burned out, and marketers and brands will have to come up with a different way to get people’s attention.”

In the meantime, does she think we’ll see more things like the Unicorn Frappuccino?

She sighed: “I’m afraid that we will.”