PARIS — For the first time since Britain's vote for Brexit shocked the world, pollsters are back in good graces. Thank the French for that.

France's practitioners of the polling arts managed what their comrades in Britain and the U.S. embarrassingly failed to do in recent months by calling last Sunday's first round of the presidential election spot on.

They attributed their success to better demographic modeling, in particular reaching first-time voters, seniors, the less-well educated and rural voters. Poor internet coverage is among the reasons why those groups tend to fall off radar screens. They also zoomed in on turnout, correctly assessing that abstention rates would be lower than in previous elections.

"We saw there were categories of voters that tend not to answer pollsters' questions: the 18-24 age category, over-75s, rural inhabitants, lower-income voters," said Jean-Daniel Lévy, head of political polling at Harris Interactive, whose predictions were within one percentage point of the final readout for the four front-runners. "We compensated statistically for such effects in groups where we knew we were getting fewer responses."

The next test comes in less than two weeks in the presidential runoff. The challenge there is how to factor in abstention rates: how many supporters of conservative François Fillon and far-left candidate Jean-Luc Mélenchon — who together won nearly 40 percent of the vote in the first round — will stay home or choose to cast a ballot for Emmanuel Macron or Marine Le Pen.

Track record

On Friday, the last day that polls could legally be published, an average of major polls offered the following snapshot: Macron at 23-24 percent, Le Pen at 22-23 percent, Fillon at 19-21 percent and Mélenchon between 18 and 19.5 percent. The final tally from France's interior ministry gave Macron 24.01 percent of the vote, Le Pen 21.3 percent, Fillon 20.01 percent and Mélenchon 19.58 percent.

Pollsters fêted the outcome of their work with champagne at the offices of major agencies, according to a source in one major agency. Commentators quipped that the election's real winner was not Macron or Le Pen but experts. "Americans and Brits will now have to turn to French pollsters, who are the winners of the first round," Bernard Pivot, a French intellectual, quipped on Twitter.

It wasn't always that way.

Fillon's camp had poured scorn on polls showing that he would lose the election, pointing out that his breakthrough in a conservative primary had gone unnoticed. Supporters shared studies showing that Fillon would win the first round based on the number of mentions he garnered in social media. France's media watchdog reprimanded Russia's Sputnik for presenting a survey, produced by the Moscow-based web analysis firm Brand Analytics, as a "poll" when it was not conducted according to legal polling methods.

French pollsters had studied mistakes made in the 2016 U.S. election, where support for Donald Trump had been badly underestimated in several states, said Leeds University's Jocelyn Evans.

"In the U.S. election the conservative vote was pretty badly underestimated," Evans said. "While pollsters were pretty spot-on with the popular vote, they failed to pick up on rising support for Trump in areas that might have had poor internet coverage, or where many people seemed to be undecided."

British lessons

The Brexit referendum polling was plagued by inaccurate assessment of turnout in some pro-Leave areas. Polls did not anticipate such strong participation from lesser-educated sections of the populace. Their erroneous predictions of a Remain victory came after a serious misreading of voting intentions before the 2015 general election, when they had shown a dead-heat between Labour and Conservatives instead of a clear victory for the Tories.

Taking stock, YouGov director of research Anthony Wells wrote in a blog for Research Live this week that those taking part in the polling had been "too engaged, too educated and too interested in politics" to be representative.

Learning from those lessons, some polling companies have since focused on improving their samples while others have changed the way they determine how likely it is respondents will vote, Wells wrote.

“The French election reminds us all that pollsters can get things right,” said Matthew Goodwin, professor of politics and international relations at the University of Kent and a senior fellow at Chatham House. “We should all treat them with more respect!”

Mistakes

French pollsters are hardly perfect. During both the right- and left-wing primary elections, they failed to predict how badly Benoît Hamon would beat former Prime Minister Manuel Valls, or pick up on Fillon's rise until the last minute.

The errors, said Lévy, were because the number of people voting was small and difficult to define. Between 2 and 4 million people were expected to vote in each primary. Pollsters could not focus only on conservative or left-wing voters because the primaries were open to all and members of the opposite side were liable to vote.

Heading into the presidential election, Lévy said they made sure their methodological approach was up-to-date. To compensate for the fact that some groups are less likely to participate in online surveys, some pollsters first reached out to potential participants by phone. The surveys were still carried out online, but the initial contact made the subject more likely to fill out an online poll, said Evans.

Another win for French pollsters was their ability to adjust estimations for voter turnout.

Lévy said efforts to capture opinions in populations with low internet coverage presented drawbacks. "In the United States, some of the most successful polling was done by handing out iPads to voters who did not have the internet or were less likely to connect," he said. "But then you run the risk of having a polling group that is far more connected to the political news, and so your poll is more volatile."

Other pollsters considered they had little chance to capture enough under-represented voters, so they compensated for them statistically. "Where we knew that we were getting less feedback from voters, particularly among the very young or the elderly, we tweaked our models accordingly," said Lévy.

He added: "Young people aged 18-24 are often not interested in answering pollsters, while seniors are harassed on the phone by telemarketers, so they don't want to participate. You take such factors into account."

Another win for French pollsters was their ability to adjust estimations for voter turnout. Just a few weeks before the vote, polls were showing predicted turnout of around 65 percent, much lower than the historical average. Yet as the vote approached they captured rising mobilization accurately, quickly ramping up their views of turnout to 70 and then 75 percent, very close to the final 77 percent.

They were also careful to capture subtle shifts in public opinion linked to political news. They rapidly picked up on the fact that Mélenchon was overtaking Hamon after a TV debate, just as they noted the powerful boost enjoyed by Macron after centrist François Bayrou joined his campaign. They were also precise in tracking a steady decline in support for Le Pen, who was seen earlier this year winning as much as 28 percent in the first round.

"Every election is a fresh challenge with its own unique parameters," said Evans. "The methodology must be constantly adjusting."