The specificity of Facebook’s advertising machine lets companies sidestep many potential pitfalls that could prevent them from launching a successful ad campaign.

For Universal Pictures, one of the problems Facebook helped them sidestep was the fact that white Americans didn’t really know what iconic rap group N.W.A. was, or that Ice Cube and Dr. Dre made music.

In a panel at South by Southwest, Universal’s EVP of digital marketing, Doug Neil, and Facebook’s entertainment head, Jim Underwood, talked about the customized racial marketing for “Straight Outta Compton,” the 2015 film that chronicles the rise of gangsta rap pioneers N.W.A.

The success of the film was a surprise, Neil said. “I shouldn’t say a surprise,” he corrected. “A breakout hit.” Neil said Universal knew the film would be popular with African American audiences, but that it ended up getting a wide crossover appeal, grossing over $160 million at the US box office.

Neil credited part of this to a specialized Facebook marketing effort led by Universal’s “multicultural team” in conjunction with its Facebook team. They created tailored trailers for different segments of the population.

Why? The “general population” (non-African American, non-Hispanic) wasn’t familiar with N.W.A., or with the musical catalog of Ice Cube and Dr. Dre, according to Neil. They connected to Ice Cube as an actor and Dr. Dre as the face of Beats, he said. The trailer marketed to them on Facebook had no mention of N.W.A., but sold the movie as a story of the rise of Ice Cube and Dr. Dre.

The trailer marketed to African Americans was completely different. Universal assumed this segment of the population had a baseline familiarity with N.W.A. “They put Compton on the map,” Neil said. This trailer opens with the word N.W.A. and continues to lean on it heavily throughout.

As to the trailer produced for the Hispanic market, it was a shorter spot that included flashing quotes in Spanish.

Since Facebook doesn't ask people to self-identify as a particular race, a campaign like Universal's uses what are called "affinity" groups. To construct an "African-American affinity segment," Facebook would look at indicators like whether someone was a member of an African American Chamber of Commerce Facebook group. When many of these indicators are taken into account simultaneously, it allows Facebook to define the "affinity" segment.

Neil characterized this marketing effort as a complete success.