Title: Kehai Analytics
Author: kehai
Published: <strong>October 12, 2026</strong>
Last modified: October 12, 2026

---

Search plugins

![](https://ps.w.org/kehai-analytics/assets/icon.svg?rev=3740674)

# Kehai Analytics

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

[Download](https://downloads.wordpress.org/plugin/kehai-analytics.0.2.0.zip)

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

 [Support](https://wordpress.org/support/plugin/kehai-analytics/)

## Description

Kehai counts what happened. No sampling, no modeling, no cookies. This plugin connects
a WordPress site to your Kehai account and, if you run WooCommerce, sends the revenue
your server has confirmed.

**Kehai is a hosted, paid service, and new accounts start with a free trial.** You
need a Kehai account with your site added to it: [kehai.io](https://kehai.io)

#### What the plugin does

 * **Adds the Kehai tracker.** No code to paste and no API key needed.
 * **Sends WooCommerce revenue from the server.** Paid orders and refunds go out
   after the payment is confirmed, not when a thank-you page loads.
 * **Shows what was sent.** A delivery ledger in WordPress lists every sale and 
   refund, its status, and what to do when one needs review.

The two functions are switched on separately. Tracker-only use needs nothing but
your public site ID.

#### Privacy

 * No cookie, and nothing written to browser storage.
 * Administrators, previews, and visitors who send DNT or GPC are left out.
 * No API key in HTML. The commerce key stays on your server.
 * No order IDs, customer details, or payment IDs leave WordPress.

#### For WooCommerce shops

 * A sale counts when WooCommerce confirms the payment, with its actual payment 
   time.
 * Refunds follow their purchase: complete, itemized partial, and shipping or tax
   only.
 * Bank transfers, cash on delivery, and refunds recorded by hand are confirmed 
   in one short form.
 * A delivery that fails is retried with the same identity, so a sale is never added
   twice.
 * Works with HPOS and legacy order storage, and with the classic and block checkout.

#### Where the reports are

The plugin collects. Reports, forecasts, goals, and exports are in your Kehai panel.

No Google Ads or Stripe account is connected by this plugin. Google Ads exports 
in Kehai require a real payment time and a retained GCLID in the explicitly supplied
purchase context.

### External services

The plugin sends data to the site’s Kehai account at https://stats.kehai.io:

 * GET /k.js?site=: the browser loads the Kehai tracker for that site. The tracker
   sends the page and declared event data described by https://kehai.io/docs/install,
   and the collector applies the selected site’s settings when the data arrives.
 * GET /api/v1/commerce/status: a server-side Bearer-key connection check returns
   site/module/query-exclusion configuration.
 * POST /api/v1/commerce: server-side confirmed order aggregates, optional bounded
   acquisition context and a random idempotency UUID. The secret, local order/customer
   IDs and payment transaction IDs are not part of the analytics payload.
 * POST /api/v1/commerce/status: at most once per minute, server-side pending/review
   counts and a fixed error category. No order identifier or raw error text is sent.

Commerce keys stay in a non-autoloaded WordPress option. They are never echoed in
HTML, copied into JavaScript, or stored in the outbox. Protect database backups 
like other WordPress credentials. Outbound commerce requests require HTTPS, certificate
validation and no redirects.

Kehai terms: https://kehai.io/terms-of-use
 Kehai privacy: https://kehai.io/privacy-
policy Commerce contract: https://kehai.io/docs/ecommerce

## Screenshots

[⌊Overview: the connection, the tracker, WooCommerce, and the delivery queue at 
a glance.⌉⌊Overview: the connection, the tracker, WooCommerce, and the delivery 
queue at a glance.⌉[

Overview: the connection, the tracker, WooCommerce, and the delivery queue at a 
glance.

[⌊Settings: what this WordPress site sends to Kehai.⌉⌊Settings: what this WordPress
site sends to Kehai.⌉[

Settings: what this WordPress site sends to Kehai.

[⌊Deliveries: every sale and refund queued for Kehai, with its status and what to
do next.⌉⌊Deliveries: every sale and refund queued for Kehai, with its status and
what to do next.⌉[

Deliveries: every sale and refund queued for Kehai, with its status and what to 
do next.

[⌊First run: three steps to connect a site.⌉⌊First run: three steps to connect a
site.⌉[

First run: three steps to connect a site.

## Installation

 1. Install and activate Kehai Analytics. Activate it separately for each site in a
    WordPress network, since network activation is not supported.
 2. Open Kehai Analytics in the WordPress menu. Enter the public site ID from Kehai
    Settings > Install.
 3. Turn on the tracker. Remove an older manual snippet when moving to the plugin, 
    and clear HTML or page caches once after updating the plugin or changing the site
    ID.
 4. For commerce, activate WooCommerce, enable Ecommerce on the Kehai site, and create
    its dedicated WordPress/WooCommerce integration key. On the Settings tab, enter
    the secret in Commerce API key and turn on Send confirmed payments and refunds.
 5. Save and check connection verifies the site, domain, commerce permission and enabled
    module. It refreshes the server-side commerce exclusion snapshot. It does not create
    a test sale.
 6. Confirm a real successful payment through your payment method and check the Deliveries
    tab. Configure regular WordPress cron for shops with low traffic, and watch Pending
    and Needs review.

## FAQ

### Do I need a Kehai account?

Yes. The plugin is free and open source, and it connects your site to Kehai, which
is a hosted, paid service. New accounts start with a free trial. A Kehai account
and a site in it are required.

### Does the tracker use cookies?

No. The tracker does not add cookies or browser storage. Administrator visits, WordPress
previews and browser DNT/GPC opt-outs are excluded. Existing Kehai scripts take 
precedence to prevent a second injection.

### Does this make my site GDPR compliant?

No plugin can promise that. Collect only URLs, catalogue labels and public coupons
appropriate for your installation. Unblocked click parameters may be linkable to
advertising records. This plugin does not establish your legal basis, substitute
for required consent, or provide a blanket GDPR certification.

### Where do I manage query exclusions?

Only in Kehai Settings > Site. There is no list to paste: the collector applies 
the site’s current list to every pageview and event when it arrives, and drops the
excluded names before anything is stored. A change takes effect within 30 seconds,
once the collector refreshes its settings cache, and no HTML cache purge is needed.
An excluded parameter still travels in the request from the browser to the collector;
it is not stored. Server-side commerce capture keeps the latest successful connection-
check snapshot; the collector reapplies current site exclusions before storing orders.

### What counts as a payment?

The automatic hook is WooCommerce payment_complete, using its actual date_paid. 
Creating an order, viewing a thank-you page, or changing a status to processing 
is not enough. In particular, cash-on-delivery may be processing before cash is 
received.

### What about bank transfers, cash on delivery, or gateways that skip payment_complete?

Use Confirm a manual payment or refund on the Deliveries tab. Enter the local order
ID, actual payment timestamp with an explicit timezone, and confirm that the money
was received. For example: 2026-09-13T14:30:00+02:00. The same local source is used
for manual and automatic confirmation, so a later callback does not add the sale
again.

### Does it import my old orders?

No. Only future payment hooks are collected automatically. Enabling the plugin does
not backfill old orders. Manual confirmation is an explicit request to include that
transaction; use it only for the correct site and avoid historical orders already
sent by another integration.

### Which amounts are sent?

Product net excludes tax and shipping and already includes discounts. Unit price
is before discount; item discount covers the whole line. Taxes and shipping are 
sent separately, using WooCommerce’s actual amounts. Only catalogue SKU/product 
ID and product name are sent; personalised order line names, customer details, payment
IDs and arbitrary order metadata are excluded.

### How are refunds handled?

Automatic refunds require WooCommerce’s successful gateway refund marker. A manually
recorded accounting refund needs explicit confirmation that money was returned; 
enter its local refund ID in the confirmation form. A refund waits for its purchase’s
successful Kehai delivery.

Complete refunds reverse the exact original breakdown. Itemised partial refunds 
reverse the specified quantities, tax, shipping and proportional original line discounts.
A shipping/tax-only refund with an explicit complete breakdown is supported. An 
amount-only partial refund is supported only when tax, delivery and discount allocation
are unambiguous; no product units are inferred.

### Why does a delivery say Needs review?

Fee lines, fractional quantities, deleted catalogue products, mismatched totals 
and ambiguous partial-refund allocations enter Review instead of guessing a number.
Correct an unattempted mapping in WooCommerce and confirm it again; its original
random delivery UUID remains. A payload that was already prepared or attempted cannot
be edited or resent under a new identity through this plugin.

A local hash of the original financial/catalogue basis also prevents a later order
edit, SKU/name change or changed coupon-reporting selection from creating a refund
against different product data. Such refunds enter Review. The hash does not contain
the acquisition URL.

### Are coupon codes sent?

Only if you turn it on. Coupon reporting is opt-in. Enable it only for public campaign
codes that cannot identify a customer. One redeemed code can populate the coupon
dimension; several codes are not combined into an invented code. Their actual discount
amount is still reported.

### How does a sale get its landing page or campaign?

The optional WooCommerce adapter stores the first available page context in an already
existing WooCommerce session. It does not create that session’s cookie to recover
an earlier landing. If a buyer first arrives before the shop has a session, that
earlier context may be unavailable; it is not reconstructed. Checkout/account routes
are not used as landing context.

The available site-relative URL and query are bounded to 2048 bytes, and query names/
values to 255 characters. Only the site’s configured exclusion list filters query
names; there is no additional fixed UTM or GCLID whitelist. Referrers are reduced
to a hostname. DNT/GPC prevents storing the context and marks the checkout order
so later server payment callbacks remain excluded. It does not link orders to Kehai
visitor IDs.

### How long is that context kept?

Session context older than two days is not copied to a new order. The captured context
on an order is eligible for at most 90 days; hourly bounded cleanup removes older
order context. WordPress cron delays can delay physical cleanup, so configure a 
reliable server cron. The accepted outbox payload is cleared immediately. Pending/
review payloads are cleared within 48 hours by the queue’s scheduled cleanup. Minimal
local delivery records remain to prevent future duplicate callbacks. WooCommerce’s
order erasure removes stored context.

### What happens when a delivery fails?

The local source ledger has one record per purchase/refund and a persisted random
UUID. Retries keep the same key, UUID and frozen bytes. A lost response is uncertain,
not evidence that the server stored nothing. Retry attempts stop within 47 hours
of their first attempt, before the collector’s 48-hour reservation expires. An expired
or conflicting delivery needs reconciliation and is never automatically recreated.

### Can I change the site ID or the API key later?

Changing the site or API key is blocked while Pending or Review records exist. Retry
now advances a pending attempt without changing its identity. Stop preserves the
local source ledger; it cannot undo an already accepted sale. Reconcile any uncertain
outcome before replacing the integration.

### What happens when I deactivate or uninstall the plugin?

Deactivation stops scheduled work and retains settings/ledger. Uninstalling deletes
local plugin settings, queue and order context; it does not delete already collected
Kehai data. Reconcile unresolved deliveries before uninstalling, and do not replay
historical confirmations after reinstalling without checking earlier deliveries.

### Which WooCommerce setups are supported?

Uses WooCommerce order CRUD and supports HPOS and legacy order storage. Both classic
checkout and the Store API checkout hook attach context. Compatibility depends on
the gateway emitting payment_complete for actual receipt and correctly marking successful
refunds. No checkout template replacement is needed.

### Does it work on multisite?

Network activation is not supported. Activate separately for each site in a WordPress
network, with its own site-scoped connection and queue.

### I installed 0.1.1 from a ZIP. How do I move to this version?

That version lives in a folder named kehai, and this one installs beside it as kehai-
analytics. Deactivate the old copy, remove wp-content/plugins/kehai with SFTP or
your host’s file manager, then activate this one. It continues with the same settings
and delivery ledger. The Delete link on the Plugins screen is an uninstall: it erases
both, so use it only on a tracker-only site where re-entering the site ID is all
that is lost. WordPress refuses to activate the two copies together.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

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

Contributors

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

[Translate “Kehai Analytics” into your language.](https://translate.wordpress.org/projects/wp-plugins/kehai-analytics)

### Interested in development?

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

## Changelog

#### 0.2.0

 * New admin screens under their own Kehai Analytics menu: Overview, Settings, and
   Deliveries, with the connection status and the delivery queue visible at a glance.
   They used to be one page under Settings.
 * A first-run screen walks through the site ID, the tracker, and the optional WooCommerce
   step.
 * Fixed: on a site whose admin and front page use different hosts, a saved form
   landed on the Dashboard instead of the plugin’s screen.
 * Fixed: the warning about a refund recorded by hand stayed on screen after the
   refund was confirmed. It now names the refund and ends with it.
 * What the plugin collects and sends is unchanged, and so are its settings, its
   queue, and its payloads.

#### 0.1.2

 * The plugin folder and main file are now kehai-analytics, matching the text domain.
   Read the upgrade notice before replacing a 0.1.1 ZIP installation.
 * WordPress prints the tracker loader through its script queue, deferred and in
   the footer. The loader and the tracker it requests are unchanged.
 * Each settings form verifies its nonce where it reads the form, and uninstall 
   uses prepared table identifiers. No setting, queue record or payload changed.

#### 0.1.1

 * Site-specific tracker URL loads current Kehai settings without copied query exclusions.
   Recognizes both short and legacy manual tags to prevent duplicate tracking.

#### 0.1.0

 * Initial tracker and optional WooCommerce payment/refund integration, guarded 
   connection setup, durable delivery queue and operational status.

## Meta

 *  Version **0.2.0**
 *  Last updated **2 days ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.5 or higher **
 *  Tested up to **7.1.3**
 *  PHP version ** 8.1 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/kehai-analytics/)
 * Tags
 * [analytics](https://mfe.wordpress.org/plugins/tags/analytics/)[ecommerce](https://mfe.wordpress.org/plugins/tags/ecommerce/)
   [privacy](https://mfe.wordpress.org/plugins/tags/privacy/)[statistics](https://mfe.wordpress.org/plugins/tags/statistics/)
   [woocommerce](https://mfe.wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://mfe.wordpress.org/plugins/kehai-analytics/advanced/)

## Ratings

No reviews have been submitted yet.

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

[See all reviews](https://wordpress.org/support/plugin/kehai-analytics/reviews/)

## Contributors

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

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/kehai-analytics/)