Heading into 2016, Democrats were known for their online campaign wizardry, and Andrew Bleeker was a critical cog in the machine — he helped run digital marketing for both of Barack Obama’s presidential campaigns, and then Hillary Clinton’s. As he dived into a postmortem after a shocking November, Bleeker took umbrage at the victory lap Donald Trump consultants took for the campaign’s online work. Bleeker contends that Trump’s digital game was more about “selling hats” than changing minds, but a peek down-ballot shows “the much more, sort of, frightening part as a Democrat.”

An analysis by Bleeker’s firm, Bully Pulpit Interactive, revealed some striking numbers: Across gubernatorial, Senate and House races, Republicans often devoted a far bigger proportion of their turnout and persuasion budgets to the web than Democrats did. A deeper look at 17 closely contested U.S. House races found that party committees and allied super PACs spent roughly the same total amount on advertising, but 28 percent of the Republican budget went to digital compared to just 4 percent for Democrats.

The DCCC maintains a huge commitment to investing and innovating across digital platforms this cycle.

Tyler Law, Democratic Congressional Campaign Committee

As 2018 dawns, with control of the House at stake — and a large number of competitive districts to attack — Democrats say they are eager to close the gap. Priorities USA, a major super PAC, plans to spend $50 million on digital advertising in 2018. The Democratic Congressional Campaign Committee is increasing its spending too. “Recognizing the shifting ways that voters absorb information and the unique political environment we face, the DCCC maintains a huge commitment to investing and innovating across digital platforms this cycle,” says spokesman Tyler Law.

But political campaigns are not known for being cutting edge. It can take two years before you figure out what works at the ballot box, unlike week-over-week performance in product sales. For years, Democrats had a clear edge. Howard Dean’s 2004 presidential campaign put online fundraising on the map. Team Obama 2008 created its own social network to connect supporters. In 2012, Republican Mitt Romney’s campaign hyped a voter analytics platform they called ORCA, but it broke down on Election Day. Given the Democrats’ younger voting base, it made sense that they would thrive early online. But now even grandma lives on Facebook.

President Obama’s presidential re-election campaign app for the iPhone,

That means political campaigns must woo voters online, in some combination with television, radio, flyers in the mail and old-fashioned door-knocking. Using low-cost digital tactics to raise money online is an easy sell, but deciding how big a chunk of a limited advertising budget to devote to the web can be a more difficult argument. “It’s a sea change,” says Scott Tranter, of Republican digital firm Optimus. “It’s slow — slower than everyone wants.”

Part of it has to do with who is making the decisions. Campaign managers — and candidates themselves — who came up through the political ranks worshipping the power of a great television ad may want to stick with the tried and true. But gradually, more digital natives are becoming decision-makers. Tranter says he started out in 2006 running a field office in eastern Connecticut. By this past cycle he was director of analytics for Marco Rubio’s presidential campaign, “having a significant say in how tens of millions of dollars are spent.”

Another hurdle to convincing a campaign to spend big online has to do with disclosure. Television ad buys are required to be made public in real time by the Federal Communications Commission, while online spending dribbles out later in campaign finance reports. A campaign getting swamped on the airwaves due to an imbalance in gross ratings points might deviate from well-laid spending plans. “No campaign manager is ever going to get fired for trying to match point by point on TV,” Bleeker says.

Advertising strategies will shift dramatically in a midterm year, when compared to a presidential contest. While everyone had an opinion on Trump and Clinton because of saturation media coverage, congressional races receive less coverage and are a blank slate for most voters — meaning paid advertising can have a bigger impact. Even digital advocates say there’s no reason to ditch television altogether, and the recommended media mix will vary widely by race. In some cases, there’s one television market where it’s worth spending your money to reach your key audience during Jeopardy! or football games. But in, say, California, where there are four critical U.S. House races in Orange County alone, buying airtime in the uber-expensive Los Angeles market is horribly inefficient.

“The whole Democratic Party is interested in this conversation,” says Bleeker, whose firm, according to Federal Election Commission filings, does work for most of the party establishment and key outside groups. “All of the major leading Democratic groups — Emily’s List, the DNC, the DCCC — everyone is preaching a more balanced mix, a more data-driven approach.”

The Republicans are doing the same. Tranter says he doesn’t see much of a gap, just both parties ramping up online. In the 2014 midterms, it was rare to see a campaign spend $500,000 digitally in an entire election cycle. Yet Illinois Republican Gov. Bruce Rauner’s re-election campaign easily passed the $1 million online spending mark, Tranter says, before the ball dropped to begin his election year.