Lux Marketing

Paid Ads

Protecting Your Facebook and Google Ad Campaigns from Bot Traffic

Google Ads and Meta bid toward the people who convert. When bots fill in forms or trigger conversion events on your site, the platforms learn from those fake conversions and look for more traffic like them. This article shows how to use BotD, an open-source bot detection library, to keep bot conversions out of your bidding data.

Bot conversions teach the ad platforms to find more bots

Bots are automated programs that browse websites, click ads and even fill out forms, which makes them hard to tell apart from real visitors. When they reach your site, they cause three problems:

  1. Polluted bidding signals: a bot that triggers a lead or purchase event counts as a conversion, and the platform optimizes toward similar traffic.
  2. Wasted ad spend: you pay for bot clicks that will never become sales.
  3. Skewed reporting: bots inflate click-through rates and conversion counts, so campaigns look better or worse than they are.

Filtering on your site can’t stop a bot from clicking an ad; that happens before the visit. What it can do is stop bot visits from being reported as conversions.

BotD flags likely bots on each page view

BotD checks signals from the visitor’s browser (automation tools, headless browsers, inconsistent device data) and returns a result saying whether the visitor is likely a bot.

To add it, place this snippet in the <head> of your pages (or in a GTM Custom HTML tag that fires early):

<script>
          var botdPromise = import('https://openfpcdn.io/botd/v1').then(function(Botd) {
            return Botd.load();
          });

          botdPromise
            .then(function(botd) {
              return botd.detect();
            })
            .then(function(result) {
              window.botDetectionResult = result;
              console.log(result); // Log the bot detection result
            })
            .catch(function(error) {
              console.error(error);
            });
        </script>

The script stores the result in window.botDetectionResult, where Google Tag Manager can read it.

A GTM trigger can fire conversion tags only for human visitors

  1. Create a JavaScript Variable in GTM called “BotD Result” that reads botDetectionResult.bot.
  2. Create a trigger that fires only when “BotD Result” equals false, meaning BotD judged the visitor human.
  3. Add that condition to your Meta and Google Ads conversion tags, such as Lead or Purchase.

Detection runs asynchronously, so test in GTM preview mode that the result exists before your conversion tags fire. If it might not be ready, fire the conversion on a later event rather than skipping it. BotD won’t catch every bot, but the conversions your ad platforms learn from will contain far fewer of them.

A few account settings reduce bot traffic further

  1. Review your traffic sources and placements regularly, and exclude sites or apps that send clicks with no engagement.
  2. In Google Ads, add IP addresses that keep sending invalid clicks to the campaign’s IP exclusion list.
  3. Add a hidden honeypot field or a CAPTCHA to lead forms so bot submissions never reach your CRM.
  4. Optimize your Meta and Google Ads campaigns toward qualified leads or sales rather than raw form fills, which bots can fake more easily.
Julio Lopez
About the author

Julio Lopez · Founder & Head of Growth, Lux Marketing

Julio has spent 12+ years in paid media and analytics, and founded Lux in 2018. He has worked with 30+ clients across six industries, from DTC brands and premium wineries to a history museum. As Head of Growth at Glossi, he built the tracking and AI lead scoring behind twice the sign-ups the sales team produced, and he still writes the tracking code himself.

Julio on LinkedIn

See which campaigns produce sales before you move the budget.

The 30-Day Measurement Sprint audits your ad accounts and tracking, fixes what’s broken and sets a baseline, without changing a campaign. It’s $1,250, paid only if you decide to start; applying and the first call are free.