If Maxime Bernier had swung just a few dozen votes over to him in only a handful of ridings, he would be the leader of the Conservative Party today instead of Andrew Scheer.

An analysis of riding-by-riding data suggests that the Conservative Party just narrowly avoided giving the leadership to a candidate who would have won by points but lost in votes, a potentially controversial result that might have spurred calls for a change to the leadership rules.

The system used by the Conservatives awarded 100 points equally to each of Canada's 338 ridings, making the leadership race a contest for points rather than votes.

On that score, the result of the leadership vote was extremely close. Scheer took 17,221.2 points on the 13th and final ballot, compared to 16,577.8 points for Bernier — or 50.95 to 49.05 per cent.

But this close race for points masked a more comfortable edge for Scheer among votes. By the final round, Scheer had 53 per cent of active ballots against 47 per cent for Bernier, a difference of 7,049 votes.

The discrepancy between the two is the result of the points system, one of the conditions of the 2003 merger between the Canadian Alliance and the Progressive Conservatives. At the time, the Canadian Alliance had many more members than the PCs and these members were heavily concentrated in Western Canada. The PCs had proportionately more members in Quebec and Atlantic Canada. Giving each riding equal weight levelled the playing field.

It has been a contentious issue at Conservative conventions, pitting former Reform and Conservative MP Jason Kenney against Peter MacKay, the leader of the PCs who negotiated the merger deal.

But the impact of the rules system in Saturday's vote might have been significant. Potentially as few as 66 votes in just eight ridings might have kept Bernier from victory — six of those ridings in his home province of Quebec.

Important ridings with few voting members

The Conservative Party has not publicly released the number of ballots cast in each riding. Kevin O'Donnell, a ranked ballot advocate who placed Michael Chong first on his ballot, runs the website OttWatch.ca, which compiles and scrapes data from Ottawa's municipal website. Using that expertise, he managed to snatch leadership vote numbers that were hiding in plain sight.

The results of the vote on the Conservative Party's website were being populated by data that could be found elsewhere on the internet on a website registered by Dominion Voting Systems, the company that handled the Conservatives' leadership vote.

That data, which the Conservative Party would not confirm as accurate but which appears to align with what figures have been released by the party, contains not only the publicly available riding-by-riding and ballot-by-ballot results, but the total of ballots cast in each riding as well.

Using that data, it is possible to identify the ridings where the fewest members participated — and where the leadership vote could have swung most dramatically.

66 voters in 8 ridings decide outcome?

The numbers suggest that by the final round, excluding those ballots in which neither Bernier nor Scheer were ranked, several ridings had fewer than three dozen active votes.

According to the scraped data, 28 ballots were active in Rosemont–La-Petite-Patrie by the final round, with Bernier having 15 of them and Scheer 13. In La Pointe-de-l'Île the total was just 25 ballots. In Abitibi–Baie-James–Nunavik–Eeyou, it was 22. There were 21 votes still active in the final round in Labrador, 19 in Rivière-du-Nord, 16 in Gaspésie–Les Îles-de-la-Madeleine, 16 in Repentigny and just 14 in Nunavut.

In these eight ridings, Scheer took a total of 68 votes worth 329.75 points in all. By comparison, the roughly 650 votes for Scheer in the single riding of Medicine Hat–Cardston–Warner were worth just 54 points to him.

Bernier needed 322.3 more points in order to win the race. Those points could have most easily come from these eight ridings with 11 of Scheer's 13 supporters in Rosemont–La-Petite-Patrie and his 55 voters in the other seven ridings.

Those 66 votes represent just 0.05 per cent of the 141,362 ballots cast nationwide.

Avoiding a divisive result

This marginal loss suggests that either Bernier's campaign did not target ridings effectively or that Scheer's campaign went after points in the right places — perhaps both. But had Bernier been able to secure a handful more votes in a dozen or so ridings and win the leadership, he would have done so with a significant deficit in the popular vote and serious questions about his legitimacy as leader.

Scheer won both on points and votes. But the razor-thin margin shows how the Conservative Party just narrowly avoided a potentially divisive outcome.