HitKeep Analytics

By Pascale

★ 5.0/5 (1 ratings)10+ active installationsVersion 0.4.0

Adds the first-party HitKeep tracker to WordPress without analytics cookies, third-party CDNs, or a tag manager.

Description

HitKeep Analytics connects WordPress to a self-hosted or cloud HitKeep instance. It injects the normal hk.js tracker from your HitKeep instance and keeps data flowing through the core HitKeep ingest pipeline.

View the actual HitKeep dashboard inside the WordPress HitKeep menu. Create a HitKeep Cloud account or sign in starting from WordPress, complete site setup and explicit consent, and return to your WordPress dashboard. WooCommerce is optional and uses its existing Action Scheduler for durable paid-order and refund delivery; the plugin adds no analytics database or required service.

Privacy-first web analytics for WordPress

HitKeep is built for teams that want useful web analytics without adopting a heavy analytics stack. Choose your HitKeep instance, connect with OAuth, approve the WordPress site, and select one of the tracking endpoints returned by HitKeep.

Logged-in WordPress users are skipped by default, so administrators and editors do not pollute public traffic reports. Browser Do Not Track is respected by default.

Features

  • EU Cloud, US Cloud, and self-hosted HitKeep options.
  • Cloud account creation and sign-in starting from WordPress.
  • Full read-only HitKeep dashboard inside WordPress, using a dedicated short-lived embed credential.
  • Optional WooCommerce product, cart and checkout funnel events, paid-order purchases and refunds; classic and Blocks checkout plus HPOS order storage.
  • Durable, idempotent purchase/refund delivery through WooCommerce Action Scheduler, with order-level delivery status and retry.
  • Separate opt-in for logged-in WooCommerce customers; existing logged-in and DNT exclusions remain the default.
  • OAuth 2.1 Authorization Code with mandatory PKCE; no copied API token or bundled client secret.
  • Authorized HitKeep site selector populated from the live integration API.
  • Default and active custom tracking-domain selector populated from HitKeep.
  • Logged-in WordPress users are skipped by default.
  • Do Not Track is respected by default.
  • Pageview tracking through HitKeep’s normal hk.js tracker.
  • Built-in HitKeep automatic events for outbound links, file downloads, and form submissions.
  • Optional Web Vitals reporting for LCP, INP, CLS, FCP, and TTFB.
  • Optional redirect click events for supported short-link, affiliate, and wp_redirect redirects through HitKeep’s server-side ingest API.
  • Automatic short-lived access-token refresh and rotating refresh-token revocation.
  • Self-hosted URLs may include a path prefix, such as https://www.example.net/hitkeep.
  • Clear opt-outs for sendBeacon delivery, route changes, outbound links, downloads, and forms.
  • Shortcut to open the configured HitKeep instance from the settings page.
  • Snippet preview so site owners can see which tracker attributes will be emitted.

What the plugin does not do

  • It does not set analytics cookies.
  • It does not create WordPress analytics tables.
  • It does not require a tag manager.
  • It does not load the tracker from a third-party CDN.
  • It does not collect form field values, request bodies, link text, or URL query strings through automatic events.
  • It does not ask administrators to create, copy, or paste API tokens.
  • It does not print OAuth access or refresh tokens into public page source.

Third-party service connection

This plugin connects to HitKeep. Depending on your settings, it loads JavaScript from and sends analytics data to one of these HitKeep hosts:

  • https://cloud.hitkeep.eu
  • https://cloud.hitkeep.com
  • Your own self-hosted HitKeep URL

HitKeep Cloud terms

HitKeep Cloud privacy policy

Self-hosted installations are controlled by your own HitKeep instance and infrastructure.

Connecting opens HitKeep’s OAuth consent flow and requests sites:read, tracking_domains:read, ingest:write, and analytics:read for the exact HitKeep API resource. WordPress publishes a small HTTPS Client ID Metadata Document so the installation acts as a public OAuth client without a client secret. Access and rotating refresh tokens are stored server-side. Disconnecting revokes the refresh-token family and removes local credentials.

Optional redirect link tracking sends server-side outbound click events from WordPress to the selected HitKeep instance when a supported redirect resolves to an external host. The current adapters support BetterLinks, PrettyLinks, ThirstyAffiliates, and other redirects that use wp_redirect. Redirect source, referrer, and target query strings are stripped before delivery.

Source code

The main HitKeep project is available on GitHub.

