TapCub is live — analytics, insights and live chat, free on one platform
Help center

How do I add TapCub to WordPress?

Two ways to put the snippet on every WordPress page, plus the caching and “delay JavaScript” settings that most often hide the first visit.

Getting started2 min readLast updated Oct 28, 2026TapCub teamPart of Install TapCub on your website

Short answer

Paste the TapCub snippet once into a site-wide header field: a header-code plugin, or a wp_head hook in a child theme. There is no TapCub plugin to install.

Get your snippet

Copy your snippet from Web analyticsConfigurationSDK code. It already contains your site key and looks like this:

SDK code
<script defer src="https://static.pathclue.com/client.js" data-site="YOUR_SITE_KEY"></script>

Make sure the domain visitors use is listed on the same page. Subdomains of a listed domain are accepted automatically; hits from any other host are dropped.

Option 1: a header-code plugin

  1. Install a header and footer code plugin. Any plugin that adds code to every page works, for example WPCode. Many themes also have a “header scripts” box under their own settings.
  2. Paste the snippet into the site-wide header field. Use the global header, not a per-post or per-page field, so every page carries the tag.
  3. Save, then clear your page cache. See the caching note below.

Option 2: a child theme

If you maintain a child theme, add the tag through the wp_head hook in its functions.php. This works for classic and block themes, and survives parent theme updates:

functions.php
add_action( 'wp_head', function () {
  echo '<script defer src="https://static.pathclue.com/client.js" data-site="YOUR_SITE_KEY"></script>';
} );

Do not edit the parent theme’s header.php directly: the next theme update overwrites it. Block themes have no header.php at all.

Caching and script optimisation

Caching plugins keep serving the old HTML until you clear the cache, so a freshly added tag may not appear for a while. Clear it once after saving.

Some performance plugins can delay JavaScript until the visitor interacts with the page. With that on, visitors who read and leave without scrolling or clicking are never counted. Add client.js to the plugin’s exclusion list. Combining or minifying it into another file is not needed; it is already small and loads with defer.

Confirm it works

Open your site in a normal browser window, not one where you are testing a privacy extension, and watch Web analyticsRealtime. The visit appears within a few seconds. If it does not, check that data is arriving step by step.

Editors browsing the front end while logged in are counted like any visitor. Exclude your own visits under exclusion rules. The admin area (/wp-admin) does not load the front-end header, so it is never tracked.

Did this answer your question?

We use your answers to fix and expand this page.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics