Usually advertisers are happy to get their product seen by as many eyeballs as possible. Not so in the case of spots running before certain YouTube videos. Several major U.S. companies were apparently caught unaware that ads featuring their products were playing before Islamic State-related videos recently uploaded to YouTube. Proctor & Gamble, Toyota and Anheuser-Busch were among the companies with pre-roll ads running before videos associated with the militant Islamist group, also known as ISIS or ISIL, that has taken over swathes of Iraq and Syria. The issue came to light in press reports last week. Since then, Google-owned YouTube has been busy removing the ads, and in many cases the videos themselves due to policy violations. Some of the ads were playing before the videos as late as Tuesday morning before the content was taken down.

"YouTube has clear policies prohibiting content intended to incite violence, and we remove videos violating these policies when flagged by our users. We also have stringent advertising guidelines, and work to prevent ads appearing against any video once we determine that the content is not appropriate for our advertising partners," a YouTube spokesperson said Tuesday in a statement to NBC News. YouTube videos are frequently preceded by ads that are picked at random by an algorithm. That means often neither YouTube nor the advertiser will know what ads are playing before which videos.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

"Our ads should not have appeared and we’re working with YouTube to understand how it happened and to avoid it happening again," Proctor & Gamble said in a statement to NBC News. Other companies whose pre-roll ads were spotted on since-removed ISIS-related videos — Toyota, Anheuser-Busch and smartwatch maker Pebble — didn’t immediately respond to an NBC News request for comment.

With more than 300 hours of footage uploaded every minute, and with ISIS-related videos cropping up from a variety of accounts, YouTube relies heavily on its users to flag content that violates its community guidelines. YouTube also has a "promotes terrorism" flag as an option underneath every video, and it reviews content that anyone flags. It also terminates accounts that it believes are created by agents of foreign terrorist organizations, including ISIS. YouTube's stated policy is also not to serve ads before videos that don't fit the definition of "advertiser-friendly" content.

IN-DEPTH

SOCIAL

— James Eng