More in Getting started
Still have a question?
Could not find it? A person reads every message, usually within a few hours on business days.
Chat with usBefore you start
You need a TapCub account and a site created in the console. If you have not created one yet, follow Add a site first — it takes about two minutes and gives you the site key used below.
You also need to be able to edit the template that renders every page of your website, or the "custom code" area of your site builder. Nothing is installed on your server.
Add the script
Open Web analyticsConfigurationSDK code and copy the snippet shown there. It already contains your site key. It looks like this:
index.html
<script async src="https://app.tapcub.com/w.js" data-site="YOUR_SITE_KEY"></script>Paste it before the closing </head> tag on every page. The script is about 2 KB gzipped and loads asynchronously, so it never blocks rendering. It sends a pageview on the first load and on later in-site URL changes.
- Register the hostname. On the same SDK code page, add the domain visitors use, without
https://or a path. Subdomains are allowed. Hits from an unregistered host are dropped silently. - Paste the snippet. One copy per page. If a page ends up with two copies, only the first one runs.
- Deploy and open the site. Open a page on the registered hostname in a normal browser tab. A local file opened with
file://does not send.
Site builders and CMS
There is no plugin to install. Every site builder has a place for site-wide header code, and the snippet goes there once:
| Platform | Where to paste |
|---|---|
| WordPress | Theme header (header.php) or a "header scripts" box in your theme or a header-code plugin. Once in the global template, not per post. |
| Shopify | theme.liquid, inside <head>. The platform-hosted checkout does not run theme scripts, so checkout pages are not tracked by this tag. |
| Webflow / Wix / Squarespace | Site settings → custom code → head. Use the site-wide field, not the page-level one. |
| Hugo, Hexo, Jekyll, Ghost, Typecho | The shared head partial of the theme. |
| Next.js, Nuxt, Vue, React | The root layout or app shell. Single-page apps are covered — the script listens for route changes. If your router uses # URLs, add data-hash="true" to the tag. |
If your theme caches rendered HTML, clear that cache after you change the header, or the old pages keep serving without the tag.
Verify the first visit
Open Web analyticsRealtime in one tab and load your site in another. The pageview should appear within a few seconds with the same path and title.
If it does not, open the browser's network panel and check two requests in order:
w.jsloaded. If it is missing, the tag is not in the page, or a browser extension blocked it.- A POST to
/api/v1/pulse. If the script loaded but no POST follows, the browser stopped the request (see below). If the POST exists but Realtime is empty, the hit was dropped on our side — most often because the hostname is not registered.
202 for stored and dropped hits. A 202 proves the request arrived, not that it was counted. Realtime is the only proof.Common install problems
| What you see | Likely cause and fix |
|---|---|
| Script loads, no POST | The browser sent Do Not Track or Global Privacy Control. TapCub honors both by default and the script returns immediately. Test in a browser without those flags. |
| No POST, console shows a CSP error | Your Content-Security-Policy must allow script-src and connect-src for the TapCub origin. Chat, identity and autocapture load from the same directory. |
| POST exists, Realtime empty | Hostname not registered, site paused, monthly quota used up, or an exclusion rule matched. Check the SDK code page and plan usage. |
| Works on production, not locally | localhost does not send by default. Register it only while testing. |
| Single-page app counts one pageview | Hash routing needs data-hash="true". Frameworks that replace history.pushState late may need the tag earlier in the head. |
Still empty after these checks? Send us the page URL and a screenshot of the network panel through the contact page; that is usually enough to find it in one reply.
What to turn on next
- Enable live chat on the same snippet — a switch, not a second script.
- Keep your current analytics running for a week and follow the migration guide.
- Decide on cookieless vs identified collection before you send real traffic.
- Install the SDKs for apps and mini-programs if you have them; each gets its own site key.