Infinitnet Cookieless Analytics for WooCommerce

Description

Cookieless Analytics is free, open source, self-hosted analytics that counts visits without cookies and without writing anything to the visitor’s device. The Infinitnet Cookieless Analytics plugin connects a WordPress site to your own Cookieless Analytics install and adds what a WordPress or WooCommerce site needs: the page script, a visitor opt-out and, with WooCommerce, the store funnel and revenue.

WordPress keeps no reports and no analytics data. Everything the plugin counts is stored by the engine, in your own database.

What Is Cookieless Analytics?

Cookieless analytics is web analytics that stores nothing on the visitor’s device: no cookie, no local storage, no session storage, no IndexedDB. Cookieless Analytics still reports real sessions.

  • Visitor key: a salted hash of the site, the shortened IP address, the browser family and major version, the operating system family and the device class. The salt is random and changes every day, and old salts are deleted.
  • Sessions without a cookie: entry and exit pages, pages per session, bounce rate, duration and first-touch source.
  • Privacy signals: Global Privacy Control is honored by default.
  • Your data, your database: the engine runs on your own Cloudflare account and sends no telemetry.
  • Search data next to traffic: Google Search Console and Bing Webmaster Tools in the same reports.
  • License: free, Apache-2.0. The tracking script is about 3 KB gzipped.

Details: the Cookieless Analytics product page, the source on GitHub and the npm package.

What the Plugin Does

  • Page script: prints the engine’s script on block themes and classic themes.
  • Opt-out control: the shortcode [cookieless_analytics_optout] and the block “Visit counting opt-out”.
  • Store funnel with WooCommerce 11.2 or newer: product and list views, cart changes, coupons and checkout start are sent by the visitor’s page.
  • Orders and revenue with WooCommerce: checkout steps, purchases with their line items, full and partial refunds and cancellations are sent by the WordPress server through the engine’s keyed endpoint, from a queue run by Action Scheduler.
  • Order storages and checkouts: both WooCommerce order storages (HPOS and posts), the Cart and Checkout blocks and the shortcode cart and checkout.
  • Multisite: settings, secrets and the order queue are per site on a network.

The settings page offers only what the engine exposes. Outbound links, downloads, forms, screen width, link rules and privacy signals are engine settings and apply to every site that loads its script.

Three Ways to Load the Page Script

  • From the engine: the visitor’s browser loads the script from the engine and posts to it directly. This is the default and needs no setup.
  • From your own domain through an edge rule: a rule in front of your site, for example a Cloudflare Worker, answers /_/e.js and /_/e on your domain and passes them to the engine. The guide has a Worker you can copy: set up the edge rule.
  • From your own domain through WordPress: WordPress acts as the proxy (engine 1.4.0 or newer, sites at the domain root only): set up the WordPress proxy.

Not sure which one? Start with the engine. Which one should I choose?

Documentation

Requirements

  • WordPress 7.0 or newer.
  • PHP 8.1 or newer. PHP 8.3 or newer is recommended.
  • A Cookieless Analytics install, version 1.3.2 or newer; 1.4.0 or newer for the WordPress proxy.
  • The site served over https.
  • WooCommerce 11.2 or newer for the store events and orders (optional).

What the Plugin Stores and Sends

  • Cookies and browser storage: The plugin sets no cookies and writes nothing to the visitor’s browser storage. On engines older than 1.4.0 it reads one key in local storage, the engine’s opt-out flag.
  • Page views and page events: Page views and page events go from the visitor’s browser to the engine, under the engine’s own bot rules, privacy signals, opt-out and rate limits.
  • Orders: For an order the WordPress server sends the order total and currency, the order time, an order reference made of the internal order id (which can differ from the order number a numbering plugin shows) and a keyed hash, tax, shipping and discount totals, coupon codes (or only whether a coupon was used), payment and shipping method, and the order lines with quantity and price. No name, email address, postal address or payment detail is ever sent.
  • Session ids: The session id of a visit waits with an order report and is used for at most 24 hours; a scheduled job then deletes it. Cart events wait next to the visitor’s WooCommerce session for at most 30 minutes, and the session id kept there is used for at most 24 hours.
  • Visitors who opted out: Orders of visitors who opted out (or whose Global Privacy Control signal the plugin honors) are reported with the amount, currency, order time and order reference only, without a session, order details or line items; or not at all, by setting. The objection is stored on the order, so a payment weeks later and the renewals of a subscription bought that way follow it too. Refunds of such an order are still sent with their amount, and a cancellation with the order reference only.
  • When the opt-out is known: An objection is known only for orders placed in a visit while the opt-out state reached the plugin, or with the Global Privacy Control header on the request that placed the order. Orders created in the admin, by other code or before the connection was set up carry no objection and are reported in full when they count.
  • Privacy policy: The plugin adds a suggested section to WordPress’s privacy policy guide.
  • API key and proxy secret: The API key and the proxy secret are stored encrypted, or as constants in wp-config.php. They are never shown, never logged and never sent anywhere but to the engine.
  • Visitor address with the WordPress proxy: With the WordPress proxy, the visitor’s address goes to the engine in a header of the forwarded post and is never stored in WordPress. Per visitor rate limits are keyed by a hash of the address under a daily key.

