Provo Mayor John Curtis’ lead in the GOP primary race to replace former Rep. Jason Chaffetz is narrowing amid a barrage of attacks by groups supporting his opponents.

A new UtahPolicy.com poll, conducted by Dan Jones & Associates, shows Curtis with 31 percent support, followed by 23 percent for former state Rep. Chris Herrod and 15 percent for businessman Tanner Ainge.

A sizeable 26 percent are still undecided as the by-mail election is proceeding before the official Election Day on Tuesday. The poll, conducted Aug. 2, 3 and 8, has a margin of error of 4.6 percent.

The new poll surveyed mostly Republicans, but also some unaffiliated voters — who are still eligible to cast a ballot if they sign papers to affiliate with the Republican Party on or by Election Day. In Utah, only registered Republicans are allowed to vote in GOP primaries.

Curtis had led opponents by a 2-1 margin last month among registered Republicans in a Salt Lake Tribune/Hinckley Institute of Politics poll, also conducted by Jones.

That earlier poll showed Curtis with 37 percent support, 17 percent for Ainge and 14 percent for Herrod, with 32 percent undecided.

“Many of the undecided went to both Herrod and Ainge,” said pollster Jones. “The mayor is ahead among those who have voted” by mail so far.

He added that 27 percent of those polled reported already had cast by-mail ballots.

Among those who are yet to vote, the new poll found 23 percent were leaning toward Ainge, 20 percent for Curtis and 15 percent for Herrod — with another 39 percent remaining undecided.

“I would still rather be in the Mr. Curtis’ shoes than in the others,” Jones said.

He said that the narrowing of Curtis’ big lead shows that negative ads can work. “But people can see through them, too, and it can backfire,” Jones said. “Those who have been using it haven’t taken the lead, but the margin has closed.”

Out-of-state super PACs have spent nearly $853,000 since May in the primary — more than double the outlay of all three GOP candidates’ own campaigns combined.

The top outside contributor is the conservative Club for Growth, which has spent $290,000 to support Herrod while tearing down the other two. In a Halloween-themed ad, it says Curtis and Ainge are “busy pretending to be conservatives.”

Meanwhile, the Conservative Utah PAC received a quarter-million dollars from Ainge’s mother, and its ads have especially attacked Curtis as a “former Democrat” — and attacked Curtis and Herrod for supporting tax increases.

Republican candidate Chris Herrod speaks during a debate at the Utah Valley Convention Center Friday, July 28, 2017, in Provo, Utah. Republican candidates John Curtis, Tanner Ainge and Herrod, vying for the seat vacated by U.S. Rep. Jason Chaffetz, debated on topics ranging from healthcare to religious freedom. (AP Photo/Rick Bowmer)
Republican candidate Chris Herrod speaks during a debate at the Utah Valley Convention Center Friday, July 28, 2017, in Provo, Utah. Republican candidates John Curtis, Tanner Ainge and Herrod, vying for the seat vacated by U.S. Rep. Jason Chaffetz, debated on topics ranging from healthcare to religious freedom. (AP Photo/Rick Bowmer)

In a debate this week on KSL Radio’s Doug Wright show, Curtis complained that the ads targeting him are inaccurate — and called on his opponents to disavow and help stop them.

“It needs to be said that I don’t have control of an outside PAC,” Herrod said in response.

“To me, it’s not negative to talk about record. And if you look at Mayor Curtis’ record, everything we say is true,” Ainge added in that debate.

The new poll showed “strong Republicans” gave a plurality of support to Herrod, while “not so strong Republicans” and independents who lean Republican gave pluralities to Curtis.

Republican candidate Tanner Ainge speaks during a debate at the Utah Valley Convention Center Friday, July 28, 2017, in Provo, Utah. Republican candidates, John Curtis, Chris Herrod and Ainge, vying for the seat vacated by U.S. Rep. Jason Chaffetz, debated on topics ranging from health care to religious freedom. (AP Photo/Rick Bowmer)
Republican candidate Tanner Ainge speaks during a debate at the Utah Valley Convention Center Friday, July 28, 2017, in Provo, Utah. Republican candidates, John Curtis, Chris Herrod and Ainge, vying for the seat vacated by U.S. Rep. Jason Chaffetz, debated on topics ranging from health care to religious freedom. (AP Photo/Rick Bowmer)

Among those who self-identified as “strong Republicans,” Herrod received 28 percent support; Curtis, 22 percent; and Ainge had 19 percent, with 26 percent undecided

Among those who said they were “not so strong Republicans,” Curtis has 37 percent support; Herrod, 26 percent; and Ainge, 11 percent, with 26 percent undecided.

And among those who classified themselves as independents who lean Republican, Curtis had 44 percent support; Herrod, 15 percent; and Ainge, 10 percent, with 26 percent undecided.

Jones found that 30 percent of those polled said Gov. Gary Herbert’s pre-primary endorsement of Curtis made them more likely to vote for the Provo mayor. But 67 percent said the Herbert support had no impact on their vote.