The science of matching advertisers with TV shows is inexact at best.

At Compass Point Media in Minneapolis, planners were not impressed with the pilot episode of “Super Fun Night,’’ one of the season’s new shows on ABC.

The comedy starring Rebel Wilson got a decided thumbs-down from strategists at the division of advertising agency Campbell ­Mithun. Critics also panned the show. The Daily Beast said it was “the most disappointing” comedy of the new season.

But after its premiere two weeks ago, “Super Fun Night” was looking pretty good with a second-place finish for the night and a strong showing in the key 18-to-49 age demographic. Then, after the show’s second episode, ratings slipped.

“There is no magic box that spits out a magic answer,” said Melanie Skoglund, Media Point’s director of media strategy, about picking new TV season hits. “Art mixes with science when we negotiate [ad placement] with a network.”

For every “Breaking Bad,’’ a five-season hit that seemingly came out of nowhere, there is a “Playboy Club,’’ the 2011 drama that was canceled by NBC after three episodes. ABC’s “Lucky 7,’’ which followed the lives of fictional lottery winners, was canceled last week after two episodes.

But the stakes are large.

Although competition for advertising dollars is increasing in a media-fragmented world, TV is still king. Advertisers will spend more than $66 billion on TV spots in 2013, according to eMarketer, while digital video advertising will be in the $4 billion neighborhood.

The economics of TV advertising is pretty straightforward. Networks rely on advertisers to pay their bills; advertisers turn to networks and their shows to market their products. And that puts ad agencies and their media buyers squarely in the middle, looking at hosts of variables and metrics and sometimes trusting gut instincts to make programming decisions.

“You start looking at who a new show is competing against and where they are on the schedule. What are their chances, for instance, if they are up against [ratings stalwart] ‘NCIS’?” said Shannan Cranbrook, director of media buying for the Minneapolis agency Periscope. “You ask which one do we think is a dog? There’s no real science to it. Not every show is going to be a hit.”

For the programming season that just began, there are 52 new TV show entries. Prospects for survival are daunting. Last year only 10 out of 37 new shows lived to see a second season, according to Advertising Age.

That said, one of the principles of media buying is to spread an advertiser’s dollars in different directions in order to mitigate risk.

Hedging their bets

“It’s almost like a mutual fund,” said Noah Everist, associate director of media investments for Compass Point. “When buying, you buy a package of programs that helps amortize your spend.”

Everist said the agency hedges its bets by purchasing time on established programs and across different nights of the week.

“We use Nielsen data and other rating sources and look at what people historically watch in different time ­periods,” he said.

Indeed, ratings giant Niel­sen now offers a service called Twitter TV Ratings, which measure tweets and tweet views on a program-by-program basis. In the first week of October, ABC’s “Scandal’’ was the most-tweeted show; the week before, “Breaking Bad’’ won the Twitter ratings hands-down.

Compass Point has a propriety research tool called Fusion that blends research and data sources together to develop a mix of media plans for advertising clients.

“Media is so fragmented that you have to determine how to connect with today’s media consumer,” said Skoglund. “You not only have TV but you have Netflix, DVRs, e -readers and computers. You have to find audiences in different ways.”

Campbell Mithun’s client list includes popular consumer products from the likes of General Mills, Pillsbury and Popeyes.

Periscope places advertising for TCF Bank, Treasure Island Resort and Casino, and Ferrara Candy Co. of Chicago, among other clients.

Media planners also watch for programming trends and try to get ahead of the curve.

The 2013-2014 season is offering a rebirth of sorts in the comedy category with the likes of “The Crazy Ones’’ starring Robin Williams and “The Michael J. Fox Show’’ starring the actor by the same name. A series with a limited number of episodes like “Hostages’’ is expected to be successful because it has a beginning, middle and end in the same season. “Agents of S.H.I.E.L.D.’’ and “Sleepy Hollow’’ should appeal to the superhero fans.

But the increase in competitive programming on cable channels has made the options for advertisers more daunting. Cable has also stretched the boundaries of what can be shown on TV.

“Cable has not been a competitor in prime time except for the last few years,’’ said Cranbrook. “Now there is more license on what you can do and what you can run. You have to ask how risk-tolerant a client is. “Breaking Bad’’ is a great program, but it’s not for everyone. You’re just not putting all of your eggs in one basket.”