Spam purger
Spot referral and bot spam that distorts your reports.
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.
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
| Signal | Threshold | Why it matters |
|---|---|---|
| Sessions from one source and hostname | More than 50 in 30 days | Ignores tiny sources that barely affect your numbers |
| Average session duration | Under 1 second | Real visitors rarely leave that fast on average |
| Engagement rate | Under 5% | Almost nobody scrolled, clicked or stayed |
Run it step by step
- 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.
- Click Scan for SpamThe button shows Scanning.... If nothing matches, a green card says No Spam Detected and the scan ends there.
- 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.
- 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.
- 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.
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.
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
0 of 3 answered.
Progress is saved in this browser.
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.