EVEN advertisers can be seduced by slick marketing. Google and Facebook have built huge businesses by promising that online ads are more effective and easily measured than traditional media, such as television, radio and print. This year the amount spent on internet advertising, globally and in America, is forecast to surpass television advertising for the first time (see chart). But a controversy at YouTube, an online-video site owned by Google, shows how digital advertising still has problems to sort out before it lives up to the dazzling sales pitch. A slew of advertisers, including stalwarts such as Coca-Cola, Walmart and General Motors, have announced plans to suspend usage of, or move ad spending away from, YouTube because ads (in some cases their own) were appearing alongside offensive content, including videos by jihadist and neo-Nazi groups. Google’s own brand has suffered: the damage to the firm’s sales could be as much as $1bn in 2017, or around 1% of its gross advertising revenue. Shares of its parent company, Alphabet, have fallen by around 3% owing to the controversy.

It is not the first time that brands have fretted about where their ads appear. In 2013 Nissan drew headlines when it placed an ad alongside a video of a beheading on the website Forbez DVD. There have been other incidents. But never before have so many advertisers raised concerns about what they call brand “safety” all at once and staged such a dramatic boycott.

The timing may not be coincidental. Television networks are gearing up for negotiations with advertisers as part of America’s “upfronts”, in which brands commit around 70% of their TV-ad budgets for the year. It is in their interest to encourage big brands to look critically at digital advertising, which has been trouncing nearly all the other categories. The furore over extreme content escalated after the Times, a London-based newspaper owned by Rupert Murdoch, whose empire also contains many television properties, ran a story in mid-March with the headline, “YouTube hate preachers share screens with household names”. Advertisers may also be hoping to negotiate better pricing on their future internet-ad buys by taking a strong stand on this issue, says Mike Henry of OpenSlate, which helps brands place ads on YouTube.

Few can now do without ads that are bought “programmatically”, meaning in an automated fashion using algorithms. The technique allows brands to follow internet-goers wherever they spend time and direct ads specifically at them. “What’s strange is that everyone was so fascinated with targeting ads that they forgot to ask themselves the mundane question of what content they are appearing next to,” says Rich Raddon of Zefr, an ad-tech firm.

In other ways, too, digital advertising is falling short. In September Facebook admitted that it had inflated the reported time consumers spent watching video advertisements, and since then has acknowledged further measurement snafus. All these issues have invited censure, including from Marc Pritchard, whose role as marketing chief of the consumer-goods giant Procter & Gamble makes him one of the overlords of advertising. “Surely if we can invent technology for driverless cars and virtual reality we can find a way to track and verify media accurately,” he said.

Although advertisers may be frustrated with YouTube’s poor oversight of where ads appear, there is a limited supply of high-quality online video. YouTube is like a restaurant in a small town: the service may be slow and the quality of food unpredictable, but there are few alternatives, so the clientele sticks around. Today Google and Facebook control around three-fifths of spending on digital ads in America, and their share is only expected to rise.

Google and Facebook might consider making concessions to advertisers. At the moment Google does not allow third parties, such as the firm Integral Ad Science, to filter or block inappropriate content on behalf of advertisers, even though these independent firms have the technological tools to do so. That could change if advertisers continue to exert pressure.

Advertisers can monitor ad placement, too. There are tools for this: on YouTube and elsewhere on the internet, firms can select keywords so that they stay away from certain contexts. Banks can avoid videos and articles that mention foreclosure, for example, and carmakers can choose not to bid on ad space near articles about crashes. But only about 15% of advertisers are using this sort of tool, reckons Scott Knoll, the chief executive of Integral Ad Science. In the future more will probably turn to such solutions, and also pay for outside measurement to check if their ads are being seen. Technology has brought headaches for advertisers, but that won’t prevent them investing in more of it.