Skip to content
Getting started

Install the Captivar Tracker on Your Client's Website

One script tag installs Captivar's visitor tracker on any website — WordPress, Webflow, Squarespace, Shopify, custom HTML. The full step-by-step install.

Last updated · Jun 24, 2026

The Captivar tracker is one line of HTML. When a visitor loads a page on the client’s website, the tracker fires, identifies the visitor, records the session, and starts feeding data into your dashboard. This article walks through installing it on the most common platforms and confirming the first visitor arrives.

What the tracker does

Before you paste anything, it helps to know what’s actually getting installed.

The tracker is a small JavaScript bundle served from https://app.captivar.com/t/tmp.js. When it loads on a page, it reads the site’s tracking ID, generates or reuses a visitor cookie, and starts a session. Every page view is sent to Captivar in real time. So are scroll milestones, time on page, exit URL, and any custom events the client’s site fires.

The tracker is async — it never blocks the page from rendering. If Captivar is unreachable, the tracker fails silently. The client’s website never breaks because of it.

What the tracker captures by default:

  • A unique visitor ID (cookie-stored, 1 year)
  • A session ID (cookie-stored, regenerated after 30 minutes of inactivity)
  • URL, page title, referrer
  • UTM parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content)
  • Browser, operating system, screen size, language
  • Approximate location (country, region, city) via IP geolocation
  • Time on page and scroll depth (captured on unload)

What the tracker does not capture:

  • Anything the visitor types into a form, unless the form is a Captivar form
  • Mouse movements, clicks on arbitrary page elements, or session recordings
  • Personally identifying information beyond what the visitor explicitly submits

Before you start

You’ll need two things:

  • The site’s tracking ID. From the Captivar dashboard, open Sites, click the site, and copy the tracking ID at the top (it looks like TMP-XW6Q1733). If you haven’t added the site yet, do that first — Add Your First Client Site covers it.
  • Access to the client’s website. Either you can edit the site directly, or you can hand the install instructions to whoever can. The install is one HTML tag — no CSS changes, no JavaScript framework knowledge required.

The universal install

This works on any platform that lets you edit raw HTML — WordPress (via plugin or theme), Webflow, Squarespace, plain HTML, React, Vue, Shopify, Wix, Ghost. Paste this once, into the <head> of every page, replacing TMP-XXXXXX with the actual tracking ID:

<script async src="https://app.captivar.com/t/tmp.js?id=TMP-XXXXXX"></script>

That’s the entire install. The tracker handles everything else.

Platform-specific instructions

The universal install above works everywhere, but each platform has a more polished way of doing it. Pick the one that matches the client’s site.

WordPress

  1. Open the WordPress admin. Go to Appearance → Theme File Editor, or use a plugin like Insert Headers and Footers or WPCode for the same result without editing theme files.

  2. Find the right insertion point. If editing the theme directly, open header.php and locate the closing </head> tag. With a plugin, open its settings and find the “Scripts in Header” field.

  3. Paste the script tag. Insert the Captivar script just above </head> (or into the plugin’s Header field). Save the file.

  4. Clear caches. If the site uses a cache plugin (WP Rocket, W3 Total Cache, etc.) or a CDN, purge them. Otherwise the script may not show up on cached pages for hours.

Webflow

  1. Open Project Settings. Click the gear icon in the top bar, then go to Custom Code.

  2. Paste into Head Code. Paste the Captivar script tag into the Head Code field (not the Footer Code field).

  3. Save and publish. Webflow only applies custom code after publishing — clicking Save by itself is not enough. Publish the site.

Squarespace

  1. Open Settings → Advanced → Code Injection. Available on Business plans and above. The Personal plan does not allow custom code injection.

  2. Paste into the Header field. Paste the Captivar script into the Header (not Footer) code injection box.

  3. Save. Squarespace applies custom code immediately on save — no separate publish step needed.

Shopify

  1. Open the theme editor. Go to Online Store → Themes, click Actions on your active theme, then Edit Code.

  2. Open theme.liquid. Find this file in the Layout section. It contains the global header and footer for every page.

  3. Insert before </head>. Locate </head> near the top of the file and paste the Captivar script tag just above it. Save.

