Skip to content

Spam purger

Spot referral and bot spam that distorts your reports.

  • Lesson 5 of 6
  • Intermediate
  • 5 min read
  • 2:27 video
  • Checked against the product 2026-11-03

Listen to this lesson · 2:26

In shortThe Spam purger scans the last 30 days of your GA4 traffic by source and hostname and flags any source with more than 50 sessions, an average session under one second and an engagement rate under 5%. It shows their share of your traffic and an AI-written regex for GA4. Open Analytics → Google Analytics 4 → Spam purger and click Scan for Spam. Check the regex before you paste it; GA4 settings only affect future data.

How to use it in AI Rank Lab

  1. Find it in the dashboardAnalytics → Google Analytics 4 → Spam purger
  2. Watch while you workOpen Spam purger from here and the video plays in a small corner window of your dashboard, so you can follow each step on your own data. Expand it or go full screen any time. Open Spam purger with the video
  3. Turn it into a routineThese playbooks show where this fits in a repeatable workflow:

What the Spam purger is for

Junk traffic inflates sessions and drags down engagement rate and conversion rate, so every report built on top of it is slightly wrong. It usually shows up as one odd referral source sending dozens of sessions that last no time at all. The Spam purger finds those sources for you and estimates how much of your traffic they make up.

Run it when engagement rate drops for no clear reason, when an unknown referrer appears in your reports, or before you set a baseline for a client so the starting numbers are clean.

Before you start

  • GA4 connected and the right property selected. See Connect GA4 and read the overview.
  • To act on the result: an Editor or Administrator role on the GA4 property. AI Rank Lab's connection is read-only and can't change GA4 for you.

What counts as spam here

A source is flagged only when all three are true. The scan reads the top 200 source and hostname pairs by sessions.
SignalThresholdWhy it matters
Sessions from one source and hostnameMore than 50 in 30 daysIgnores tiny sources that barely affect your numbers
Average session durationUnder 1 secondReal visitors rarely leave that fast on average
Engagement rateUnder 5%Almost nobody scrolled, clicked or stayed

Run it step by step

  1. Open the Spam purgerGo to Analytics → Google Analytics 4 → Spam purger. The page is titled Spam Traffic Purger, with the price on a badge next to the button.
    Spam Traffic Purger page header with a credits badge and a Scan for Spam button; an info card explains the three thresholds; empty state reads No scan run yet.
    The Spam purger before a scan.
  2. Click Scan for SpamThe button shows Scanning.... If nothing matches, a green card says No Spam Detected and the scan ends there.
  3. Read the stat cardsTotal Sessions, True Sessions and Spam Sessions for the last 30 days, and Spam Pollution, the share of total sessions the flagged sources represent.
    Four stat cards: Total Sessions, True Sessions with a green check, Spam Sessions with a red warning icon, and Spam Pollution as a percentage of total sessions.
    How much of your traffic the flagged sources represent.
  4. Check the flagged sourcesDetected Spam Sources lists each one with Source, Hostname, Sessions, Avg Duration and Engagement. Look at the hostname: if it isn't your own domain, the hits probably never touched your site.
    Detected Spam Sources table listing a few referral sources with their hostname, session counts, average duration under one second and engagement under five percent.
    The sources that met all three thresholds.
  5. Read the AI instructions and copy the regexSpam Analysis & Filter Instructions gives a short alert, a regex and steps for GA4. The regex also appears in the GA4 Filter Regex box with a Copy button.

Using the regex in GA4

The page suggests pasting the regex into GA4 Admin under Data streams → Configure tag settings, as an unwanted referral or internal traffic rule. Know what each setting really does before you choose:

  • List unwanted referrals accepts domain conditions, including a regex. It stops those domains being credited as a referral source. The sessions are still counted; they are just attributed differently.
  • Define internal traffic works on IP addresses, not on sources or hostnames, so a hostname regex doesn't belong there.
  • Neither setting changes past data. Your last 30 days stay as they are. To see clean history, exclude the flagged sources with a comparison or a segment in a GA4 exploration.
Check every source before you exclude it

The regex is written by AI from the flagged list. Read it, and make sure it doesn't match a real source by accident (a short pattern like app can match far more than you meant). Also look at each flagged source yourself: a redirect page, an app's in-built browser or a broken page can produce one-second sessions from real people. Fix those pages rather than hiding them.

Small site, nothing flagged?

A source needs more than 50 sessions in 30 days to be flagged. On a small site, spam spread across many sources stays under that line. Look in GA4 at Traffic acquisition by session source and sort by engagement rate to find them.

What it costs

Check yourself

1. A source has 300 sessions, a 0.4-second average and 2% engagement. Will the Spam purger flag it?
2. You add the regex as an unwanted referral in GA4. What happens to last month's reports?
3. Why should you check each flagged source before excluding it?

0 of 3 answered.

Progress is saved in this browser.

Screenshots and video come from an AI Rank Lab demo account. Where a screen needs data that account doesn't have, such as a connected Google account or real visitors, it shows fictional example.com data.

Transcript
In this lesson you'll use the Spam purger to find junk traffic in your GA4 reports. Junk traffic inflates your sessions and drags down engagement and conversion rates. It often shows up as one strange referral source sending lots of sessions that last no time at all. The Spam purger finds those sources and tells you how much of your traffic they make up. It looks at the last thirty days, by source and hostname. A source is flagged when three things are all true: more than fifty sessions, an average session under one second, and an engagement rate under five percent. Go to Analytics, Google Analytics 4, Spam purger, and click Scan for Spam. If nothing matches, you'll see No Spam Detected. If something does, you get four cards: total sessions, true sessions, spam sessions, and spam pollution, which is the share of your traffic the flagged sources represent. Below that is a table of the flagged sources with their hostname, sessions, duration and engagement. Look at the hostname. If it isn't your domain, those hits probably never touched your site. Then there's an AI-written alert, a regex, and steps for GA4, with a copy button for the regex. Now be careful with that regex. The page suggests GA4's unwanted referrals or internal traffic settings. Unwanted referrals stops a domain being credited as a referral, but the sessions are still counted. Internal traffic works on IP addresses, so a hostname regex doesn't belong there. And neither setting changes past data. To see clean history, exclude the sources with a segment in a GA4 exploration. Also check every source before you exclude it. A redirect page or an app's built-in browser can create one-second sessions from real people. And read the regex. A short pattern can match much more than you meant. On a small site, spam spread across many small sources won't reach fifty sessions each, so nothing gets flagged. Sort GA4's traffic acquisition report by engagement rate to find those. Each scan costs credits, even when nothing is found, and the price is on the page. In the next lesson, you'll learn to track AI referral traffic from ChatGPT, Perplexity and Gemini in GA4.

Put the lesson to work

Paste your site and get a free SEO, AEO and GEO audit with the fixes, then come back to the next lesson.