WASHINGTON • It was one of hundreds of cute questionnaires that were shared widely on Facebook and other social media platforms, like "Which Pokemon are you?" and "What are your most used words?".

This one, an app called "thisismydigitallife", was a personality quiz, asking questions about how outgoing a person is, how vengeful one can be, whether one finishes projects, worries a lot or is talkative.

About 320,000 people took the quiz, designed by a man named Alexsandr Kogan, who was contracted to do it by Cambridge Analytica, founded by United States Republican supporters including Mr Steve Bannon, who would become the strategist for Mr Donald Trump.

As Dr Kogan's app was circulated via Facebook, it reaped far more than just the information on those who took the test.

At the time, in 2015, such apps could scrape up all the personal details of not only the quiz-taker, but also all their Facebook friends.

That ultimately became a horde of data on some 50 million Facebook users - their personal information, their likes, their places, their pictures and their networks.

Marketers use such information to pitch cars, clothes and vacations with targeted ads. It was used in earlier elections by candidates to identify potential supporters.

But for Dr Kogan and Cambridge Analytica, it was a much bigger goldmine. They used it for psychological profiling of US voters, creating a powerful database that reportedly helped carry Mr Trump to victory in the 2016 presidential election.

The British-based political consultancy firm says its work with data and research allowed Mr Trump to win with a narrow margin of "40,000 votes" in three states, providing victory in the electoral college system despite losing the popular vote by over three million votes, according to Slate, an online magazine.

The data let the Trump campaign know more than perhaps anyone has ever known about Facebook users, creating targeted ads and messaging that could play on their individual biases, fears and loves - effectively creating a bond between them and the candidate.

The data collected via Dr Kogan's app generated an incredible 4,000 or more data points on each US voter, according to Mr Alexander Nix, Cambridge Analytica's chief executive before he was suspended on Tuesday. The output was put to work in what Mr Nix called "behavioural micro-targeting" and "psychographic messaging".

Simply put, the campaign could put out messages, news and images via Facebook and other social media platforms that were finely targeted to press the right buttons on an individual that would push him into Mr Trump's voter base.

For Mr Trump, it worked.

AGENCE FRANCE-PRESSE