Title: Trafficle
Author: lavluda
Published: <strong>November 27, 2026</strong>
Last modified: November 27, 2026

---

Search plugins

![](https://ps.w.org/trafficle/assets/icon-256x256.png?rev=3830069)

# Trafficle

 By [lavluda](https://profiles.wordpress.org/lavluda/)

[Download](https://downloads.wordpress.org/plugin/trafficle.1.6.0.zip)

 * [Details](https://wordpress.org/plugins/trafficle/#description)
 * [Reviews](https://wordpress.org/plugins/trafficle/#reviews)
 *  [Installation](https://wordpress.org/plugins/trafficle/#installation)
 * [Development](https://wordpress.org/plugins/trafficle/#developers)

 [Support](https://wordpress.org/support/plugin/trafficle/)

## 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-IPCountry` header 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](https://www.chartjs.org/) 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](https://github.com/maxmind/MaxMind-DB-Reader-php)
   v1.15.0 (Apache-2.0) – bundled in `includes/vendor/MaxMind`.

## Blocks

This plugin provides 1 block.

 *   Popular Posts

## Installation

 1. Upload the `trafficle` folder to `/wp-content/plugins/`.
 2. Activate the plugin through the “Plugins” screen.
 3. 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.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Trafficle” is open source software. The following people have contributed to this
plugin.

Contributors

 *   [ lavluda ](https://profiles.wordpress.org/lavluda/)

[Translate “Trafficle” into your language.](https://translate.wordpress.org/projects/wp-plugins/trafficle)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/trafficle/), check 
out the [SVN repository](https://plugins.svn.wordpress.org/trafficle/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/trafficle/) by [RSS](https://plugins.trac.wordpress.org/log/trafficle/?limit=100&mode=stop_on_copy&format=rss).

## 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: `funnels` and `funnel_steps` tables (DB version 1.4.0). Existing installs
   are upgraded via `dbDelta`; reporting reuses `conversions` and `visits` (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_display` persistence 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 `pageviews` schema.
    - 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.

#### 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.

## Meta

 *  Version **1.6.0**
 *  Last updated **36 minutes ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.2 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 8.1 or higher **
 * Tags
 * [analytics](https://wordpress.org/plugins/tags/analytics/)[insights](https://wordpress.org/plugins/tags/insights/)
   [privacy](https://wordpress.org/plugins/tags/privacy/)[statistics](https://wordpress.org/plugins/tags/statistics/)
   [tracking](https://wordpress.org/plugins/tags/tracking/)
 *  [Advanced View](https://wordpress.org/plugins/trafficle/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/trafficle/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/trafficle/reviews/)

## Contributors

 *   [ lavluda ](https://profiles.wordpress.org/lavluda/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/trafficle/)