External services

The plugin connects your site to one external service: the Cookieless Analytics engine. You run the engine yourself, for example on your own Cloudflare account, and enter its address on the settings page. The plugin author does not operate it, the plugin calls no other host, and nothing is sent before you save the engine URL and the site key.

What Is Sent, and When

  • Page views and events: the visitor’s browser loads the engine’s script and sends the page address, referrer, user agent, language, time on page, scroll depth and recorded events. With the WordPress proxy, WordPress forwards each post and adds the visitor’s address in a header.
  • Store events with WooCommerce: product and list views, cart changes, coupons and checkout start, with product id, SKU, name, price, currency, category and quantity, or the cart’s counts and value.
  • Orders with WooCommerce: when an order is paid, refunded or cancelled, the WordPress server sends it from a background queue with the API key. The contents are listed under “What the Plugin Stores and Sends”. No name, email address, postal address or payment detail is sent.
  • Connection checks: Test connection and Send test call the engine when an administrator clicks them. With the proxy chosen, WordPress repeats its checks once a day.

Terms and Privacy

The engine is yours, so its terms and privacy policy are your own. What the engine stores and for how long: Cookieless Analytics privacy model.

Screenshots

Blocks

This plugin provides 1 block.

  • Visit counting opt-out A button that lets visitors stop and resume the counting of their visits.

Installation

  1. Set up Cookieless Analytics first: it is the engine that counts and stores everything. The product page and the install guide on GitHub start with a one-click Cloudflare deploy or an npm install.
  2. In WordPress, open Plugins, Add New Plugin, search for “Infinitnet Cookieless Analytics”, then install and activate it (on a network: per site or for the whole network).
  3. In the engine admin: register the site with every host name it answers on, create an API key with the scope write:events limited to that site, and turn “Accept revenue from browsers” off for that site.
  4. In WordPress, open Settings, Cookieless Analytics. Enter the engine URL, the client site key, the site id (empty for a linked host) and the API key, save, and run Test connection. The setup guide explains each field.
  5. With WooCommerce: run Send test on the Status tab.

Each setting has a help text and a link to its guide on the settings page, and the Status tab shows the state of the order queue. To load the script from your own domain, see where the page script loads from.

FAQ

What is cookieless analytics?

Web analytics that stores nothing on the visitor’s device. The engine groups page views into visits with a salted hash that changes every day, so it keeps no cookie, no local storage and no profile of a person across days. The reports count visitors per day, and a figure over several days is the sum of daily visitors.

Does Cookieless Analytics need a cookie banner?

It is designed to need none: nothing is written to the visitor’s device and no personal data is kept. Whether that holds for your site depends on your country, your other tools and how you use the data. This describes the technical setup and is not legal advice.

How is this different from an analytics plugin that keeps its data in WordPress?

The plugin keeps no analytics data in WordPress. The engine stores every number in your own database and measures any site with one script tag, so several sites report into one admin.

Is it free?

Yes. The plugin is GPLv2 or later and the Cookieless Analytics engine is Apache-2.0. You run the engine on your own Cloudflare account.

Which engine version does the plugin need?

Cookieless Analytics 1.3.2 or newer for the page script, the opt-out control, the store events and the orders. Version 1.4.0 adds what a WordPress proxy needs, and the read-only opt-out flag window.__ec.off, which the plugin reads when it exists.

Why does the WordPress proxy need engine 1.4.0?

