=== ConvertNow Analytics ===
Contributors: prateekzare
Donate link: https://paypal.me/prateekzare16
Tags: analytics, statistics, ai analytics, cookieless, privacy
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Complete website analytics in your own database, with AI assistant traffic broken out as its own channel. Cookieless, self hosted, no account!

== Description ==

A full analytics dashboard that runs entirely on your own site. Visitors, visits, pageviews, real bounce rate and real time on page. Pages, entry pages and exit pages. Referrers, channels, campaigns, countries, languages, browsers, devices and screen sizes. Goals, funnels, journeys, retention, segments and cohorts. Read depth and engaged time on every page, a live counter, a weekly email and a shareable read-only dashboard.

Every one of those is free. There is no account, no key, no tier held back and nothing to upgrade to. It is the whole plugin.

And because the question has changed lately, it answers one more thing that most analytics plugins still cannot: how much of that traffic is now arriving from an AI assistant.

**Everything it records**

* Visitors, visits, views, views per visit
* Real bounce rate and real time on page, measured from an engagement beacon rather than guessed from timestamps
* Top pages, entry pages, exit pages
* Referrers, traffic channels and UTM campaigns
* Browsers, operating systems, devices, screen sizes
* Countries and languages, with a world map
* A live counter of who is on the site right now
* Read depth and engaged time per page, so you can see what actually gets read
* A weekday by hour heatmap of when people show up
* Traffic from AI assistants, as its own channel and its own set of screens
* Filters: click any value to recalculate the whole dashboard against it

**AI visibility, because nothing else counts it properly**

Someone asks ChatGPT a question, the answer cites your page, they click through. That is a reader, not a crawler, and most analytics plugins file them under "referral" next to a random forum link. Some file them worse: Gemini runs on a google.com address and Copilot on a microsoft.com one, so a plain search-engine rule counts both as organic search and you never see them at all.

ConvertNow separates them.

* An **AI assistant** channel of its own, alongside direct, search, social, email and referral, so it appears everywhere a channel appears
* Four screens: which assistants send people, what they were sent to, how AI compares with every other channel, and which assistants are growing
* ChatGPT, Perplexity, Claude, Gemini, Copilot, Grok, DeepSeek, Meta AI and Le Chat recognised by name, with a filter to add your own
* Crawlers are refused before a row is ever written, so GPTBot, ClaudeBot, CCBot and PerplexityBot never appear as traffic. Every row on these screens is a person

It is one section of the plugin, not the point of it. If AI sends you nothing, the other forty screens work exactly as they would anyway.

**Editorial reporting**

For sites with more than one writer, the author is recorded on every pageview, so the byline is a dimension like any other.

* Traffic by author, ranked, with real display names
* Fastest-Growing Authors, measured against the previous period of the same length
* Blog Posts on their own, so the home page and category archives stop drowning out the writing
* Content Types, splitting posts from pages, products and archives
* Read depth and engaged time per post, so you can tell a click from a read
* An Editorial at a Glance screen that puts all of it on one page

**The report screens**

The Stats screen carries a sidebar of reports, each answering one question and each opening on the same page rather than loading a new admin screen.

* AI Visibility: AI at a Glance, AI Assistants, Pages Cited by AI, Fastest-Growing Assistants
* Editorial: Authors, Fastest-Growing Authors, Blog Posts, Content Types
* Pages: Top Landing Pages, Fastest-Growing Pages, Today, Exit Pages
* Referrers: Search Engine Traffic, Social Media Traffic, Fastest-Growing Referrers, Last 7 Days, Channels, All Referrers
* Campaigns: UTM Sources, UTM Mediums, UTM Campaigns, Fastest-Growing Campaigns
* Geographic: Countries with the world map, Continents, Languages, Fastest-Growing Countries
* Devices: Browsers, OS, Devices, Screens
* Growth Tracking: every headline number against the previous period, with the biggest movers behind them

