How to Filter Spam Referrals in Google Analytics
Nothing's more frustrating than seeing a sudden traffic spike in Google Analytics, only to find out it’s from shady domains like “social-promo-buttons.com” or some other nonsensical URL. Spam referrals are more than just an annoyance, they muddle your data, inflate your traffic numbers with fake sessions, and make it impossible to know how your actual marketing efforts are performing. This guide will walk you through how to identify and filter out this junk traffic for good in both Universal Analytics and Google Analytics 4.
What Are Spam Referrals and Why Do They Matter?
Referral spam is fake traffic generated by bots, not humans. These bots hit your Google Analytics property to get your attention, hoping you’ll see their URL in your reports and visit their website out of curiosity. Most of this traffic has a 100% bounce rate (or near-zero engagement rate in GA4) and a session duration of 0 seconds because a real person never actually visited your site.
This phantom traffic creates serious problems for your reporting:
- Skewed Metrics: Spam inflates your core metrics like unique users, sessions, and pageviews, making it seem like you're getting more traffic than you really are. This makes it difficult to gauge campaign performance or organic growth.
- Misleading Performance: Because bots don't interact with your site, they ruin your engagement metrics. You might see a lower average session duration and a higher bounce rate, which could lead you to believe your content isn't effective when that's not the case.
- Wasted Time: Manually sifting through referral reports to separate real traffic from fake traffic is a time-consuming chore that takes you away from meaningful analysis and strategy.
There are two primary types of referral spam. "Ghost spam" never actually visits your site, it sends fake data directly to Google Analytics' servers. The other type, "crawler spam," involves actual bots visiting your site, often ignoring rules you set in your site's robots.txt file.
How to Identify Spam Referrals in Your Reports
Before you can filter spam out, you need to find it. The key is to look for traffic patterns that don't make sense. Spend some time in your referral reports looking for tell-tale signs of botted traffic.
Here’s where to look and what to flag:
In Universal Analytics (UA):
To find your referral report, navigate to Acquisition > All Traffic > Referrals. Be on the lookout for:
- Suspicious Domain Names: If the domain name is overly promotional (e.g., "get-free-traffic-now.com"), contains keywords like "buttons" or "share," or is just a random string of numbers and letters, it’s probably spam.
- 100% Bounce Rate (or close to it): A near-perfect bounce rate is the biggest red flag. It means the "visitor" left without any interaction.
- ~0:00 Average Session Duration: Real visitors spend at least a few seconds on a page. Sessions lasting zero seconds mean no real visit occurred.
In Google Analytics 4:
The process in GA4 is similar. Navigate to Reports > Acquisition > Traffic acquisition. From there, use the dropdown menu above the table to change the primary dimension to "Session source / medium" and use the filter bar to isolate traffic "where Session medium contains referral."
Look for the same red flags:
- Suspicious or irrelevant source domains.
- An engagement rate close to 0%.
- Sessions that come from geographic locations you don't serve or market to.
Once you've built a list of the spammy domains sending garbage traffic your way, you're ready to start filtering them out.
Filtering Referrals: The Universal Analytics Method
For those still using Universal Analytics, the best way to block spam is with a View Filter. IMPORTANT: Filters permanently alter your data from the moment they are applied. Always create a new, filtered view or apply your filter to a testing view first. You should always maintain a raw, unfiltered backup view of your data just in case something goes wrong.
Here are the steps:
- Go to the Admin section of your Google Analytics account (the gear icon in the bottom-left).
- In the far-right “View” column, click on Filters.
- Click the red + Add Filter button.
- Give your filter a descriptive name, like "Referral Spam Exclusion."
- For Filter Type, choose Custom.
- Select the Exclude option.
- For the Filter Field, select Campaign Source from the dropdown menu.
- In the Filter Pattern box, enter the spam domains you want to exclude, separating each one with a pipe character (|). The pipe acts as an "OR" in regular expressions. Do not use spaces.
- Click Save.
This filter will now prevent traffic from those specified domains from ever showing up in your reports again. Remember, this only works for data going forward, it won't retroactively clean your existing reports.
Filtering Spam Referrals in Google Analytics 4
Google Analytics 4 handles filtering differently because it doesn't have the same "View" structure as Universal Analytics. Here are the two primary methods for managing unwanted traffic.
Method 1: List Unwanted Referrals
GA4 has a built-in feature to exclude specific referral domains. This tells Google Analytics to stop treating traffic from these domains as "referrals," which prevents them from being credited with initiating new sessions.
Steps:
- Go to Admin.
- In the "Property" column, click on Data Streams and select your web data stream.
- Click on Configure tag settings.
- Under the "Settings" menu, click Show more, then select List unwanted referrals.
- Under Match type, choose "Referral domain contains" (or another appropriate match type).
- In the Domain field, enter the spam referral domain (e.g., spam-domain.com).
- Click Add condition to add more domains to the list.
- When you're done, click Save.
Method 2: Use Data Filters
For more systematic issues, like bot traffic coming from a consistent location or particular network, Data Filters are a more robust solution. They allow you to exclude broad categories of traffic before it's even processed.
The "Internal Traffic" filter is commonly used for this.
Steps:
- Navigate to Admin > Data Settings > Data Filters.
- Click Create Filter.
- Choose the Internal Traffic filter type.
- Give your filter a name, like "Botnet Traffic Exclusion."
- Set the filter operation to Exclude.
- Choose a parameter name (the default is traffic_type).
- Enter a parameter value (the default is internal). This value must match what you’ve defined in your internal traffic rules. You can create rules in Data Streams > Configure tag settings > Define internal traffic based on IP addresses known to be spam sources.
- Set the Filter state to Active. This permanently applies the filter. You can test it first by setting it to "Testing."
- Click Create.
This method is more complex but is powerful for excluding patterns of bot traffic that don’t fit neatly into the "unwanted referrals" list.
Tips for Ongoing Spam Prevention
Filtering spam isn't a one-time fix. New spam domains pop up all the time. Here are a few best practices to keep your data clean.
- Enable Google's Bot Filtering: Both UA and GA4 have a feature to automatically exclude known bots and spiders. In Universal Analytics, it’s under Admin > View Settings > Bot Filtering. In GA4, this is enabled by default and cannot be turned off. It’s a great first line of defense.
- Schedule Regular Audits: Set a calendar reminder every month or so to review your referral traffic. A quick 15-minute check can help you catch new spam domains before they have a big impact on your data.
- Use Segments for Historical Analysis: Since filters don't work backwards, you can use Segments to analyze your historical data in a cleaner way. Create a segment that excludes sessions where the "Source / Medium" matches the spam domains you've identified. This lets you see what your reports would have looked like without the spam.
Final Thoughts
Cleaning out spam referrals from your Google Analytics is a crucial step toward having data you can actually trust. By regularly identifying suspicious sources and applying either View Filters in UA or Data Filters and Unwanted Referral lists in GA4, you can ensure your reports reflect real human behavior and provide genuine insights into your website's performance.
Even with clean data, we know that building reports and dashboards requires a lot of time and effort - especially when your campaign data is spread across Google Ads, Facebook Ads, Shopify, and your CRM. We designed Graphed to be the easiest way to connect all your data sources and get answers using simple, natural language. Instead of wrangling CSVs or learning a complicated BI tool, you can just ask questions and get real-time dashboards that help you make better, faster decisions.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.