More in Getting started
- Install TapCub on your website
- Migrate from Google Analytics 4 or Baidu Tongji
- Add a website, app or mini-program
- How do I add TapCub to Shopify?
- Where do I paste the TapCub tracking code?
- Can I install TapCub with Google Tag Manager?
- How do I track a React, Vue or Next.js app?
- How do I check that TapCub is collecting data?
- Why does TapCub show no data after I installed it?
- What is a site, and how many can I add?
- Which time zone should I pick for a site?
- Which domains do I need to register?
- How do I keep my own visits out of the reports?
- Why does my visitor count differ from Google Analytics 4?
- Can I run TapCub alongside Google Analytics 4?
- How do I move my goals and events from GA4?
- Can I import my historical data from GA4?
- How do I add TapCub to Squarespace?
- How do I add TapCub to Wix?
- Which Content Security Policy rules does TapCub need?
- Do ad blockers block TapCub?
- How do I send events from my server?
- How do I install TapCub on React?
- How do I install TapCub on Nuxt?
- How do I install TapCub on Vue?
- How do I install TapCub on Next.js?
- How do I capture a HAR file for TapCub support?
- How do I create and manage API keys?
- How do I send events with the HTTP API?
- All guides in this category
Still have a question?
Could not find it? A person reads every message, usually within a few hours on business days.
Chat with usShort 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:
<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
- 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.
- 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.
- 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:
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.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.