A proxy sends every visitor’s events from the WordPress server’s own address. Before 1.4.0 the engine cannot learn the visitor’s address from a proxy, so all proxied visitors with the same browser, system and device class would merge into shared sessions. Engine 1.4.0 adds a per-site proxy secret that lets a proxy state the visitor’s address, a proxy: true field in its discovery answer and a proxy check route that confirms the secret. The plugin offers the choice “This site, through WordPress” only when the discovery answer has that field, puts it in effect only after the proxy check passed, and repeats both checks once a day: a refused secret or a lost capability switches the tag back to the engine.

How do I set up the edge rule?

The edge rule is a rule in front of your site that answers the script path and the event path on your own domain by passing them on to the engine, with the engine’s proxy secret and the visitor’s address in two headers. The edge rule guide has the steps, a Cloudflare Worker you can copy, the headers any server must send, and how to check that visitors stay apart.

How does the WordPress proxy work, and where does it not work?

WordPress serves the engine’s script from its REST route cawp/v1/s as a hash checked copy and forwards the script’s posts from the event path (by default /_/e) at the root of the site to the engine, with the visitor’s address. The browser never contacts the engine. It works only for a site at the root of its domain whose web server passes unknown paths to WordPress (pretty permalinks on Apache, try_files on nginx); a subdirectory install keeps the direct tag and shows a notice. Behind a CDN or reverse proxy, set the trusted address header and the trusted proxy ranges on the Script tab, or posts are dropped for lack of a visitor address. Security plugins that block the REST API for visitors must allow the script route. Reference: the WordPress proxy section of the setup guide. Each page view costs at least two uncached PHP requests and one outbound call per event post. While the engine fails repeatedly, a breaker answers posts with 204 for a while and those page views are not counted.

Why does the proxied tag have no integrity attribute?

The engine changes its script when its settings change. A page cache holding an old hash would make browsers refuse the new script and silently stop counting. Instead, WordPress serves only the exact bytes it fetched from the configured engine, checked against the stored SHA-256 hash and source URL.

Which API key scope is needed?

Only write:events, limited to the site. The plugin never asks for a read scope.

Does the plugin store analytics data in WordPress?

No. It stores its settings, an order queue table, the reported state of each order as protected order meta, and, for each shopper with a WooCommerce session, a short-lived record with the page’s session id and waiting cart events.

Why is there no script tag on the order received page?

The page address holds the order id, and the engine’s first page view always uses the page path. The setting “Skip pages whose address holds an order id” (default on) leaves these pages out. The purchase is reported by the server.

Does the browser send the purchase?

No. Purchases, refunds and cancellations are sent by the WordPress server, so a reloaded thank-you page, or a visitor who never returns from the payment page, changes nothing.

Does it work with page caches and script optimizers?

The tag carries data-no-optimize="1", data-no-minify="1" and data-cfasync="false", and the site key is in the script URL, so a tool that rebuilds script tags keeps it. Product and list pages hold no visitor data and can be cached. Pages that carry a visitor’s cart events send no-cache headers and define DONOTCACHEPAGE. An optimizer that holds every script until the first interaction, ignoring those attributes, delays counting until that interaction. The store code’s call back to WordPress carries a WordPress nonce in its URL, valid for 12 to 24 hours; a cached page older than that gets an empty answer from the plugin until the cache refreshes, and the waiting cart events are sent from the next fresh page.

What happens on uninstall?

Deleting the plugin always removes its scheduled actions (including the proxy’s daily recheck), locks and transients (including the proxy’s state). With “Remove all plugin data on uninstall” on (the default) it also removes its options, the order queue table and its order meta. On a network each site’s own setting applies.

Does it support WooCommerce Subscriptions?

Renewal, parent, switch and resubscribe orders are reported as purchases with their type when the extension’s functions exist. Subscription status changes are not sent.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Infinitnet Cookieless Analytics for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.2

  • Adds a guide for the three tag sources, with the steps and a Worker example for the edge rule, and links to it and to the setup guide from the settings page and this listing.
  • Rewrites the External services section.
  • The plugin’s URI is now its own product page.

1.0.1

  • Rewrites the listing text: what cookieless analytics is, what the plugin does, what it stores and sends, and how to install it.

1.0.0

  • First release.
  • Prints the engine’s page script, loaded from the engine, from an edge rule on the site’s own host or through WordPress as a proxy, with a “Test connection” check and a Status tab.
  • Offers the opt-out control as a shortcode and as a block, and adds a suggested privacy policy text.
  • Sends WooCommerce product, list, cart, coupon and checkout events from the visitor’s page, and checkout steps, purchases with line items, refunds and cancellations from the server through a background queue, with both order storages.