With the entire political establishment massed against them and the bookmakers giving them no hope, the Leave campaign faced what many thought was an impossible battle to take Britain out of the European Union.
But election data published yesterday has provided a window into how Vote Leave upset the odds to land a sensational victory in last year's EU referendum.
While the Remain camp boasted of their success in reaching out to millions of people on Facebook, home to the millennial voters who would be expected to back Britain staying in the EU, it has emerged that the Leave campaign spent nearly half of its cash on a secretive consultancy firm that helped win the social media battle.
AggregateIQ, a technology company operating out of a tiny office above an opticians in a provincial Canadian city, was given £3.5 million ($6m) by Leave campaigners in the run up to last year's EU vote - equivalent to more than 10 per cent of the £32 million spent by both sides during the campaign.
According to the Electoral Commission figures, no other company or individual was handed more cash during the referendum battle, with the official Vote Leave group spending 40 per cent of its £6.8 million budget on the firm.
Run by a former university administrator, AIQ is a low-profile consultancy that, among other things, specialises in developing highly-targeted Facebook advertising.
Vote Leave officials said the company had been "instrumental" in securing an Out vote in last June's referendum, after developing sophisticated models to relentlessly hone the campaign's online message.
A senior figure on the Leave campaign said: "Their prime focus was buying and placing ads and optimising them, working out which ones worked best."
AIQ was set up in 2013 by Zack Massingham, a 34-year-old Canadian former university official turned digital marketing guru.
The company has 20 staff and works out of a second floor office in a shopping centre in downtown Victoria, a picturesque city at the southern tip of British Columbia.
It's senior staff keep a very low public profile, fiercely guarding the identity of their clients, who are drawn from across the political spectrum.
An insider said: "We look to work on both sides of the aisle. We don't want to be pigeonholed and we don't ally ourselves to any political movement."
Mr Massingham, who became involved with politics after working on the provincial leadership campaign of a centre-right Canadian politician, said his company had worked "on everything from small mayoral campaigns, to presidential primaries in the US," although it is understood that they were not involved with Donald Trump's successful presidential bid.
He added: "We have worked in Europe, North America, South America, and Africa - across the political spectrum - helping campaigns, candidates, and other organizations to build and mobilize audiences, engage with their voters, and make sense of these interactions through the data they collect.
"We build software tools, database solutions, and engagement strategies that help focus campaign efforts to achieve their goals."
The company's website features an approving quote from Dominic Cummings, the campaign director of Vote Leave, who says: "Without a doubt, the Vote Leave campaign owes a great deal of its success to the work of AggregateIQ. We couldn't have done it without them".
Mr Cummings wrote in a blog last month that the group had fought against the "all-pervasive charlatanry" amongst experts in the advertising industry and instead "put almost all our money into digital".
He wrote: "When things are digital you can be more empirical and control the timing. The world of advertising agencies and PR companies were sure we had screwed up because they did not see what we were doing."
Mr Massingham said that Vote Leave had won because the campaign "appreciated and embraced technology".
He said: "They really understood the importance of digital marketing and a strong technology infrastructure. They wanted to know what their supporters cared about and how the campaign could best reach out to those supporters to help them understand the benefits of voting to leave the EU.
"Though we are listed as one of the largest expenditures, the reality is the vast majority of that money was for online advertising to those groups of people the campaign wanted to reach."
Paul Stephenson, the communications director of Vote Leave, said: "Zack and AIQ were instrumental in helping the Leave campaign win. Together with our digital director, Henry De Zoete, they transformed Vote Leave's digital offering and helped us to contact voters over one billion times online.
"Traditional advertising agencies wanted us to spend most of our money on expensive billboards but AIQ enabled us to reach our target swing voters online much more effectively and efficiently. They are great campaigners."