Each group opens with its own **at a glance** screen: the whole of Editorial, or Pages, or Referrers, or Campaigns, or Geographic, or Devices compressed onto one page, with a link from every panel through to the full report.

Charts are hand-drawn SVG throughout: a trend area, a stacked area for share over time, a ring for part to whole, diverging bars for gains and losses, a world map and a weekday-by-hour heatmap. Referrers, browsers and operating systems carry their own colours and marks, drawn in the plugin, so you can pick one out of a list without reading it. Nothing is fetched to do that: no favicon lookup, no logo service, no request to the referring site.

Every chart on every screen exports as a PNG or a JPG from a button in its own header. The image is the same SVG the screen drew, written to a file, so it comes out sharp rather than as a screenshot. No upload, no library, nothing leaves your server.

Every one of them reads the same nightly summaries the overview does, so the cost is flat: a twelve month report runs the same handful of queries as a seven day one, and each is cached for a minute.

**Why it stays fast**

The tracker is inlined into the footer by default, which means a tracked pageview costs zero extra HTTP requests and roughly 1.5 KB of JavaScript over the wire. Nothing is render blocking and nothing loads from a CDN.

On the server, raw hits are summarised into small daily tables every hour. The dashboard reads summaries for completed days and raw rows only for today, so a 12 month view runs the same number of queries as a 24 hour one. Once a day is summarised its raw rows can be deleted, which keeps the database small on shared hosting without losing any history.

The admin screen draws every chart with plain SVG, the world map included. There is no charting library and no mapping library, so the whole dashboard is a few kilobytes of JavaScript instead of a few hundred.

Country lookups ship with the plugin as a pre-compiled table. There is nothing to download and nothing to import, which matters on shared hosting where a long download and a few hundred thousand database writes is exactly the job that trips an I/O limit and returns a 504. A lookup reads one 512 byte block of that file and takes about three microseconds. It never touches the database and never leaves the server.

**Behaviour and audience**

* Goals: mark a page as a result, optionally only when a visitor also read far enough or stayed long enough, and see how many visits reached it
* Funnels: an ordered route through the site, with the drop-off at every step. Order is enforced, so a visit only counts at a step if it got there after the step before it
* Journeys: the routes people actually take, and the single hops that tell you where a given page sends them next
* Retention: how a page holds its traffic over the days after it first lands, plus how often a visit is a return within the same day
* Segments: save a set of filters and apply it to every report with one click
* Cohorts: group visitors by how they arrived, what they used or where they landed, and compare them on how deeply they read

* Export: take the selected period out as CSV, TSV, JSON or NDJSON, one row per visit, per pageview or per day, with the filters on screen already applied

Goals, funnels and segments are defined on the screens that show them, not buried in settings. Each editor offers your own pages as you type and a set of starting points for the shapes that come up most often, so a goal takes about fifteen seconds to create and you can see immediately whether it matched anything.

These reports read the raw pageview table rather than the daily summaries, so they see as far back as your raw retention setting keeps. The Export screen's daily grain reads the summaries instead, so it reaches back further.

A note on Retention and Cohorts: ConvertNow identifies a visitor with a hash that is re-salted every day, so nobody can be followed from one day to the next. That is deliberate, and it means "did these visitors come back next week" is a question this data cannot answer. Rather than show a number that looks like retention and is not, both reports answer the version the data does support: how content holds its traffic, and how groups inside one period compare.

**Languages**

The interface ships translated into German, French, Spanish, Dutch and Italian, placeholders and plural forms included. English is the source language.

Translations live in `/languages` as both `.po` and `.mo`, so a wrong word can be corrected in any editor rather than only by whoever compiled it. Anything not yet translated falls back to English rather than showing a blank. New languages are welcome through https://translate.wordpress.org/projects/wp-plugins/convertnow-analytics/

**Chart insights, off until you ask**

Four extra layers the main chart can draw over your own numbers: a least squares trend line, a seven day centred average, a ring around each day sitting further from that line than this site normally varies, and the trend carried forward inside a band the width of that variation.