Custom HTML / React / Vue / static sites

Paste the script tag directly into your HTML template’s <head>. For React and Vue applications, the tag belongs in the root index.html template, not in a component — components mount after the head is parsed, so a tracker installed via component code can miss the initial page load.

Google Tag Manager

If the client uses GTM, you can install Captivar as a tag without touching the site’s code:

  1. Create a new tag in GTM. Pick Custom HTML as the tag type.

  2. Paste the script tag. Drop the full Captivar script tag into the HTML field. Make sure “Support document.write” is OFF (Captivar does not use document.write).

  3. Set the trigger. Use the built-in “All Pages” trigger so the tag fires on every page load.

  4. Submit the container. Publish the GTM container. Allow up to 60 seconds for propagation.

Verifying the install

The dashboard’s Live page is the fastest way to confirm the tracker is working. Open the client’s site in a private/incognito window, navigate to a page, then watch Live in the dashboard.

If the tracker is firing correctly, within 5-10 seconds you should see:

  • A visitor card appear with country and device info
  • The page they’re viewing
  • An active session indicator

If nothing shows up after 30 seconds, the tracker is not loading. Skip to the troubleshooting section below.

You can also verify by opening the client’s site in a normal browser, opening DevTools (F12), and checking the Network tab. Filter on app.captivar.com. You should see two requests on every page load:

  1. tmp.js — the tracker bundle (200 OK, served once and cached)
  2. /t/collect — the pageview event (200 OK, fired on every page load)

If tmp.js 404s, the script tag has the wrong URL or the page’s CSP is blocking it. If tmp.js loads but /t/collect never fires, the tracking ID in the script tag is wrong.

Troubleshooting

The tracker loads but no visitors show up

Most common cause: ad-blocker installed in your browser. Captivar’s tracker is on common ad-blocker lists. Try a clean private window with no extensions to verify.

Second most common cause: the visitor matches an IP exclusion you configured during site setup. Open the site’s Settings → Excluded IPs and confirm your test IP is not on the list. Or toggle “Include internal traffic” in the dashboard view filter to see internal visits.

The tracker doesn’t load at all

The most common cause is a Content Security Policy on the client’s site that blocks third-party scripts. Look in DevTools’ Console for an error like Refused to load the script 'https://app.captivar.com/t/tmp.js' because it violates the following Content Security Policy directive.

Fix: the client’s site must add https://app.captivar.com to the script-src directive in its CSP header. The exact line depends on what their CSP looks like, but typically it goes from script-src 'self' to script-src 'self' https://app.captivar.com.

Some visitors are recorded but most aren’t

The tracker is async and fires after the page begins rendering. On extremely slow connections or pages with very fast bounces, a small percentage of visitors leave before the tracker fires. This is normal across all analytics platforms — typically 2-5% loss.

If you’re seeing significantly more than that, check whether the tracker is being installed in the <body> instead of <head>. Body installs delay the first event until after the entire DOM parses, which increases drop-off.

Custom events aren’t being captured

You can fire custom events from the client’s site by calling window.tmp('event', 'event_name', { metadata }). The tracker exposes this global once it finishes loading. If you call it before the tracker is ready, the event is dropped silently.

Wrap custom event calls in a guard:

if (window.tmp) {
  window.tmp('event', 'demo_button_clicked', { source: 'hero' })
}

Or use the queue pattern — every call before the tracker loads is queued and replayed once it’s ready:

window.tmp = window.tmp || function() { (window.tmp.q = window.tmp.q || []).push(arguments) }
window.tmp('event', 'demo_button_clicked', { source: 'hero' })

What happens next

You have the tracker installed and the first visitor has arrived. The dashboard’s Overview page begins filling in — visitor counts, sessions, top pages, traffic sources. The Live page shows real-time activity. The Visitors page is now populated with individual journeys.

That’s the foundation. Now you can layer the rest of the platform on top.

The single most valuable next step is configuring the AI receptionist. It’s the difference between recording what visitors do and converting them while they’re there.

Keep reading
Start free — no card needed