007AJ Analytics and Traffic Expert

Version 1.0.0 · Requires WordPress 6.3+ and PHP 7.4+ · GPLv2 or later · by 007AJ

Privacy-first visitor statistics stored in your own WordPress database. No cookies, and no outside requests while counting visits. Every feature works as soon as the plugin is installed. There is nothing to register and no account to create.

Installation

  1. In WordPress go to Plugins > Add New > Upload Plugin, choose 007aj-analytics-traffic-expert-1.0.0.zip and click Install Now.
  2. Enable the plugin on the Plugins screen. Seven tables are created (your table prefix followed by tlh_).
  3. A new 007AJ Analytics menu appears in the admin sidebar. Counting starts right away.

Multisite networks are not supported.

First steps

  1. Location data (optional): go to 007AJ Analytics > Tools and press Download database. Choose “Cities, regions and countries” (about 130 MB) or “Countries only” (about 8 MB). See External services.
  2. Review settings: 007AJ Analytics > Settings. The defaults are privacy-friendly: no addresses stored, logged-in users not counted, Do Not Track and Global Privacy Control respected.
  3. Choose who can see statistics: Settings > Access.
  4. Turn on email reports under Email Reports & Export if you want regular summaries.

How counting works

Tracking modes (Settings > Tracking)

ModeHowWhen to use
Script to REST API (default)A small script (about 3 KB, no cookies) sends one request to /wp-json/traffic-expert/v1/hit after the page loads.Most sites. Works with page caches and CDNs.
Script to admin-ajax.phpSame script, sent to wp-admin/admin-ajax.php.When a security plugin or host blocks the REST API.
ServerCounted in PHP while the page is generated. No script is needed to count page views.Sites without page caching. Pages served from a cache are not counted in this mode.

Own endpoint address: enter a neutral word (for example pulse) to add a second endpoint such as /wp-json/pulse/v1/hit. Content blockers are less likely to block it.

Each page request is signed with a site-specific key, so the endpoint rejects forged page types.

Visitors, views, visits

What is excluded

Robots and crawlers, headless browsers and automation tools (Puppeteer, Playwright, Selenium, PhantomJS), uptime monitors, command-line clients, browser prefetch and prerender, Do Not Track and Global Privacy Control signals, logged-in users (unless enabled), excluded roles, addresses and ranges (CIDR or wildcard), pages (wildcards allowed), countries (exclude list or include-only list), “not found” pages and feeds. A daily view limit (default 200) stops counting visitors that behave like robots. Excluded hits are counted by reason under Tools.

Reports

Every report has a period picker (today, yesterday, 7/28/30/90 days, this or last month, last 12 months, this year, all time, or your own dates) and a Compare with previous period option. Click any value in a location, device, source or campaign table to filter the reports by it. Filters appear as chips you can remove.

ScreenContents
OverviewVisitors, views, views per visit, bounce rate, average visit length with change against the previous period. Traffic chart, top pages, channels, referring sites, search engines, countries, devices, browsers, busiest hours, all-time totals, online count.
RealtimeSee Realtime.
VisitorsEvery visitor with time, location, source, device, entry page and views. Open one to see its path through the site and its events.
PagesMost viewed pages by content type, home page, site searches and “not found” pages; entry and exit pages with bounce rate; a chart for any single page.
SourcesSource categories: Direct, Organic search, Paid search, Organic social, Paid social, AI assistants, Email, Other campaigns, Referral. Referring sites, search engines, social networks, AI assistants (ChatGPT, Perplexity, Gemini, Claude, Copilot, DeepSeek, Grok, Mistral, Meta AI, You.com, Phind), paid search, search words, and searches made on your own site.
LocationsCountries, continents, cities, regions, European Union countries, US states, browser languages.
DevicesDevice types (desktop, mobile, tablet, TV, console), browsers, browser versions, operating systems, device models.
ContentAuthors, content types, categories, tags and every public custom taxonomy, with items viewed, views, visitors and views per item.
CampaignsUTM campaigns with source, medium, visitors, views and bounce rate; tables for source, medium, content and term; the link builder.
Goals & EventsGoal conversions, outbound links, downloads and custom events.

Search words: most search engines (including Google) hide what people searched for. Words appear only when the engine passes them on.

Realtime

Shows visitors online now, visitors and views today, views per minute for the last 30 minutes, and who is online (current page, location, source, device, views, last activity). It refreshes every 15 seconds while the page is open and pauses when the browser tab is hidden.

Goals and events

Link and download tracking

Clicks on links to other sites and on files with the listed extensions (Settings > Tracking) are recorded automatically.

Custom events

trafficExpert.track( 'signup', 'footer form' );

Goals

Under Goals & Events > Set up goals, add a name, choose when it counts (a page is viewed, an outbound link is clicked, a file is downloaded, a custom event is sent), enter the address or event name (* is a wildcard, for example /thank-you* or *.pdf) and an optional value. A goal counts once per visitor per day. Reports show conversions, conversion rate and total value. Clear a goal's name to remove it.

Campaigns and link builder