It is arithmetic, not a model. Every figure is computed in your browser from the numbers already on the screen, nothing is sent anywhere and no value is invented. All four are off out of the box and each is switched on separately in Settings, because a line drawn through somebody's traffic is a claim about it and the plugin should not make one uninvited.

**Privacy**

* No cookies, no localStorage, no persistent identifier of any kind
* The browser keeps a visit hint in sessionStorage, which dies with the tab. The server decides what counts as one visit, and it does so from the daily hash alone
* Visitors are counted with a one way SHA256 hash of IP plus user agent plus a salt that rotates every UTC day, so the same person cannot be followed from one day to the next
* Raw IP addresses are never written to the database
* Do Not Track is respected when you enable it
* Nothing about your visitors is sent anywhere. Country lookups happen on your own server against a table that ships inside the plugin

ConvertNow is cookieless and self hosted. It does not use cookies and it does not send visitor analytics to an external service. Whether your site needs consent depends on your jurisdiction and your configuration, so check your own obligations.

**No account, no key, no paywall**

Everything described above works the moment you activate the plugin. There is no sign up, no key to paste and no screen held back. Nothing leaves your server unless you ask it to.

**Upcoming features**

The plugin is complete as it stands and nothing here is needed to use it. This is what is being built next, roughly in order.

* **Which writers the assistants cite.** The AI dimension crossed with the author dimension, so a masthead can see whose work is being quoted rather than only which pages.
* **Import from your current plugin.** Bring your history across from WP Statistics, Independent Analytics, Burst, Koko Analytics, Statify or Jetpack Stats, so switching does not mean starting from an empty chart.
* **A tracking health check.** Analytics that quietly stop recording are worse than none. A check that tells you the script is loading, the collector is answering and yesterday actually got rolled up, with a warning on the screen when it did not.
* **Per-author email reports.** The weekly summary, scoped to one writer and sent to that writer. Everyone on the masthead gets their own numbers without an admin account.
* **A live screen.** The online counter, opened out into a real time view of what is being read right now.
* **WP-CLI commands.** `wp cnwa rollup`, `wp cnwa prune`, `wp cnwa export` and the rest, for people who deploy rather than click.
* **WooCommerce revenue by source and by author.** Which channel, which campaign and which piece of writing actually earned money, for sites that sell.
* **Consent plugin integration.** ConvertNow needs no consent banner, but where one is already installed the two should agree with each other rather than argue. Explicit support for the common consent plugins.
* **Network reporting on multisite.** One screen across every site in the network, instead of one dashboard per site.

Requests are welcome and they do move this list. Write to prateekzare@gmail.com.

**Who makes it**

ConvertNow Analytics is written and maintained by Prateek Zare (WordPress.org: prateekzare). Website: https://convertnow.tools. Questions, bug reports and feature requests: prateekzare@gmail.com, or contact@convertnow.tools which reaches the same inbox

== Installation ==

From your dashboard:

1. Go to **Plugins → Add New** and search for **ConvertNow Analytics**.
2. Click Install Now, then Activate.
3. Open **ConvertNow** in the admin menu. Data starts appearing immediately.

Or by hand:

1. Upload the `convertnow-analytics` folder to `/wp-content/plugins/`.
2. Activate it from the Plugins screen.
3. Open **ConvertNow** in the admin menu.

Either way that is it. No key, no account, no configuration. Country data is built in, so the map and the Countries panel fill in on their own. Your own visits are not counted while you are logged in as an administrator or editor, which is why the numbers stay at zero until real traffic arrives.

== Frequently Asked Questions ==

= Do I need an account or a licence key? =

No, and there is nowhere to put one. There is no account, no key, no activation and no paid tier. The plugin contains no code that makes an outbound request, so there is nothing to opt out of either.

= How do you tell an AI visitor from an AI crawler? =

