Reaching younger consumers as they are initiated into the world of beauty has always been a key focus for legacy beauty brands. After all, they’ve been successfully resonating with consumers across generations for years. Millennials—and now Gen Z—are posing a challenge, however.

Reaching a hyper-social, glued-to-their-phone and fickle demographic has required near-Herculean pivots with products that cater specifically to of-the-moment trends, diversifying the pool of spokespeople brands partner with, working closely with influencers and creating unique branded digital experiences.

Our population is becoming increasingly diverse,” said Laura Brinker, VP, influencer marketing at Coty in a statement to Fortune. Coty has a particularly long history—the company was originally founded in 1904 and now owns a massive portfolio of 77 beauty brands like CoverGirl and Rimmel. “These trends are certainly something millennials have appreciated as they’ve grown up, but they’ll be even more important for Gen Z.”

For CoverGirl, this meant making waves in 2016 by bringing on James Charlesa makeup artist who built his audience entirely on social media—on board as a spokesperson. This signaled to consumers that the brand is recognizing the shifting attitudes of young people regarding gender fluidity and making a statement beauty products are not just for women. Drugstore brand competitor Maybelline then quickly followed suit, announcing a similar partnership with influencer Manny Gutierrez.

Brands are also recognizing that in the days of YouTube makeup tutorials, influencer-created makeup products and the ubiquitous “Instagram Brow,” social media is providing a wellspring of trends and inspiration for the beauty world.

“We know makeup is fun—there are thousands of tutorials about how to create the right look,” said Olay brand director Stephanie Robertson to AList. With YouTube views on beauty-related up 65 percent year-over-year, the impact of influencers is not to be underestimated.

For a beauty brand that has been around since 1963, Mary Kay has long understood the power of influencer marketing with their direct sales approach, and in reaching younger consumers, the brand has continued to leverage this.

“Our Mary Kay Independent Beauty Consultants continue to evolve with their customers with each new generation,” said Kim Sater, director of US consumer marketing for Mary Kay.

“While we do use influencers to help tell our story, we have found that many of our Beauty Consultants have large followings and are influencers in their own right. They post how-to videos and makeup looks, as well as share about our skin care products,” said Sater.

“Now, a Beauty Consultant might text or send a quick message via Snapchat to let her customers know of a promotion or a new product. Our message and product is really resonating with millennials, especially, and a big percentage of our new consultants are aged 18-24.”

“The new celebrities are the social influencers, and quite honestly some make more money than the people who get Emmy Awards,” said John Demsey, executive group president at Estée Lauder Cos. Inc to LA Times. “If you can deliver an audience and prove that someone can buy your product, you can get paid. As long as that works it will continue to blossom.”

Mobile is also a critical channel for brands to be paying attention to—55 percent of beauty buyers reach for their phones first when it comes to researching new products according to Facebook. Both Olay and Mary Kay have also focused on crafting digital experiences to meet the needs of their customers, paying particular attention to mobile.

For Olay, this materialized with the Olay Skin Advisor tool, which allows customers to create a personalized skincare regimen. The site, which has been built specifically for mobile, has been successful according to Robertson. “To date, we’ve had over one million visits and half the bounce rate of a typical site.”

While the next generation of Mary Kay’s “Beauty Consultants” may focus less on the face-to-face interaction you usually associate with direct sales, the brand has acted to create the closest thing to it via their digital presence with an app for consultants to manage their customer bases and create personal websites.

“Our MyCustomers + app allows them to create orders, easily contact customers, track inventory and more, so they really have all the tools they need right in the palm of their hand.  They can have a personal website, which the company updates for them, so all of their customers can shop 24/7, and they have multiple shipping options which make it easy to service their customers,” said Sater.

Brands are also paying close attention to makeup trends and foresee opportunities to cater to shifting tastes and rapidly-evolving needs via products that fit into the lives of young consumers. Olay’s Robertson noted that the brand has seen a rise in convenience-based skincare, which has led them to reignite their focus on products that deliver performance products in the most convenient way. It’s clear that social media has played a role in accelerating trends and the impact has extended to product development.

“We used to deal in trends that lasted five to 10 years,” said Karen Grant, beauty industry analyst at The NPD Group. “Now, we think it’s a long trend if it lasts 24 months.”