Docs
← Back to site

Install and set up

4 min readUpdated November 18, 2026

Setup takes about 15 minutes: install the plugin, choose a tracking domain, give it a Cloudflare token, and it builds your platform for you. After that you add websites (see Websites & tracking).

1. Install and activate the plugin#

  1. In WordPress, go to Plugins › Add New › Upload Plugin, choose nahnu-analytics-<version>.zip and click Install Now.
  2. Click Activate. A Nahnu Analytics menu appears in wp-admin.
  3. Go to Platform › License, paste the license key from your purchase email and click Activate. Updates now come through Dashboard › Updates like any other plugin.
Platform › License with a key activated

To use the license on another WordPress later, click Deactivate first. That frees the activation.

2. Choose your tracking domain#

The tracking domain is where your clients’ websites load the tracking script from and send their visits to. Use a subdomain on a domain you own, for example go.youragency.com or cdn.youragency.net.

  1. Go to Settings › Tracking.
  2. Under Tracking domain, type the domain without https:// and without a path.
  3. Click Save.

The plugin also makes script names: a random file name for the script and a random path for visits, such as /k/x7b2m9.js. They contain no word an ad blocker looks for. If a name you type contains such a word (like analytics or track), the screen gives you a heads-up.

Settings › Tracking with the tracking domain, script names and the snippet preview

Pick a domain name without the words analytics, stats, metrics or track if you can. The big ad-block lists allow them on your own domain, but some smaller blockers do not.

3. Create a Cloudflare API token#

The plugin builds everything in your Cloudflare account with an API token you create.

  1. Go to Platform › Cloudflare. The page shows the steps and a button to Cloudflare.
  2. In Cloudflare, open My Profile › API Tokens, choose Create Token, then Create Custom Token.
  3. Add these permissions:
ScopePermissionNeeded for
AccountWorkers Scripts: EditRequired
AccountWorkers KV Storage: EditRequired
AccountD1: EditRequired
AccountAccount Analytics: ReadRequired
AccountWorkers R2 Storage: EditOptional: long-term history and backups
ZoneZone: ReadRequired
ZoneDNS: EditRequired
ZoneWorkers Routes: EditRequired
ZoneTransform Rules: EditRequired
  1. Under Account Resources, choose your account. Under Zone Resources, choose the zone of your tracking domain.
  2. Create the token and copy it.
  3. Back in WordPress, paste it under Paste it here and click Check token.

The plugin checks each permission and shows a green dot for each one it has. A missing permission is named, so you can edit the token in Cloudflare and check again.

Platform › Cloudflare: Check access, with a green dot for each permission the token has

The token is encrypted and stays on your server. You can have it forgotten once setup finishes, or keep it in wp-config.php instead of the database:

define( 'NAHNU_ANALYTICS_CF_TOKEN', 'your-cloudflare-token' );

A saved token lets the platform update by itself and makes domain changes one click. Without one, you are asked for a token each time.

4. Choose where to keep the data#

Before building, choose Where to keep the data:

  • Nearest to visitors. Cloudflare chooses, usually where most visits come from.
  • European Union only. For GDPR: the database, each website’s stats and the backups are stored only in Cloudflare’s EU data centers.

This cannot be changed later for data already stored. To change it afterwards, use Move the platform (Maintenance & help).

5. Build the platform#

Click Build platform. The page shows each step as it runs:

  1. Token verified
  2. KV namespace created
  3. D1 database created
  4. Database tables ready
  5. R2 bucket for history (skipped if the token has no R2 permission)
  6. Private connection key created
  7. Edge Worker deployed
  8. Domain on your Worker
  9. Health check
  10. Connector secrets kept per website
  11. Regions and cities for client sites
  12. Website script settings published

It takes one to three minutes. You can leave the page: setup keeps going in the background. A step that fails says why and offers Try again.

Building the platform on Cloudflare, the steps ticking off

If the Cloudflare account already has a Nahnu Analytics platform (from a WordPress you used before), setup says This account already has a platform and offers Link to this platform instead of building a new one. Linking keeps every website counting. See Moving to a new WordPress in Maintenance & help.

6. Check that it works#

When setup finishes, Platform › Cloudflare shows your tracking domain, the resources it made and Live on Cloudflare with the platform’s version. Go to All sites and add your first website (Websites & tracking).

Platform › Cloudflare once the platform is live: tracking domain, resources, version, updates and usage

Was this helpful?