They arrive by completely different routes and are handled at different points. A crawler identifies itself in the user agent, and GPTBot, ClaudeBot, CCBot, PerplexityBot, Bytespider, Applebot and Amazonbot are all refused by the collector before a row is written, so they never become traffic. A visitor is a browser carrying a referrer from an assistant's own domain. Only the second one reaches the AI screens, which is why every figure there is a person who read an answer and followed the citation.

= Why did my Gemini traffic used to show up as Google? =

Because Gemini is served from gemini.google.com, and a rule that looks for "google" in the referrer catches it. Copilot has the same problem on microsoft.com. ConvertNow checks the assistants first, so a visit from Gemini is counted as an assistant and a visit from Google Search is counted as search. Existing summaries are rebuilt on upgrade, so past days are reclassified too.

= An assistant is missing. Can I add it? =

Yes, with the `cnwa_ai_sources` filter. Each entry is a pattern matched against the referrer host and the name to show. The list is checked in order, so a narrow host goes above a broad one.

= Do the trend line and forecast use AI? =

No, and the plugin does not claim they do. They are a least squares fit and the standard deviation of the days around it, computed in your browser from the figures already on the screen. The forecast is that straight line continued, and the band around it is how much the measured days actually varied. Nothing is sent anywhere and no model runs. Every layer is off until you switch it on in Settings.

= Where do I set up a goal or a funnel? =

On the Goals or Funnels screen itself, under the report. Open the report, expand the editor below it, pick a page from your own site, save. Creating a definition needs the same capability as changing a setting, so a user who can view reports but not manage the site sees the report and no editor.

= Why does Retention not show whether visitors came back next week? =

Because ConvertNow cannot tell. A visitor is identified by a hash that is re-salted every day, on purpose, so the same person is unrecognisable tomorrow. Rather than print a number that looks like week-over-week retention and is not, the report answers what the data actually supports: how a page holds its traffic over the days after it lands, and how often a visit is a return within the same day.

= How far back do the behaviour reports go? =

As far as your raw retention setting keeps pageviews, ninety days by default. Goals, funnels, journeys, retention and cohorts all need the shape of individual visits, and the daily summaries have already rolled that away. Each of those screens says the date it can see back to.

= How does it know who wrote a post? =

WordPress already does. The tracker resolves each URL to the post behind it and stores the author ID with the pageview, then the report turns IDs back into display names when it draws. Nothing is sent anywhere to work that out.

= Will author reports cover posts published before I installed it? =

Views recorded before you installed it do not exist, so no. Views recorded before version 2.0 carry no content type yet; Settings has a Classify button that resolves them in batches and backfills Authors, Blog Posts and Content Types for that history.

= Does it work with caching plugins? =

Yes. The beacon is client side and posts to a REST endpoint, so a cached HTML page still reports its own view.

= Does it work with a CDN or Cloudflare? =

Yes. Set the visitor IP source in Settings so country lookups and visitor counts use the real client address instead of the proxy.

= Does it support IPv6? =

Yes. Country lookups cover IPv4 and IPv6.

= Does the country lookup add load to my server? =

Almost none. The table ships with the plugin, so there is no download and no import. A lookup reads one small block of a file, about three microseconds, with no database query and no network request. Results are reused within a request.

= How accurate is the country data? =

It resolves IPv4 to /24 and IPv6 to /48, which is right for about 98% of addresses when checked against the full DB-IP dataset. That is a deliberate trade: a coarser table means a much smaller file and a much cheaper lookup, and it is more than enough to see where an audience is.

= Why do my visitor counts differ from other analytics tools? =

ConvertNow filters bots aggressively and counts a visitor as unique within a single day. Tools that use persistent cookies count differently. Neither number is wrong, they measure different things.

= A content blocker is blocking the endpoint. =

Rename the endpoint in Settings. The tracker picks up the new name automatically.

= Can I track a static page hosted elsewhere? =

Yes. Settings has a snippet. Add the other domain to the allowed domains list first.

= Can I filter the dashboard? =

Yes. Click any row label in a breakdown panel and everything recalculates against that value. Filters stack and combine with AND. Because the daily summaries store each dimension separately, a filtered view reads raw rows, so it reaches back as far as your raw retention setting allows. The filter bar tells you that date.