Visits with utm_source, utm_medium, utm_campaign, utm_term or utm_content in the address are grouped under Campaigns. The Campaign link builder creates a tagged link from a page address and your values, and lets you copy it. Paid traffic is recognised from utm_medium values such as cpc, ppc, paid or display, and from ad click IDs (gclid, msclkid).

Email reports and alerts

Under Email Reports & Export:

Emails are sent with WordPress's own mail function on WP-Cron at about 08:00 site time. If your host blocks PHP mail, use an SMTP plugin. On low-traffic sites WP-Cron runs only when someone visits, so you may want a real server cron job that calls wp-cron.php.

Export

Choose a dataset (daily totals, pages, visits, source categories, referring sites, search engines, countries, cities, browsers, operating systems, device types, authors, campaigns, goals, outbound links, downloads), a period and a format: CSV, TSV, XML or JSON. Values that spreadsheets could read as formulas are made safe.

Dashboard, toolbar and mini charts

Public statistics

Turn on “Allow public statistics” under Settings > Display (on by default). Then use any of the following:

statShows
visitorsVisitors in the period
viewsViews in the period
onlineVisitors online now
post_views / post_visitorsViews or visitors of the current page (or post_id="123")
top_pagesMost viewed pages list (limit="5")
summaryTable: today, 7 days, 30 days, all time

range accepts: today, yesterday, 7d, 28d, 30d, 90d, this_month, last_month, 12m, this_year, all.

Settings reference

TabOptions
TrackingTracking mode; own endpoint address; count logged-in users; outbound links; downloads and file types; address parameters to keep (others are removed from stored addresses); online minutes; location matching.
PrivacyVisitor addresses (do not store / store with last part removed); Do Not Track; Global Privacy Control; consent (count without asking, or wait for consent through the WP Consent API) and consent category.
ExclusionsRoles; addresses and ranges; pages; excluded countries; count-only countries; not-found pages; feeds; prefetch; daily view limit; extra robot names.
DisplayToolbar; dashboard widgets; mini charts (measure, style, days, colour); public statistics.
AccessRoles that can view statistics. Administrators always can, and only administrators change settings.
DataKeep visit details for N days; keep daily totals for N days; delete all data when the plugin is deleted.

Tools

Privacy and GDPR

External services

The plugin makes no outside request while counting visits and never contacts 007aj.com.

DB-IP Lite (db-ip.com). Only when an administrator presses Download database under Tools, the plugin downloads one file from https://download.db-ip.com/free/ (the current month's dbip-city-lite or dbip-country-lite .mmdb.gz, falling back to the previous month). Only a normal file download request is sent: your server's address and WordPress's user agent. No visitor data is sent. The file is stored at wp-content/uploads/007aj-analytics-traffic-expert/geo.mmdb. Terms: db-ip.com/db/lite.php. Privacy: db-ip.com/about/privacy.php. Data licence: Creative Commons Attribution 4.0, “IP Geolocation by DB-IP”.

Our privacy policy: 007aj.com/privacy.

Developers

REST API

Read-only reports for users who can view statistics (log in, or use application passwords):

GET /wp-json/traffic-expert/v1/report/{summary|series|pages|group|content|campaigns|goals|events|online}
    ?range=30d | &range=custom&from=2026-01-01&to=2026-01-31
    &by=country (group: any column; content: author|post_type|taxonomy; events: click|download|custom)
    &limit=10

Public tracking endpoints: POST /hit, POST /event.

JavaScript

trafficExpert.track( name, value ); // custom event
trafficExpert.page();               // count a new page view in single-page apps

Filters and actions

HookPurpose
traffic_expert_visitor_ipChange the address used (for example behind a trusted proxy).
traffic_expert_is_botOverride robot detection (bool, user agent).
traffic_expert_exclusion_reasonReturn a reason string to exclude a hit.
traffic_expert_search_engines, traffic_expert_social_networks, traffic_expert_ai_assistantsExtend source detection.
traffic_expert_geo_lookupSupply or adjust location data.
traffic_expert_visitor_rowAdjust a visitor row before it is saved.
traffic_expert_online_windowMinutes a visitor counts as online.
traffic_expert_digest_bodyChange the email report body.
traffic_expert_hit_recorded, traffic_expert_excluded, traffic_expert_goal_converted, traffic_expert_purged, traffic_expert_loadedActions.

Large sites

Each view writes to a raw table plus a compact daily-totals table, and most reports read the daily totals. All tables are indexed for the queries they serve. A nightly job removes stale online rows and applies retention. For very busy sites, set a retention period (for example 180 days). Daily totals keep long-term charts working.

Removing the plugin

Disabling keeps all data. Deleting keeps all data unless you first tick Settings > Data > Delete all statistics and settings when the plugin is deleted. If you tick it, deleting the plugin removes the tables, the options, the scheduled jobs, the location file and the capabilities it added.

FAQ and troubleshooting

No visits are counted

Locations show “Unknown”

Download the location database under Tools. It applies to new visits.

Will it slow my site?

The script loads deferred and sends one small request per page. Reports run only in the admin.

Can I run it next to Google Analytics?

Yes.

Credits

Charts: Chart.js 4.4.6 (MIT licence), bundled locally. Location data: IP Geolocation by DB-IP (db-ip.com), CC BY 4.0, downloaded on request.