All the models had Hillary Clinton winning the presidency, and to date, there has been no satisfactory explanation as to why those models were wrong. A report from the Swiss publication Das Magazin and adapted by Motherboard has a fascinating story about how it might have happened, thanks to Facebook quizzes and a small company called Cambridge Analytica — the same company that worked on the online campaign for Brexit.

The story starts with Michal Kosinski, a psychologist with the Psychometrics Centre at Cambrige University. In 2008, Kosinski and a fellow researcher — both students at the time — were experimenting with Facebook quizzes that zeroed in on what psychologists call “The Big Five” personality traits: openness, conscientiousness, extroversion, agreeableness, and neuroticism, or OCEAN. The quiz-takers could opt in to sharing their data with the researchers, and to the researchers' surprise, millions did.

Kosinski began correlating this personality data with a person's "likes." From Motherboard:

In 2012, Kosinski proved that on the basis of an average of 68 Facebook “likes” by a user, it was possible to predict their skin color (with 95 percent accuracy) their sexual orientation (88 percent accuracy), and their affiliation to the Democratic or Republican party (85 percent). But it didn’t stop there. Intelligence, religion, as well as alcohol, cigarette and drug use, could all be determined. From the data it was even possible to deduce whether deduce whether someone's parents were divorced.

“Liking” Wu-Tang Clan is one of the best indicators for heterosexuality, Kosinski found, while "liking" Lady Gaga correlated highly with extroversion. Eventually, Facebook made "like" data private, but researchers could still collect it by asking users to opt in. (If you want to try it, you can head over to Kosinski’s website applymagicsauce.com.)

So what does all this have to do with elections? In 2014, a young assistant professor named Aleksandr Kogan requested access to Kosinski's database on behalf of an “election management agency” based in London called Strategic Communications Laboratories. Kosinski turned Kogan down, but Kogan went ahead and registered a company under SCL's umbrella called Cambridge Analytica — an homage, he said, to the university's work in the field. Cambridge Analytica, under CEO Alexander Nix, went on to work for the pro-Brexit campaign, Senator Ted Cruz's presidential nomination bid, and then on Donald Trump's presidential campaign.

On the day of the third presidential debate between Trump and Clinton, Trump’s team tested 175,000 different ad variations for his arguments

According to a presentation given by Nix and described by the reporters, Cambridge Analytica took Facebook targeting to a new level.

Up to now, explains Nix, election campaigns have been organized based on demographic concepts. “A really ridiculous idea. The idea that all women should receive the same message because of their gender—or all African Americans because of their race.” What Nix meant is that while other campaigners so far have relied on demographics, Cambridge Analytica was using psychometrics.

Cambridge Analytica used Big Five traits to develop personality-specific messaging, Nix said in the presentation:

“For a highly neurotic and conscientious audience the threat of a burglary—and the insurance policy of a gun.“ An image on the left shows the hand of an intruder smashing a window. The right side shows a man and a child standing in a field at sunset, both holding guns, clearly shooting ducks: “Conversely, for a closed and agreeable audience. People who care about tradition, and habits, and family.”

Nix also spoke to the reporters:

...“Pretty much every message that Trump put out was data-driven,” Alexander Nix remembers. On the day of the third presidential debate between Trump and Clinton, Trump’s team tested 175,000 different ad variations for his arguments, in order to find the right versions above all via Facebook. The messages differed for the most part only in microscopic details, in order to target the recipients in the optimal psychological way: different headings, colors, captions, with a photo or video. This fine-tuning reaches all the way down to the smallest groups, Nix explained in an interview with us. “We can address villages or apartment blocks in a targeted way. Even individuals.”

This approach was also used to discourage potential Clinton voters, according to the reporters, and was also used by door-to-door canvassers:

From July 2016, Trump canvassers were provided with an app with which they could identify the political views and personality types of the inhabitants of a house. It was the same app provider used by Brexit campaigners. Trump’s people only rang at the doors of houses that the app rated as receptive to his messages. The canvassers came prepared with guidelines for conversations tailored to the personality type of the resident. In turn, the canvassers fed the reactions into the app, and the new data flowed back to the dashboards of the Trump Campaign.

The decision to focus on Michigan and Wisconsin in the final weeks of the campaign was made on the basis of data analysis

This data is what made Trump hone in on specific swing counties, according to the reporters:

The Democrats did similar things, but there is no evidence that they relied on psychometric profiling. Cambridge Analytica, however, divided the US population into 32 personality types, and focused on just 17 states. And just as Kosinski had established that men who like MAC cosmetics are slightly more likely to be gay, the company discovered that a preference for cars made in the US was a great indication of a potential Trump voter. Among other things, these findings now showed Trump which messages worked best and where. The decision to focus on Michigan and Wisconsin in the final weeks of the campaign was made on the basis of data analysis. The candidate became the instrument for implementing a big data model.

After the original German publication of this story, Cambridge Analytica denied that it uses data from Facebook — which contradicts previous statements made by the company — or that it adapted Kosinski's approach.

The power and accuracy of “big data” tends to be overhyped. When members of Outline staff — admittedly, not a crew that “likes” a lot of stuff on Facebook — tried Kosinski's site, the results were mixed.

The story, which is worth reading in full, is also inconclusive. It's difficult to tell exactly what impact Cambridge Analytica had on the election, and how much of it was due to Facebook personality targeting. However, the unexpected rise of Cruz during the primaries and his win in Iowa; coupled with Trump's unexpected win and the failure of polls to predict it, supports that conclusion. Either way, we're starting to realize the consequences of giving up so much personal information to Facebook for free.