Installation

  1. Upload the plugin files to the /wp-content/plugins/hitkeep directory, or install the plugin through the WordPress plugins screen.
  2. Activate HitKeep Analytics from the Plugins screen.
  3. Open Settings -> HitKeep.
  4. Choose EU Cloud, US Cloud, or self-hosted and save the instance.
  5. For self-hosted HitKeep, enter the public URL of your HitKeep instance, such as https://analytics.example.com or https://www.example.net/hitkeep.
  6. Select Create a HitKeep Cloud account or Sign in and connect, complete initial site setup, and explicitly approve the team, sites, resource, and scopes.
  7. Select the authorized HitKeep site and its default or active custom tracking endpoint, then save.
  8. Open the HitKeep menu to view analytics inside WordPress. Existing connections can authorize dashboard access without disconnecting.
  9. Optionally enable WooCommerce or redirect link tracking. WooCommerce customers remain excluded while logged in until you explicitly enable the customer option.

OAuth, the embedded dashboard, and WooCommerce integration require HitKeep 2.17.0 or later, or a HitKeep Cloud deployment providing those APIs. Existing installations can keep their saved browser and server ingest connection until opting into OAuth.

The WordPress site must be publicly reachable over HTTPS so HitKeep can validate the installation’s Client ID Metadata Document. The fixed metadata path works with plain or pretty WordPress permalinks. HitKeep guides new Cloud accounts through initial site setup before consent.

For detailed setup guidance, see the HitKeep WordPress integration guide.

FAQ

Do I need a HitKeep account?

You need a HitKeep Cloud account or a self-hosted HitKeep instance. You can start Cloud account creation from the WordPress settings page.

Does the plugin set analytics cookies?

No. The plugin injects HitKeep’s normal hk.js tracker. The tracker does not set analytics cookies.

Are logged-in WordPress users tracked?

No, not by default. Enable Track logged-in WordPress users in the plugin settings if you want logged-in users to load the tracker.

Can I use this with self-hosted HitKeep?

Yes. Select Self-hosted or custom domain and enter the public URL of your HitKeep instance.

Can I use this when HitKeep is mounted under a subdirectory?

Yes. Enter the full public HitKeep URL, including the path prefix, such as https://www.example.net/hitkeep. The plugin preserves that prefix when it builds the hk.js tracker URL. Your HitKeep instance and reverse proxy must also serve hk.js, hk-vitals.js, and the ingest routes under the same prefix.

Which automatic events can HitKeep track?

The normal HitKeep tracker can automatically track outbound links, file downloads, and form submissions. Each of those can be disabled from the WordPress settings page.

Does automatic form tracking collect form fields?

No. HitKeep records the form action path and method. It does not collect field values or request bodies.

Can the plugin track Web Vitals?

Yes. Web Vitals are off by default. Enable Track Web Vitals when you want HitKeep to load the same-origin vitals bundle and report compact performance samples.

Can the plugin track short-link and affiliate redirects?

Yes. Connect WordPress with HitKeep OAuth, select the authorized site, and enable Track redirect links. When BetterLinks, PrettyLinks, ThirstyAffiliates, or another WordPress redirect resolves a short link to an external host through wp_redirect, HitKeep records a server-side outbound_click event with the short path and resolved target host/path. Same-site redirects are ignored, and source, referrer, and affiliate target query strings are not stored by default.

Why does OAuth require HTTPS on WordPress?

HitKeep uses a fixed WordPress index.php path as a Client ID Metadata Document. The OAuth specification requires that client-ID URL to use HTTPS, and HitKeep fetches and validates it before showing consent. This works independently of the permalink setting and removes the need to distribute a shared client secret or ask administrators to paste credentials.

Can I view analytics without leaving WordPress?

Yes. The HitKeep menu embeds the actual read-only HitKeep analytics dashboard for your selected site. Existing grants need explicit approval of analytics:read. General OAuth tokens stay on the WordPress server; only a dedicated short-lived read-only credential reaches the iframe in memory.

What WooCommerce data is sent?

Enable Track WooCommerce to send browser product/cart/checkout events and durable server purchases when orders become paid. Refunds use their own IDs, positive refund values and the original transaction ID. Currency and product IDs, quantities and prices are allowlisted. No customer names, emails, billing/shipping addresses, order keys, raw IP addresses or user agents are copied into background analytics jobs. DNT and logged-in exclusions are captured at checkout and preserved for delayed payments. Logged-in customers require a separate explicit opt-in.

