Description
Since late 2025 many sites see a flood of zero-second “Direct” sessions in Google Analytics 4, mostly from Lanzhou (China) and Singapore. Blocking countries or IP ranges does not remove them, because part of this traffic comes from headless browsers that run your pages, and part is sent straight to Google without ever touching your site.
Mailpassed Real Visitor Filter for GA4 handles both:
- Counts a visit only after a human signal. The plugin loads the GA4 tag with automatic page views turned off, and sends the page view after the first scroll, tap, click, key press or mouse movement, or after the page has been visible for a few seconds (you choose). Automated browsers that announce themselves (navigator.webdriver) are never counted.
- Tags every real hit. Counted visits carry the
traffic_typeparameter (default valuehuman), and so does every later event on that page. - Lets GA4 drop the rest. A GA4 data filter set to “Include only” that value keeps your real visitors and drops everything else, including hits that never came from your site. The settings page walks you through creating the filter in Testing mode first.
Other features:
- Balanced mode (interaction or N seconds visible, recommended) or Strict mode (interaction only).
- Time only counts while the page is on screen.
- Skips logged-in administrators (optional).
- Warns if another Google Analytics or Tag Manager tag is still on your home page.
- Lightweight: one small script, no database tables, no tracking of its own.
External services
This plugin connects to Google Analytics, a service provided by Google LLC, to measure visits to your site. That is its purpose.
- What is loaded: the Google tag script (gtag.js) from www.googletagmanager.com, on every front-end page, once you enter a Measurement ID.
- What is sent and when: after a human signal on a page (see Description), the Google tag sends a page view and later events to Google Analytics with the data the Google tag normally collects (page address and title, referrer, screen size, browser and device details, a cookie-based client ID, IP address processed by Google) plus the
traffic_typevalue you set. Nothing is sent before that signal, and nothing is sent if no Measurement ID is set. - Google’s terms: https://marketingplatform.google.com/about/analytics/terms/us/
- Google’s privacy policy: https://policies.google.com/privacy
You are responsible for informing your visitors and obtaining consent where your local law requires it.
Installation
- Install and activate the plugin.
- Go to Settings > Real Visitor Filter (GA4) and enter your GA4 Measurement ID (G-XXXXXXXXXX).
- Turn off the Google Analytics output of your theme or other plugins, so this plugin is the only GA4 tag.
- After a day, create the data filter in GA4: Admin > Data collection and modification > Data filters > Create filter > Internal traffic. Filter operation: Include only. Parameter value:
human. Filter state: Testing. - Compare reports with the “Test data filter name” dimension for a few days, then set the filter to Active.
FAQ
Will I lose real visitors?
In Balanced mode a visitor is counted after any interaction or after a few seconds on screen, so only visits that leave almost instantly without touching the page are not counted. Strict mode also skips visitors who read without scrolling or moving the mouse. Use the Testing state of the GA4 filter to see the effect on your site before you activate it.
Does the filter change my old data?
No. GA4 data filters apply only to data collected after they are activated. Active filters are permanent: excluded data is never processed, which is why the plugin recommends Testing mode first.
I use Google Tag Manager or another analytics plugin.
Use this plugin as your only GA4 tag. Hits from other tags will not carry the tag value and will be dropped once the filter is active.
Does this block bots from my site?
No. It keeps them out of your analytics. To block bots from loading your site, use a firewall or your host’s bot protection.
Is this an official Google product?
No. This plugin is not affiliated with or endorsed by Google. Google Analytics and GA4 are trademarks of Google LLC; “Mailpassed” is the author’s own name (mailpassed.com).
Changelog
1.0.0
- First release.
