But Ms Denham said: “Having considered the evidence we have already gathered, I have decided to open a formal investigation into the use of data analytics for political purposes.

“This will involve deepening our current activity to explore practices deployed during the UK’s EU referendum campaign, but potentially also in other campaigns.”

The probe was sparked by Labour’s Stephen Kinnock, a remain campaigner, who called on the Electoral Commission to look into links between Leave.EU and CA.

Claire Bassett, the commission’s chief executive, said, while it had “very clear rules” governing the permissibility of donations and printed materials, such as campaign leaflets, it has no power to stop overseas individuals or governments using social media to influence British elections.

“At the moment the rules apply to print media – so if you get a leaflet through your door, that should have an imprint on it which makes it clear who’s produced that leaflet and where it’s come from so you know who’s campaigning for your vote,” she said.

“At the moment those rules don’t extend to social media and we’ve recommended that that should happen.”

High priority

But quizzed about how far the electoral watchdog could go to prevent individuals or governments attempting to influence British elections via data analytic companies which target voters, Ms Bassett said: “If something is happening outside of the borders of this country and is not part of any of the regime we’re responsible for, it’s not something we can cover within our regulation.”

Ms Denham said it was “understandable” that “political campaigns are exploring the potential of advanced data analysis tools to help win votes”, but said the “public have the right to expect that this takes place in accordance with the law”.

“This is a complex and rapidly evolving area of activity and the level of awareness among the public about how data analytics works, and how their personal data is collected, shared and used through such tools is low,” she said.

“What is clear is that these tools have a significant potential impact on individuals’ privacy.

“It is important that there is a greater and genuine transparency about the use of such techniques to ensure that people have control over their own data and the law is upheld.”

‘No involvement’

Ms Denham said the investigation was a “high priority for her team” and that she was “conscious” that it coincides with the general election campaign.

The probe follows an Observer investigation suggesting there were links between data analytics firms, a US billionaire and the Leave campaign in last year’s EU referendum.

A Cambridge Analytica spokesman said the firm was happy to help the watchdog with any inquiry into the use of data analytics in politics but that it had had “no involvement” in the EU referendum.

The Electoral Commission found the Tories spent £1.2m on Facebook campaigns during the 2015 election – more than seven times the £160,000 spent by Labour. The Liberal Democrats spent just over £22,000.

Leave campaigners spent £3.5m with a technology company called Aggregate IQ. Vote Leave said it allowed them to target swing voters online much more effectively and efficiently.

But BBC media editor Amol Rajan said that while huge amounts of money were being spent by political parties online, not everyone was “transparent about their ambitions online”.

“We know that millions and millions of pounds have been spent by various people – foreign forces, sometimes extremists – who are politically advertising online trying to influence elections and they are not regulated,” he said.

“The fact is the technology is changing very fast but the law hasn’t kept pace.

“When it comes to broadcast advertising, we tend to know who’s advertising, how much money they are spending and they tend to do it within certain social norms, but when it comes to political advertising online, it’s very unclear who is spending the money and to what end….

“The point is we simply don’t have clear regulations that require people to be transparent. The implication is that they might be foreign forces; they might be very wealthy individuals who are having a material impact on elections in western or non-Western democracies and we simply don’t know about it.

“It seems pretty obvious if we regulate political advertising in other spheres we need to think very hard about the impact of political advertising online too.”