How does background delivery recover?

WooCommerce Action Scheduler retries transient failures with stable event IDs and unchanged payloads. Delivery status and Retry HitKeep analytics delivery appear on each order. Events stay bound to their original site, instance and authorization; reconnecting or changing sites does not reroute them. Orders without captured checkout eligibility and zero-value orders/refunds are not backfilled. Inspect and retry unsent orders after disabling/re-enabling either plugin. Eligible checkout requests may attach the existing public hk.getSessionId() UUID through classic checkout or the registered Blocks Store API extension; purchases and refunds retain that original session. The UUID is validated and never manufactured. A missing tracker getter falls back to anonymous delivery. A present public getter that reports tracking blocked sends an explicit opt-out and prevents commerce delivery. Empty checkout attribution clears stale draft session IDs before payment. A compatible HitKeep server with anonymous server events, event-ID deduplication and refund reporting is required.

Where can I report issues?

Use the support channels listed on hitkeep.com.

Screenshots

Changelog

0.4.0

  • Refresh WordPress.org screenshots for the native dashboard, OAuth connection and consent, WooCommerce reporting, and order delivery status.
  • Show the native, read-only HitKeep analytics dashboard inside WordPress with site-bound, short-lived credentials kept separate from the server-side OAuth grant.
  • Add signup and site creation to the connection flow while retaining explicit team, site, and permission approval.
  • Add opt-in WooCommerce product, cart, and checkout events plus durable paid-order and refund delivery, stable retry IDs, and per-order delivery status.
  • Preserve checkout privacy choices, exclude customer details from commerce payloads, and keep queued events bound to their original site and connection.
  • Show dashboard authorization only after approval; keep older OAuth grants usable until the administrator chooses to authorize dashboard access.
  • Replace copied API client tokens with OAuth 2.1 Authorization Code and PKCE.
  • Publish a per-installation Client ID Metadata Document for secretless public-client registration.
  • Load authorized sites plus default and active custom tracking endpoints from HitKeep.
  • Use the selected returned script URL for browser tracking and the same API-resource grant for server-side redirect events.
  • Bind OAuth server-side redirect events to the selected HitKeep site while preserving legacy token payloads.
  • Rotate refresh tokens proactively and request revocation on disconnect.
  • Preserve legacy credentials, browser tracking, redirect settings, and the saved instance on upgrade and reactivation; remove legacy credentials only after OAuth and site discovery succeed or on explicit disconnect.
  • Preserve the previous connection when consent, token exchange, site discovery, or option persistence fails, including registered WordPress settings sanitizers.
  • Complete OAuth cutover and explicit legacy disconnect without the Settings API retaining the previous tracking destination.
  • Preserve tracking toggle choices when WordPress sanitizes the first settings save more than once, including unchecked controls and partial updates.
  • Test settings save, reload, and plugin lifecycle on WordPress 7.1.3; update Tested up to to 7.1.

0.3.5

  • Fix the Respect browser Do Not Track toggle not staying disabled after the first settings save.
  • Preserve existing toggle values during partial or programmatic settings updates.

0.3.4

  • Add optional server-side redirect link tracking for BetterLinks, PrettyLinks, ThirstyAffiliates, and other redirects that use wp_redirect.
  • Add a server ingest API token setup flow with saved-token status, token clearing, and links to create a site-scoped HitKeep API client token with site.manage_data.
  • Store server ingest tokens outside the public tracker snippet and keep them out of rendered page source.
  • Refresh WordPress.org screenshots and documentation for the redirect tracking and API client token flow.

0.3.3

  • Preserve default-on tracker toggles when the first settings save only changes the selected HitKeep instance.
  • Store explicit off values for settings toggles so later saves keep intentional opt-outs.

0.3.2

  • Improve links to HitKeep setup, source, terms, and privacy resources.

0.3.1

  • Declare compatibility with WordPress 7.0.

0.3.0

  • Preserve self-hosted HitKeep path prefixes such as /hitkeep when generating the tracker URL.
  • Normalize pasted tracker URLs such as https://www.example.net/hitkeep/hk.js without removing the deployment prefix.
  • Document subdirectory self-hosted setup alongside the Web Vitals option.

0.2.0

  • Add opt-in Web Vitals tracking from the settings page.
  • Add WordPress.org release assets and localized settings strings.

0.1.0

  • Initial first-party WordPress integration for HitKeep.