Image copyright Getty Images Image caption Kenya's president, Uhuru Kenyatta (pictured, far left), met Donald Trump at a recent G7 summit in Italy

A firm that worked for Donald Trump and which once claimed ties to a pro-Brexit campaign group is now reportedly working for Kenya's incumbent president.

Cambridge Analytica's mission statement is simple. On its website, the firm says it "uses data to change audience behaviour." Most notably, the company was hired by Donald Trump's presidential campaign and has been given some credit for Trump's electoral success.

The company purchases and compiles demographic data on voters. On its website, Cambridge Analytica claims to possess up to 5,000 data points on more than 230 million Americans. When combined with on-the-ground surveys, Cambridge Analytica can use this vast information bank to target key messages to relevant voters.

Now, Cambridge Analytica is working in Kenya, helping in the effort to re-elect President Uhuru Kenyatta.

On 10 May, The Star newspaper in Kenya reported that Kenyatta's Jubilee Party had hired the firm, and a month later, the same newspaper reported that Cambridge Analytica was working from the seventh floor of the party's headquarters in Nairobi.

Cambridge Analytica refused to comment on those reports to BBC Trending, but the global privacy-protection charity Privacy International suggests that the company is being paid $6 million for its work in the country.

Cambridge Analytica's involvement in Kenyan politics began in 2013, when the company worked for Kenyatta and The National Alliance - the forerunner of the Jubilee Party. During that year's campaign, the company correlated online data with 47,000 on-the-ground surveys. According to the Cambridge Analytica website, this allowed the company to create a profile of the Kenyan electorate and come up with a campaign strategy "based on the electorate's needs (jobs) and fears (tribal violence)." Kenyatta won the 2013 election.

Kenyans are among the most active social media users in Africa. The number of mobile phone users in the country shot up from 8 million in 2007 to 30 million in 2013, and 88% of the population can now access the internet through their phones.

Having served as Minister of Information and Communication from 2005 to 2013, Bitange Ndemo was one of the driving forces behind Kenya's technological expansion. He told BBC Trending that social media plays a "key role" in the country's political campaigns.

"It provides a fast way of responding to your opponent's propaganda," he said. "Plus, it is perhaps the only medium that can reach most young people."

Ethnic turmoil

At the same time, Kenya's recent political history has been marred by violence. This reached a peak after the 2007 general election, when a contested result caused ethnic divisions to erupt - 1,100 people were killed in the ensuing conflict, while 650,000 were displaced.

"Kenya is very tricky political terrain," says Paul Goldsmith, an American researcher and writer who's lived in Kenya for 40 years. "Cambridge Analytica might have access to surveys and other data, but that doesn't necessarily translate into useful insights. There's always something unpredictable during elections here. There's always a curveball."

"Western companies, charities and development experts tend to run into obstacles when they come to Africa," Goldsmith says. "I would be surprised if Cambridge Analytica was any different."

Ethnic divisions continue to frame Kenyan politics. Each political party remains closely affiliated with a particular ethnic group. Though Kenyatta did not stand for president in 2007, he was accused of encouraging members of his native Kikuyu ethnic group to attack members of the Luo ethnic group, who were represented in the election by Raila Odinga. The charge was taken to the International Criminal Court, but ultimately dismissed in December 2014 due to a lack of evidence. Odinga, who maintains that he was cheated out of victory in 2007, is standing against Kenyatta this time around.

Image copyright Getty Images Image caption Raila Odinga has run for president on three previous occasions

During primary elections earlier this year, held to decide the candidates for each party, seven people were killed as rival groups accused each other of vote rigging. And, earlier this week, it was reported that a senior election official had been tortured to death.

A spokesperson for Cambridge Analytica told Trending that the company is not involved in any negative advertising in Kenya, and that the company "has never advocated the exploitation of ethnic divisions in any country."

Data harvesting

Cambridge Analytica's presence in Kenya has prompted concerns about data protection. "Kenya does not currently have specific data protection legislation," says Claire Lauterbach, a researcher at Privacy International. "This basically means that it's unclear which agencies or companies can have access to individuals' data, including sensitive information."

Cambridge Analytica's strategy involves the mass harvesting and analysis of voter data. Data protection campaigners are therefore concerned about what might happen to this data after the election.

The issue even worries former government ministers, including Bitange Ndemo, who says the government has failed to pass the data protection laws that he drafted when in office. "Somehow Parliament did not quite understand its importance," he told Trending. "We need to protect personal data. The fears that data may be abused should be a concern to all."

In response, Cambridge Analytica said that the company is not compiling individualised data profiles on Kenyan voters, and a spokesperson also stated that a data harvesting programme on the same scale as recent American campaigns is not possible in Kenya.

Image copyright SIMON MAINA/AFP/Getty Images Image caption Cambridge Analytica claims that it helped Trump to win crucial swing states

Cambridge Analytica is heavily funded by Robert Mercer, a US businessman who helped to fund Donald Trump's presidential campaign and was a member of Trump's transition team. Mercer is also a major donor to Breitbart News, the website that current White House chief strategist Steve Bannon ran before joining the Trump campaign, and Bannon was once on Cambridge Analytica's board of directors.

The UK's privacy watchdog, the Information Commissioner's Office (ICO), is currently investigating the use of data analytics in the EU referendum campaign and has stated that it has concerns about Cambridge Analytica's use of personal data.

BBC Newsnight: Did Cambridge Analytica play a role in the EU referendum?

Following the Brexit vote, it was widely reported that Cambridge Analytica had assisted the unofficial Leave.EU campaign - affiliated with former UKIP leader Nigel Farage and insurance tycoon Aaron Banks. But this is a matter of dispute. Leave.EU's former communications director, Andy Wigmore, told the Observer in February that Cambridge Analytica was "more than happy to help… we shared a lot of information."

Banks, one of the founders of Leave.EU, has made contradictory statements about Cambridge Analytica's role in the campaign on Twitter. At one point, in response to a story about the firm, Banks seemed to credit the company's technology with advancing the Brexit cause:

However, he later said that Leave.EU did not enlist the company, because the Electoral Commission (EC) designated a different group as the official Leave campaign:

Cambridge Analytica denies that it was ever involved in the EU referendum campaign, and has lodged a legal complaint against the Observer.

Kenya is not the only developing country election where Cambridge Analytica is now getting involved. Bloomberg News reported that the company is also conducting initial research in Mexico, in advance of that country's presidential election in 2018.

Blog by Sam Bright

You can follow BBC Trending on Twitter @BBCtrending, and find us on Facebook.