= Is the trend line a forecast? =

No. It is a least squares fit through the period you are viewing, continued a short way past the end. It knows nothing about seasonality, campaigns or what you publish next. Treat it as direction of travel.

= Does it track clicks? =

No. ConvertNow deliberately records pageviews and engagement only, which keeps the database small and the dashboard readable.

= Where is my data stored? =

In your own WordPress database, in four tables prefixed `cnwa_`. Deleting the plugin removes all of them. The country lookup table is a read only file inside the plugin folder and holds nothing about your visitors.

**Clicks, downloads and searches, when you want them**

Off by default, and honest about why. A page view writes one database row per page; a click writes one per interaction, so an events table grows with how much people do on your site rather than with how many of them turn up. Nothing is collected until you choose it, one type at a time:

* Outbound links, with the destination and the domain
* File downloads, matched by extension
* Email and phone links
* Anything you name with a CSS selector, labelled by `data-cnwa-label` or its own text
* Page views that returned a 404, and the pages that linked to them
* What people typed into your search box

The last two are effectively free: they ride along with a page view that is already being recorded, so they cost one row and no extra request. Broken links and empty searches are usually the fastest wins on any site.

The settings screen tells you what switching this on will cost before you switch it on, using your site's own traffic from the last thirty days and a per-event size measured on a real database rather than guessed. Events have their own retention window, separate from page views, because they are the rows that grow fastest.

**Notes on the chart**

A spike six weeks ago is just a shape unless something tells you what it was. Mark the day you redesigned, sent the newsletter or changed your prices, and the note stays on the chart with the traffic it explains. They are stored in one option row, so there is no table and nothing left behind.

**A weekly email**

Last week against the week before, your five most read pages and five biggest sources, in an email you can read in fifteen seconds. It comes from your own site, contains no tracking pixel, and reads from the daily summaries, so it costs the same whether you had a hundred visitors or a million. Off until you ask for it, and there is a button to send one now and find out whether email leaves your site at all.

== Screenshots ==

1. The Overview: visitors, visits, views, bounce rate and time on page, with the chart's optional trend, average, unusual-day and forecast layers switched on
2. AI at a Glance: which assistants send people, what they were sent to, and how AI compares with every other channel
3. AI Assistants, ranked, with each one's share over time and how deeply its readers read
4. Pages at a Glance: what gets read, where visits begin and where they end
5. Referrers at a Glance: channels, search engines and social networks together
6. Campaigns at a Glance: UTM sources, mediums and campaigns in one place
7. Geographic at a Glance: countries and languages, with a world map
8. Goals, with the builder open: each rule reads back in a sentence and says how many of your pages it matches
9. Settings: the switches for the chart insights, data retention, and the weekly summary email

== External services ==

ConvertNow uses no external service, and it has no optional one either.

Tracking, reporting, goals, funnels, journeys, retention, segments, cohorts, country lookups and exports all run on your own server against your own database. The plugin makes no outbound HTTP request of any kind, schedules no call home, and has no activation, licence or telemetry endpoint. Nothing about your site or your visitors ever leaves it.

The country lookup tables ship inside the plugin as plain text files and are read from disk. There is nothing to download and nothing to import.

== Other Notes ==

**Support**

Email contact@convertnow.tools or visit https://convertnow.tools.

**Bundled data**

