CNN  — 

Democrats in Washington believe they have found a winning strategy in Trump country: don’t nationalize the race.

Coming off the special election in Pennsylvania’s 18th congressional district Tuesday night – where Democrat Conor Lamb is poised to win – and Alabama’s special Senate election in December, national Democrats feel confident they have found a way to succeed by working behind the scenes with campaigns and focusing their efforts early on defining Republican candidates on issues that matter locally.

Lamb’s performance came in a district where Democrats didn’t run candidates during the last two elections and President Donald Trump won by about 20 points in 2016.

The new Democratic approach is informed in part by lessons learned during last year’s special congressional elections.

“Everyone learned their lesson from Jon Ossoff,” a Democrat operative said. “We realized that nationalizing a race like that obviously didn’t work and ultimately we lost.”

Ossoff lost a special election in Georgia after former Rep. Tom Price resigned to join the Trump administration in early 2017. Republicans made efforts to tie him to House Democratic leader Nancy Pelosi, a common attack strategy employed against Democratic congressional candidates.

Democrats spent over $23 million dollars on the race, in part fighting back at the GOP messaging, but it ultimately went to Republican Rep. Karen Handel.

After the stinging defeat in Georgia, along with four other House special elections in which Republicans kept control, Democrats needed a new strategy to help candidates in tough races in the places Trump won during his campaign.

Working with campaigns and state parties early in the Pennsylvania race, they employed strategies like hosting phone banks, joint fundraisers, and sending out mailers. They also funded parts of the campaign by investing in local field staff, analytical models, polling and get-out-the-vote efforts in conjunction with the campaign.

However, the groups didn’t dictate the terms of how their money should be spent, leaving it to the state parties and campaigns to decide how they would be most effective.

“The contributions the DNC and DCCC made to the state party helped us put together a pretty robust canvass and mailing program that we were able to use to get out the vote,” Pennsylvania Democratic Party Press Secretary Brandon Cwalina said. “With those contributions to state party, we could do a paid canvassing program. We also did a targeted mailing program to voters in the district. The paid canvas program has reached about 120,000 houses. The mailing program was sent to about half a million people.”

The DNC and DCCC are beginning their investments earlier and waiting longer to make their investments public, often within a few days of the race to not seem publicly like they are trying to influence voters.

Spending by the party began in Pennsylvania in December, well before the race became strongly contested. Since then, the DCCC has spent more than $1 million to help Lamb win.

“The DCCC invested in smart ways – for the most part behind the scenes – in a strategically timed but short television buy, and a significant investment in digital advertising and field work,” a Democratic source familiar with the spending strategy told CNN.

By Election Day, the DCCC’s resources had reached thousands of voters in the district, with over 10 million impressions alone from their digital strategy.

Democrats also point to Alabama, where they employed the same tactics to elect Doug Jones to the Senate. After his opponent, Roy Moore, was credibly accused by several women of pursuing sexual relationships with them when they were teenagers, molesting a 14-year-old and sexually assaulting a 16-year-old when he was in his 30s – charges he has denied – they were able to ramp up their efforts to help Jones over the finish line.

“I think Doug Jones is the textbook example of how to win in Trump Country. Allegheny county, Pittsburgh –those are very red areas,” the national Democrat said, referring to the area of Pennsylvania’s 18th congressional district.

Outside groups are following suit. American Bridge, a Democratic super PAC, worked to define Saccone as out of touch using opposition research, earned and paid media.

The group touted their efforts, including finding old clips of Saccone speaking about the opioid crisis, in which he said families should take more responsibility for their loved ones, not the taxpayers. Pennsylvania has one of the highest rates of drug overdoses in the country.

“American Bridge was the first group to recognize that Saccone’s positions on the opioid epidemic could prove to be a liability in this election,” said American Bridge Deputy Communications Director Andrew Bates. “We leveraged our research to have a real impact on the race, putting Saccone on the defensive from the start of our efforts until the very end of the campaign.”

In the lead-up to the election, Republicans agreed that Democrats defined both Lamb and Saccone early on opioids and taxes, making it difficult for Saccone to break through with his own personal story. OutsideRepublican groups jumped in as the campaign heated up, spending $8 million more than what outside Democrats invested into the race, but it ended up not being enough, despite Republicans’ historic strength in the district.

Democrats see this as key to taking back the House and potentially the Senate in November, as they tie local issues negatively to the Trump administration.

“The fact is that the Trump administration and the Republicans who are rubberstamping it in Congress have become an enormous albatross for Republican candidates, even in districts Trump won handily in 2016,”Bates said. “We are going to use this model… where we work to define these candidates.”