Description
Trafficle is a lightweight, privacy-first analytics plugin that stores all visitor data in your own WordPress database. There are no third-party servers, no trackers, and (by default) zero external network requests.
Features
- Pageviews & Visitors with a date-range picker (Today / 7 / 30 / 90 days / 12 months / custom). Daily aggregates keep long ranges fast and available after raw data expires.
- Real-time active visitors and the pages they are on.
- Top Pages, Referrers, Devices, Browsers, Operating Systems and Countries.
- Returning visitors and weekly retention cohorts (opt-in, cookie mode).
- Goals & Conversions — define a URL or event goal and measure conversion rate.
- Conversion funnels — chain existing goals into an ordered multi-step path and see drop-off per step. Reuses recorded conversions (no extra tracking).
- Custom Events API —
window.Trafficle.track('event_name', value)for button clicks, form submissions, outbound links and more. - UTM / Campaign attribution — source, medium, campaign, term and content reporting.
- Landing & exit pages, bounce rate and average time on page.
- Geo — uses the Cloudflare
CF-IPCountryheader automatically, or an optional MaxMind GeoLite2 database for non-Cloudflare sites. - CSV export of every report.
- Configurable data retention. Full IP addresses are never stored; the visitor log shows a truncated address only. Query strings are stripped from stored URLs.
- First-party cookie for accurate visitor counts, with a cookieless mode for strict privacy.
- Bot & crawler detection — search engines, AI crawlers (GPTBot, ClaudeBot, CCBot, PerplexityBot…), social bots, SEO tools, uptime monitors and scrapers are tagged automatically and logged server-side (most crawlers never run JavaScript). Optional reverse-DNS verification runs after the response is sent.
- Visitor Log — filterable, paginated table of individual visits with a per-visit detail drawer. Bots are badged by type; no raw IPs or user-agent strings are stored.
- Engagement & scroll depth — per-page scroll-depth % and engaged-session rate, captured without cookies or external calls.
- Core Web Vitals — LCP, CLS, INP and TTFB collected via the Performance API, rated against Google’s good / needs-work / poor thresholds.
- User Flow — the top page-to-page navigation paths, derived from each visit’s ordered pageviews (no extra client capture).
- Content intelligence — top posts, authors, categories and content types.
- Outbound, affiliate and download clicks captured automatically (host + path hash only).
- Anomaly alerts — optional daily email when human, bot or AI-crawler traffic leaves its normal range.
- Google Search Console import (optional) — connect your own Google Cloud OAuth client to see the queries behind your organic traffic. Data is fetched to and stored on your server.
- Click heatmaps (optional, off by default) — coarse, aggregated click positions per page and device; never element text, inputs or session replay.
- WooCommerce — purchases attributed to the visit that checked out, with revenue stored only as a bucket.
Privacy
- All data is stored on your own server.
- Visit ids are random UUIDs; no emails, names or full IP addresses are stored.
- Visitors can view, download or delete their own data, or opt out, with the
[trafficle_privacy]shortcode. Admins can export / erase by visitor ID. - Trafficle can wait for explicit analytics consent before tracking when you enable the built-in consent gate in Settings.
- The optional MaxMind database is downloaded once with your license key and queried locally — no runtime external calls.
External services
Trafficle works fully offline by default. The following optional features make network requests only after an administrator enables them.
MaxMind GeoLite2 (optional country detection)
Used to map visitor IP addresses to countries on sites that are not behind Cloudflare. When you enter a GeoLite2 license key in Trafficle → Settings, the plugin downloads the GeoLite2-Country database from download.maxmind.com once, then refreshes it monthly. The request sends only your MaxMind license key. All lookups then happen locally on your server; visitor IPs are never sent to MaxMind.
- Terms of use: https://www.maxmind.com/en/geolite2/eula
- Privacy policy: https://www.maxmind.com/en/privacy-policy
Google Search Console (optional keyword import)
Used to show the search queries that bring visitors to your site. Only active after you add your own Google Cloud OAuth client and click “Connect” under Trafficle → Search Console. The plugin then contacts:
accounts.google.com– to let you sign in and grant read-only Search Console access (your browser is redirected there).oauth2.googleapis.com– to exchange and refresh the access token (sends your OAuth client ID, client secret and the authorization/refresh token), and to revoke it when you disconnect.www.googleapis.com/webmasters/v3– to download daily query/page statistics for your site (sends your site URL and a date range), on a daily schedule while connected.
No visitor data is sent to Google.
- Google Terms of Service: https://policies.google.com/terms
- Google API Services User Data Policy: https://developers.google.com/terms/api-services-user-data-policy
- Google Privacy Policy: https://policies.google.com/privacy
Reverse-DNS crawler verification (optional)
Off by default. When “Verify search engines” is enabled, Trafficle checks requests whose user agent claims to be a known crawler (for example Googlebot) with a reverse DNS lookup of the request IP, followed by a forward lookup of the returned hostname. The lookups use your server’s configured DNS resolver (usually run by your hosting provider), so that resolver receives the claimed crawler’s IP address. The result is cached for a day per IP. No other data is sent and no third-party API is involved.
Third-party libraries
- Chart.js v4.6.1 (MIT) – bundled minified as
assets/vendor/chart.umd.min.js. Unminified source: https://github.com/chartjs/Chart.js/tree/v4.6.1 - MaxMind DB Reader for PHP v1.15.0 (Apache-2.0) – bundled in
includes/vendor/MaxMind.
Installation
- Upload the
trafficlefolder to/wp-content/plugins/. - Activate the plugin through the “Plugins” screen.
- Visit Trafficle in the admin menu.
FAQ
Does it use cookies?
By default it sets a single first-party cookie (tfl_vid) containing a random id. You can disable cookies in Settings to use a cookieless (sessionStorage) mode instead.
Does it send data anywhere?
Visitor analytics never leave your server. Network activity only comes from optional features you switch on yourself: the MaxMind GeoLite2 download, Google Search Console sync, and reverse-DNS lookups through your server’s own resolver when “Verify search engines” is enabled. See External services below for exactly what is sent.
Does it work behind Cloudflare?
Yes. Country detection uses Cloudflare’s CF-IPCountry header automatically. For sites not behind Cloudflare, enter a GeoLite2 license key in Settings to enable country detection.
Can I use it with a consent banner?
Yes. Enable Require consent before tracking in Trafficle settings. When enabled, Trafficle waits for explicit permission before setting its visitor ID or sending analytics. It recognizes wp_has_consent( 'statistics' ), window.trafficleConsentGranted = true, a data-trafficle-consent="granted" attribute on the <html> element, a trafficle:grant-consent event, or Trafficle.grantConsent(). Trafficle.revokeConsent() stops tracking and deletes Trafficle cookies.
Does it support WordPress privacy tools?
Yes. Trafficle adds suggested privacy-policy text and registers personal-data exporter / eraser integrations. Analytics are not keyed by email, so core’s email-based tools cover WooCommerce customers (whose orders record their visit id). Other visitors use the [trafficle_privacy] shortcode, or give you their visitor ID for Trafficle → Settings → Data requests.
Changelog
1.6.0
- Renamed from VisitLens to Trafficle. Existing tables and settings (from VisitLens or VisitRadar) are carried over automatically; reactivate the plugin after updating.
- Fix: every page load wrote two pageview rows (load + leave), doubling pageviews, hiding bounces and adding self-loops to User Flow. The leave beacon now updates the original row; existing data is merged by a background migration.
- Fix: with the default “Humans” scope the dashboard showed 0 visits (SQL alias error in scoped totals).
- Fix: with the consent gate off, the tracker still waited for consent and recorded nothing (stringified settings flags).
- Fix: returning-visitor flag was never set; now measured via an opt-in long-lived visitor cookie, with weekly cohorts.
- Fix: URL goals used substring matching (a goal of “/a” matched most URLs) and fired on every refresh. New pattern rules (exact path, wildcard, path segment, full URL); reports count unique converting visits; conversion rate uses all visits.
- Fix: Bing and DuckDuckGo were counted as both Organic Search and AI Search; channel matching is now by domain boundary (box.com is no longer x.com).
- Fix: AI crawlers became “human” when “Count AI crawlers as bots” was off (setting removed — crawlers are always bots).
- Fix: WooCommerce purchases were attributed to whoever completed the order (admin or payment webhook); the visit is now captured at checkout.
- Fix: the rate limit keyed on REMOTE_ADDR throttled entire sites behind a proxy; it now uses the resolved client IP and the object cache when available.
- Fix: Core Web Vitals ignored the selected date range; realtime missed visitors mid-session; popular posts and public stats used local time against GMT data.
- Privacy: full IPs are no longer stored (existing rows truncated); query strings are stripped from stored URLs; visitor self-service shortcode and admin data requests; opt-out cookie; consent revoke API.
- New: server-side crawler logging, deferred reverse-DNS verification, daily rollups with 90-day and 12-month ranges, anomaly alerts, category / content-type reports, Search Console import, click heatmaps.
- Dev: PHPUnit suite, WordPress integration suite, PHPCS (security rules), PHPStan, CI on PHP 8.1–8.4 with SHA-pinned actions (replacing a typo-squatted setup action).
1.5.0
- Conversion funnels: define an ordered sequence of existing goals (minimum two steps) and measure visitors, drop-off, and completion rate.
- New Funnels admin page (create / edit / delete) using the same capability and nonce patterns as Goals.
- Dashboard Conversion Funnel card plus
GET /trafficle/v1/funnel(id, range, scope). - Schema:
funnelsandfunnel_stepstables (DB version 1.4.0). Existing installs are upgraded viadbDelta; reporting reusesconversionsandvisits(no new ingest path).
1.4.0
- Public open-source release prep: added GitHub-ready README, GPL license file, and CI lint workflow.
- Sanitized repository metadata/docs for public release while keeping plugin behavior unchanged.
1.3.3
- Fixed
ip_displaypersistence so new visit-log rows retain the anonymized display IP. - Added safer handling for Cloudflare / trusted-proxy client IP detection.
- Improved dashboard and visitor-log rendering for country/IP display.
- Added multisite activation support and more complete uninstall cleanup.
1.2.1
- Security & privacy hardening pass (independent Claude Opus code review):
- Fixed critical bug: fresh installs recorded zero pageviews because the six Phase-1 columns (scroll_depth, engaged, lcp, cls, inp, ttfb) were missing from the install-time
pageviewsschema. - Rate limiting now keys on REMOTE_ADDR; CF-Connecting-IP / X-Forwarded-For are trusted only from known Cloudflare ranges or a configured trusted-proxy list (throttle-bypass closed).
- Cookieless visitor id now honors IP anonymization and rotates daily (no cross-day tracking).
- CSV export sanitized against spreadsheet formula injection.
- Bot/Human scope filter now applied consistently across all breakdown reports.
- Removed unused stored IP hash (data minimization); added opt-in uninstall data erasure and referrer query-string stripping.
- Fixed timezone handling, comparison-delta scope, views/visitors series double-counting, visit-insert race (UNIQUE KEY + INSERT IGNORE), and live-dashboard query load. Numerous low-severity correctness/UI fixes.
- Fixed critical bug: fresh installs recorded zero pageviews because the six Phase-1 columns (scroll_depth, engaged, lcp, cls, inp, ttfb) were missing from the install-time
1.2.0
- Added behavioral analytics: per-pageview scroll depth + engaged-session rate (Phase 1).
- Added Core Web Vitals capture (LCP, CLS, INP, TTFB) via the Performance API.
- Added User Flow report (top page-to-page navigation paths) derived from pageview order.
- New dashboard cards: Engagement, Core Web Vitals, User Flow.
- Time-on-page is capped at 1h to ignore background-tab artifacts.
- Schema: new pageviews columns (scroll_depth, engaged, lcp, cls, inp, ttfb); auto-upgraded.
1.1.0
- Added bot/crawler classification (categories: search_engine, ai_crawler, social, seo_tool, monitoring, scraper, aggregator, other).
- Optional reverse-DNS verification for major search engines (Googlebot, Bingbot, Yandex, Baidu, Applebot, Ahrefs, Semrush, Perplexity, Bytespider, LinkedIn, CCBot, OpenAI, Anthropic).
- New “Visitor Log” page: filterable, paginated list of visits + per-visit detail drawer (pages viewed, UTM, referrer).
- Dashboard scope toggle (All / Humans / Bots) plus Traffic-by-Type, Bots & Crawlers and Top Bots cards.
- Settings: exclude bots from headline counts, verify search engines, treat AI crawlers as bots.
- Schema: new visitor_type, bot_category, bot_name, bot_verified columns (auto-upgraded on activation).
1.0.0
- Initial release.