IP Geolocation by DB-IP (https://db-ip.com), used under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).

Country lookups read two plain text tables built from the DB-IP IP to Country Lite database: `assets/data/geo-ipv4.csv` and `assets/data/geo-ipv6.csv`. Every line is one boundary, written as an uppercase hex address prefix and an ISO 3166-1 alpha-2 country code, so both files can be opened and read in any text editor. The world map outlines are plain JSON path data at `assets/data/world.json`. Nothing in the plugin is compiled, minified or obfuscated.

== Changelog ==

= 1.1.0 =

**AI visibility.** Visits arriving from an AI assistant are now counted as their own channel and reported on their own screens.

* A new **AI Visibility** section: AI at a Glance, AI Assistants, Pages Cited by AI, and Fastest-Growing Assistants.
* **AI assistant** joins direct, organic search, social, email, referral and paid as a channel, so it appears everywhere a channel appears, including the Overview and the Channels report.
* An **AI** tab on the Overview's Sources panel.
* ChatGPT, Perplexity, Claude, Gemini, Copilot, Grok, DeepSeek, Meta AI and Le Chat are recognised by name. `cnwa_ai_sources` adds more.
* **Fixed: Gemini was being counted as organic search.** Gemini is served from gemini.google.com and Copilot from microsoft.com, so the search-engine rule matched both. Assistants are now tested before search engines. Summaries are rebuilt on upgrade, so past days are reclassified as well.
* Crawlers are unaffected: GPTBot, ClaudeBot, CCBot, PerplexityBot and the rest are still refused before a row is written, so nothing on these screens is a machine.

**Chart insights, all off by default.** Four statistical layers for the main chart, each switched on separately in Settings.

* A least squares trend line.
* A seven day centred average, which takes the weekday cycle out.
* Unusual days, ringed when they sit further from the trend than this site normally varies. The threshold is configurable.
* A forecast: the trend carried past today inside a band the width of the measured variation, so an irregular site gets a wide band rather than a confident wrong line.
* These are arithmetic, computed in the browser from the numbers already on screen. Nothing is sent anywhere, no model runs and the plugin does not describe them as AI.

**Goals and funnels are easier to build.**

* Every goal row now reads its own rule back as a sentence and says how many of your pages match it, updated as you type, so a mistyped path is obvious before you save rather than after an empty report.
* Funnel steps can be reordered without deleting and retyping them.
* "Add an empty row" is now "Add a goal" and "Add a funnel", and both put the cursor where you are about to type.

**Fixed**

* Pages Cited by AI and other path lists no longer truncate the path to a single character in the glance panels.

= 1.0.0 =

First public release on WordPress.org.

* **Editorial reporting is the point of it.** Traffic by author with real display names, Fastest-Growing Authors measured against the previous period of the same length, Blog Posts on a screen of their own so the home page stops drowning out the writing, and Content Types splitting posts from pages, products and archives.
* **Real engagement, not guessed engagement.** Bounce rate and time on page come from an engagement beacon rather than from the gap between two timestamps, and read depth is recorded per post.
* Pages, entry pages, exit pages, referrers, channels, UTM campaigns, countries, languages, browsers, systems, devices and screen sizes, each on its own screen and in an at a glance summary.
* Goals, funnels, journeys and retention, all defined and edited from the report they feed.
* **Cookieless by design.** No cookie, no browser storage, no device fingerprint. Visitors are counted with a daily rotating hash that cannot be reversed or carried across days, and no IP address is ever written to the database.
* **Self hosted, end to end.** Every figure is computed in your own tables. Nothing is sent anywhere, there is no account, no API key and no paid tier.
* Country lookup runs locally against a bundled DB-IP table. No lookup service is contacted.
* Daily rollups keep the reports fast on large sites, with configurable retention for raw hits, events and summaries.
* Weekly email digest, a dashboard widget, a read only shareable dashboard link, CSV export and annotations.
* Every table and column name binds through `$wpdb->prepare()` with the `%i` placeholder, which is why WordPress 6.2 is the minimum. Nothing the plugin runs is assembled from a string.
* Report caching is keyed by permission scope, so a payload built for an administrator can never be served to a shared dashboard link.

== Upgrade Notice ==

= 1.1.0 =
Adds AI assistant traffic as its own channel and its own reports, and fixes Gemini and Copilot being counted as organic search. Daily summaries are rebuilt once on upgrade so past days are reclassified too. Also adds optional trend, average, anomaly and forecast layers to the chart, all off until you switch them on.

= 1.0.0 =
First public release.
