Kelly Ayotte’s reelection race was always going to be a steep uphill climb. She’s facing a relatively popular opponent in Gov. Maggie Hassan, an electorate looking for change, and the more Democrat-friendly New Hampshire voters who typically turn out in presidential years.

But as Ayotte struggles to reach escape velocity, the pull of Donald Trump’s unpopularity threatens to keep her earthbound.

Trump trailed Hillary Clinton in all nine of the New Hampshire polls from September. This is a problem for Ayotte, given the close partisan link between votes for presidential and Senate candidates, which has increased in recent decades.

Ayotte’s challenge was on display just this week in a debate with Hassan, as she first agreed that that Trump could be a role model for kids, and then awkwardly recanted that remark just hours later. Such are the challenges posed by Trump’s staggering unpopularity in New Hampshire: A recent poll for WBUR found just 32 percent of Granite State voters held a favorable view of Trump, including only 23 percent of women voters.

If Trump continues to struggle, finding a way to loosen the link between Trump’s numbers and her own will be essential to Ayotte’s reelection.

Graphic: While Hillary Clinton has maintained a relatively stable and wide lead over Donald Trump in New Hampshire, the race between Kelly Ayotte and Maggie Hassan has been much closer, with polls showing the contest in a dead heat since the spring.

Ayotte is already showing some signs of success at that, running very close to Hassan in most recent polls. Her advantage over Trump comes mostly from Republicans willing to split their ticket and support Ayotte while opposing Trump. Identifying and turning out these voters could help Ayotte and other down ballot candidates succeed, even if Trump loses New Hampshire.

Recent polling shows where Ayotte is separating herself from Trump and where she’s not. Among registered Republicans, Ayotte’s margin over Hassan is 15 points better than Trump’s over Clinton in polls taken since the convention. This suggests Republican voters are not seeing Trump as a reason to abandon other candidates in their party.

But independent voters are the ones Ayotte most needs to see her as separate from Trump. Her campaign is also working on this task: Her ads and website focus on bipartisanship and emphasize state issues rather than national partisan warfare. Even so, she’s running no closer than Trump among undeclared voters. Her 11 point deficit to Hassan among registered undeclared voters in the latest WBUR poll is identical to Trump’s.

Ayotte needs Trump’s voters in her corner

Though Ayotte’s association with Trump may not help her with independent voters, she can’t veer away too hard, and seems to have decided she can’t cut ties with Trump altogether. Monday’s debate and the aftermath showed this clearly. With her race against Hassan on a razor’s edge, she can’t afford to lose the support of even a modest number of Trump voters, who still make up the bulk of her support. Contrary to Trump’s false claims that he’s beating her in the polls, Ayotte is more popular than he is. But she still needs his supporters to stick with her, so running in the other direction may not benefit her.

Still, Ayotte has taken sharply critical stances against Trump on a host of issues, from the ban on Muslims, the Khan family, and Judge Curiel. At the same time, she’s declined to officially “endorse” Trump, opting to simply “support” him. She wants to be distant from Trump, but keep his supporters close. It’s as simple as that.

Split ticket voting could boost Ayotte

In trying to separate herself from Trump, Ayotte is also battling historical trends. Split ticket voting has been declining in recent years, as party polarization has taken control of political behavior.

This challenge isn’t unique to Ayotte. A recent analysis in The Atlantic looked at competitive Senate races across the country this year, and found party voting remains strong in competitive races across the country. Another analysis showed just 10 percent of voters split their ballots in 2012, down from 28 percent in 1972.

But if there were ever a year ticket splitting could rebound, this could be it. Trump’s penchant for hammering other Republicans has not won him a lot of friends in high places, and his positions rarely fit on the traditional political spectrum. He provides voters with excuses for ticket splitting that a more conventional Republican does not.

Even President Obama said something similar at the Democratic convention this summer, calling Trump’s conservatism into question and offering Trump skeptics within the GOP a lifeline.

“Look, we Democrats have always had plenty of differences with the Republican Party, and there’s nothing wrong with that. It’s precisely this contest of idea that pushes our country forward. (Applause.) But what we heard in Cleveland last week wasn’t particularly Republican -- and it sure wasn’t conservative.”

In doing so, Obama may inadvertently help Ayotte by giving justification to those considering splitting their ballots. And that’s just what she needs.

Steve Koczela is president of The MassINC Polling Group. He writes for NHPR about polling, voter demographics and other topics related to New Hampshire's presidential primary and 2016 state elections. Follow Steve on Twitter.