---
title: "HitKeep WordPress Analytics Integration Guide | HitKeep"
description: "Install the first-party HitKeep WordPress plugin, choose EU/US Cloud or self-hosting, load hk.js, and track redirect links with scoped API tokens."
canonical: "https://hitkeep.com/guides/integrations/wordpress/"
---

# HitKeep WordPress Analytics Integration Guide

The HitKeep WordPress plugin adds privacy-first analytics to WordPress without editing your theme, using a tag manager, or adding a second analytics backend. Choose EU Cloud, US Cloud, or a self-hosted HitKeep URL, then the plugin loads the normal cookie-free `hk.js` tracker for that site.

WordPress.org plugin

Install HitKeep Analytics from the public WordPress plugin directory: [https://wordpress.org/plugins/hitkeep/](https://wordpress.org/plugins/hitkeep/).

## What the plugin does

The plugin is a thin WordPress adapter around HitKeep’s existing tracker:

```
WordPress page -> hk.js -> HitKeep /ingest and /ingest/event -> DuckDB
```

It does not create WordPress analytics tables, set analytics cookies, or send traffic to a third-party CDN. The configured HitKeep instance receives the same pageview and automatic event payloads as the manual snippet: `outbound_click`, `file_download`, and `form_submit`. Optional redirect tracking can also send server-side `outbound_click` events after WordPress resolves supported short-link or affiliate redirects.

For AI visibility on a WordPress site, treat the plugin as the browser side only. It can record AI-referred human visits, but AI crawler fetches still need server-side forwarding from CloudFront, nginx, Caddy, an app server, or another log source.

![HitKeep WordPress settings screen with connection mode cards, tracking toggles, redirect tracking, and a snippet preview](https://hitkeep.com/_astro/wordpress-plugin-settings.Ca85dNG3_ZqVQiy.webp)

Settings > HitKeep keeps the instance connection, privacy defaults, automatic event coverage, optional redirect tracking, and generated snippet preview in one WordPress-native screen.

## Install the plugin

Install [HitKeep Analytics from WordPress.org](https://wordpress.org/plugins/hitkeep/) in WordPress:

1. Open **Plugins -> Add New Plugin**.
2. Search for **HitKeep Analytics**.
3. Install and activate **HitKeep Analytics**.
4. Open **Settings -> HitKeep**.

![WordPress plugins screen showing the HitKeep Analytics plugin installed and active](https://hitkeep.com/_astro/wordpress-plugin-listing.zzRZbbMB_1oTLwT.webp)

The plugin appears in the normal WordPress plugin list and can be activated, deactivated, or opened from the standard admin workflow.

## Configure HitKeep

Choose where your analytics should be sent:

- **EU Cloud:** loads `https://cloud.hitkeep.eu/hk.js`
- **US Cloud:** loads `https://cloud.hitkeep.com/hk.js`
- **Self-hosted or custom domain:** loads `hk.js` from the URL you enter

Use [HitKeep Cloud](https://hitkeep.com/pricing/) when you want WordPress analytics without managing TLS, upgrades, backups, SMTP, or the HitKeep data directory. Use [self-hosted HitKeep](https://hitkeep.com/guides/installation/) when the deployment requirement is to run the single Go binary and keep the embedded DuckDB data under your own infrastructure boundary.

For self-hosted installs, enter the public HitKeep URL:

```
https://analytics.example.com
```

If HitKeep is mounted below an existing site, include the path prefix:

```
https://www.example.net/hitkeep
```

Do not include `/hk.js`. The plugin appends that path automatically. If you paste a URL ending in `/hk.js`, the plugin normalizes it back to the base URL while preserving any path prefix, so `https://www.example.net/hitkeep/hk.js` becomes `https://www.example.net/hitkeep`.

For subdirectory installs, the HitKeep instance and reverse proxy must serve `hk.js`, `hk-vitals.js`, `/ingest`, and `/ingest/web-vitals` under the same prefix. See [Public URL path prefixes](https://hitkeep.com/reference/configuration/#public-url-path-prefixes/) for the matching HitKeep server configuration.

Use **Open configured HitKeep instance** from the current tracker card when you want to jump from WordPress to the selected EU Cloud, US Cloud, or self-hosted HitKeep instance.

Add your WordPress domain to your HitKeep instance without a leading `www.`. HitKeep matches public tracker requests by the browser `Origin` hostname.

## Defaults

The plugin starts with conservative defaults:

| Setting | Default |
| --- | --- |
| Logged-in WordPress users | Not tracked |
| Do Not Track | Respected |
| Pageviews | Tracked |
| SPA route changes | Tracked |
| Outbound link events | Tracked |
| File download events | Tracked |
| Form submit events | Tracked |
| Web Vitals | Not tracked |
| Redirect link events | Not tracked |

Enable **Track logged-in WordPress users** only if you want editors, admins, or members to appear in analytics.

## Tracker options

The WordPress settings map directly to `hk.js` data attributes:

| WordPress setting | Tracker attribute |
| --- | --- |
| Collect when the browser sends Do Not Track | data-collect-dnt="true" |
| Disable sendBeacon delivery | data-disable-beacon="true" |
| Disable SPA route tracking | data-disable-spa-tracking="true" |
| Disable outbound link events | data-disable-outbound-tracking="true" |
| Disable file download events | data-disable-download-tracking="true" |
| Disable form submit events | data-disable-form-tracking="true" |
| Enable Web Vitals | data-enable-web-vitals="true" |

Use these options when a WordPress site needs a narrower tracking surface than the default HitKeep browser tracker.

Automatic event payloads use the same privacy-safe properties as the manual snippet. HitKeep strips query strings and hashes and does not capture link text, form field values, or request bodies.

Web Vitals are opt-in. When enabled, the tracker loads same-origin `hk-vitals.js` and reports LCP, INP, CLS, FCP, and TTFB without attribution/debug fields.

## Redirect and affiliate links

Browser tracking can only see the link the visitor clicked. It cannot know the final affiliate or short-link destination after WordPress resolves a redirect. Enable **Track redirect links** when you want HitKeep to record supported redirect clicks as outbound links after the target is known.

The current WordPress plugin detects BetterLinks, PrettyLinks, ThirstyAffiliates, and other redirects that call `wp_redirect`. Same-site redirects are ignored. HitKeep stores the short path and resolved target host/path, with source, referrer, and target query strings stripped before delivery.

Redirect tracking uses HitKeep’s trusted server-side event ingest endpoint, so WordPress needs an API client token with `site.manage_data` for the site. In the token field, use **Create token in HitKeep** to open the selected instance’s API client screen, or read the [API Clients guide](https://hitkeep.com/guides/security/api-clients/) for the permission model. Paste the token into WordPress and save. The token stays server-side and is not printed into public page source.

![HitKeep WordPress server ingest API token field with links to create an API client token and read the API client guide](https://hitkeep.com/_astro/wordpress-plugin-server-token.ChXDh6Cp_Z1m2WmP.webp)

The redirect tracking token field links to the selected HitKeep instance’s API client screen and asks for a site-scoped token with `site.manage_data`.

## Related

- [API Clients](https://hitkeep.com/guides/security/api-clients/)
- [Server-Side Tracking](https://hitkeep.com/guides/tracking/server-side-tracking/)
- [Google Analytics Alternative for WordPress](https://hitkeep.com/use-cases/google-analytics-alternative-wordpress/)
- [WordPress Privacy Analytics](https://hitkeep.com/use-cases/wordpress-analytics/)
- [Privacy-First Web Analytics](https://hitkeep.com/use-cases/privacy-first-web-analytics/)
- [Cookieless Event Tracking](https://hitkeep.com/use-cases/cookieless-event-tracking/)
- [Tracker Architecture](https://hitkeep.com/guides/tracking/tracker-architecture/)
- [Automatic Events](https://hitkeep.com/guides/tracking/automatic-events/)
- [Web Vitals Analytics](https://hitkeep.com/guides/analytics/web-vitals/)
- [Custom Events](https://hitkeep.com/guides/tracking/custom-events/)
- [AI Visibility Analytics](https://hitkeep.com/guides/analytics/ai-visibility/)
- [AI Fetch Ingest](https://hitkeep.com/guides/tracking/ai-fetch-ingest/)
- [AI Fetch on AWS](https://hitkeep.com/guides/tracking/ai-fetch-aws/)
- [PECR and ePrivacy](https://hitkeep.com/compliance/pecr-eprivacy/)

[Previous Google Search Console](https://hitkeep.com/guides/integrations/google-search-console/)[Next Signed webhooks](https://hitkeep.com/guides/integrations/webhooks/)
