Google says it is taking steps to help advertisers and publishers avoid the ad injectors that have been annoying everyone. It has added an automated filter into its DoubleClick Bid Manager that not only blacklists affected inventory but also removes impressions generated by these injectors before any bid is made.

Ad injection is when a program hijacks placement purchased by a legitimate advertiser. Instead of a branded advertisement, you’ll see something completely different, and potentially malicious in nature. An example given by Google is entering a website and getting prompted with this pop-up ad:

Since 2015, Google has received nearly 300,000 complaints from users who have encountered ad injectors within the Chrome browser.

As Google notes, ad injectors are extremely problematic for both advertisers and publishers. The former may not be aware that their marketing dollars and hard work are being hijacked by unknown parties — advertisers are basically giving these programs free ad space. And publishers are placed in the precarious situation of being unwilling conduits for potentially distributing spam or malware.

So the technology company is cracking down on these perpetrators, and it’s starting with a filter in DoubleClick Bid Manager. This new filter will scan its inventory to detect ad injection and, if any is detected, Google will add it to a blacklist preventing the DoubleClick system from bidding on the injected inventory. This will help ensure that advertisers won’t get their ads injected unwittingly, and that they pay only for legitimate placements.

Although Google says it has already blacklisted 1.4 percent of the inventory that’s accessed by DoubleClick Bid Manager across all the exchanges, the exact percentage varies depending on provider.