Google Analytics: Filter Facebook Ads Bot Traffic from Irvine, CA

So, you’ve noticed a lot of traffic coming from Irvine, California. And you noticed all this traffic was coming from Facebook Ads. In most cases, this is going to be bot traffic. A quick look at the behavior stats will show that most if not all of the traffic has a bounce rate of 100% with 1 page / session, and an avg. session duration of 0 seconds.

So, yeah… That’s a pretty good indication that this is bot traffic.

But just to be on the safe side, take a quick peek at the Network Domain (the domain of the user’s ISP) and Service Provider (the name of the ISP).

Hmm… “(not set)” and “facebook ireland ltd”, eh? Yep. I think it’s pretty safe to say we’ve got bot.

How to Exclude the Facebook Ads Bot

Currently (as of January 17, 2020), the Google Analytics “bot” filter doesn’t seem to be catching this one. So, we’ll have to do a little fancy footwork and do it ourselves.

Now, some might think, “Why not just exclude all traffic from Irvine?” But you, being a more sophisticated Analytics user, realize that once in a while you’re probably going to get some “real” traffic from Irvine. There’s no sense in throwing out the baby with the bathwater.

So… What do we exclude, then?

I’m glad you ask.

Now, like I said, this is going to require a little fancy footwork. Fortunately, though, you and I both enjoy a good challenge.

UPDATE

Shortly after I originally published this post, the people running the Google Analytics show decided to stop collecting the service provider and network domain for us. Whomp, whomp. But not to worry. We can still get that data. Here’s how.

Step 0: Get ISP, Service Provider, and Network Domain Back into Google Analytics

Follow the steps here to get the ISP, service provider, and network domain back into Google Analytics.

Step 1: Concatenate Network Domain and Service Provider

We’ll start with those two clear indicators: Network Domain and Service Provider.

We’re going to combine the two fields into a single field. To do this, we use an advanced filter.

  1. Navigate to Admin > Filters (under the “View” column, of course)
  2. Click “+ Add Filter”
  1. Enter a name for filter #1
  2. Select “Custom”
  3. Choose the “Advanced” filter type
  1. For “Field A -> Extract A”, select “ISP Domain” and enter (.*)
  2. For “Field B -> Extract B”, select “ISP Organization” and enter (.*)
  3. For “Output To -> Constructor”, select “Custom Field 1” and enter $A1$B1
  1. Select “Field A Required”, “Field B Required”, and “Override Output Field”
  2. Click Save

So, what does all this do? Well, it grabs the ISP Domain (i.e. the “Network Domain”) and the ISP Organization (i.e. the “Service Provider”), combines them into a single value and assigns that value to the “Custom Field 1” field. (Custom Field 1 is “An empty, custom field for storage of values during filter computation. Data is not stored permanently in this field, but can be written to Custom Field 1 or 2 to be used by a subsequent filter.”)

In other words, when Analytics sees a hit from our Facebook Ads bot, it’ll temporarily set the value of “Custom Field 1” to “(not set)facebook ireland ltd”.

Step 2: Exclude Custom Field 1

This is the easy part. Your second filter will simply exclude any hits were Custom Field 1 includes “not set” followed by “facebook ireland ltd”.

  1. Create another filter
  2. Name it something like “Exclude Facebook Ads Bot”
  3. Select “Custom”
  4. Select the “Exclude” filter type
  5. For the “Filter Field”, select “Custom Field 1”
  6. For the “Filter Pattern”, enter: ^.*not set.*facebook ireland ltd.*$
  7. Click “Save”

And that’s all there is to it. From this point forward, Analytics will say sayonara to Facebook Ads bot traffic. Enjoy!

Subscribe to Learn More Google Analytics Secrets

8 thoughts on “Google Analytics: Filter Facebook Ads Bot Traffic from Irvine, CA”

  1. Unfortunately that doesn’t always work as the network domain isn’t always set. I suspect that’s the reason why GA doesn’t already filter that traffic.

    Thank you

    Reply
  2. Hi Dave,

    I’m running into exactly the same issue, it’s a new business and i’m worrying this bot traffic is affecting my ad optimization. If the Facebook Pixel is receiving lot’s of data from bots and tries to find people like this bot traffic my ads will just be optimizing on bad audiences. CTR is really low for my ads. Do you have anyway to block these bots from firing the my pixel?

    Thanks!

    Reply
    • The Facebook ad bot’s purpose is likely to verify that the ad URL exists and returns a 200 response. Bot traffic (from FB or otherwise) shouldn’t have any impact on Facebook ad optimization because bots don’t typically have Facebook profiles. Facebook only shows ads to Facebook and Instagram users. So, unless these same bots happen to be avid Facebook users, as far as CTR goes you likely don’t have anything to worry about.

      The issue with CTR may be sub-optimal targeting and/or sub-optimal ads. Be sure to run split tests on your ads and audiences. Keep the winning combinations. Then try to beat them. Rinse and repeat.

      Now, to answer your question…

      There are a few things you could do to prevent bots from firing your pixel. A simple solution would be to remove the tag. Most bots don’t load JavaScript. So, they’d only be tracked by the loading of the actual “pixel”, i.e. the 1×1 image loaded in the tag. Of course, by doing so you run the risk of not tracking a small percentage of real users whose browser does not run JavaScript.

      Reply
  3. Hi David, your article was extremely helpful. It helped our company uncover why our entire page load time graph had been skyrocketing upwards — we had facebook ad bot traffic coming in at 120 second page load time, which was skewing the average (GA’s “average page load time” is known to be easily skewed by a small number of outliers).

    Unfortunately, starting in February, Google Analytics deprecated Service Provider and Network Domain!! We filtered out all Irvine traffic just to isolate the page load time issue, and it indeed fixed it.

    However, going forward without the ability to see Service Provider and Network Domain, how will we be able to filter out bot traffic without simply excluding Irvine – ideas?

    Reply
    • Excellent question. Your surest option would be to collect the network domain yourself and store it in a custom dimension. Simo Ahava has set up a handy Google Tag Manager template to facilitate the process. He’s also published a guide on using it and setting up the custom dimensions here.

      If you’re not using Tag Manager, you can still get the ISP info and plug it into a custom dimension. Just let me know. I’m happy to assist.

      Reply
  4. Hi Dave,

    Since last 1 week suddently i have started getting traffic facebook with time spent less 1 sec with 100% bounce rate & reported under referral section. I am certain that it’s bot traffic but i want to know how can i stop it.

    From the day I had started getting it, I had enabled auto products upload (catalog) for shopping ads. I thought FB bot is visiting the link to verify the product. I had paused it immediately after 2 days because i was getting the traffic. It has been more than a week since i have disabled traffic but i am still getting traffic. Could you help me identify root cause & show some direction

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.