Skip to content
Docs
Getting started

Install the tag

Add one script to your site so tests can run on it and results can be counted.

On this page 4

The tag is a small script you add to your site once. It shows each visitor their version of a page and records what they do. Nothing else works until it is in place.

You copy it from Project settings, on the Install tab. That tab has a short guide for each way a site is built, with your script already in it. Once the tag is on your site, you check it on the Domains tab, which is also where you list the web addresses it runs on.

Most people ask a developer for ten minutes, or paste it themselves if they can edit the site's template.

Guide Use it when
HTML You can edit the template or layout your pages share.
Tag Manager You add scripts through Google Tag Manager and cannot edit the template.
WordPress Your site runs on WordPress.
Shopify Your store runs on a Shopify theme.
Next.js Your site is a Next.js app.

Pick HTML if you can edit your template, because it starts the script earliest. The Next.js guide gives you a slightly different script, which is explained under Good to know.

How to set one up

  1. Open Project settings, then the Install tab.
  2. Under Install the script, choose how your site is built.
  3. Follow the numbered steps in the guide. Where a step shows a code box, press Copy and paste it where the step says.
  4. Publish the change on your site.
  5. Open the Domains tab and press Verify beside your domain. If your domain is not on the list yet, add it first: Add your domain.
Warning

Paste all of the script, unchanged, in the head of the page and as high as you can. Lower down, the browser has already drawn the page by the time the script runs, so visitors in a test see the original page before their own.

What each label means

Label What it means
Install the script The card with the guides. Once any of your domains is verified, its corner says Found on and that domain.
HTML, Tag Manager, WordPress, Shopify, Next.js The guides. Choosing one changes the steps shown below it and nothing else.
Single-page app Shown on the Next.js guide. Its script tells the tag your site moves between pages without reloading.
App Router, Pages Router The two ways a Next.js app can be set up. Pick the one your app uses to see where the script goes.
Copy Copies the code box beside it, with your project already filled in.
Go to Domains Opens the Domains tab, where each domain is verified.
Send it to a teammate Emails whoever edits your site the script, the domains it goes on and the steps. They do not need an account.
Send script Sends that email to the address you typed.
Verify, Check again On the Domains tab. Fetches that domain's home page and checks the tag is there.
Verified On a domain's row. Everything is in place.
Not verified yet Nobody has checked this domain. Press Verify.
Snippet not found Nothing on that page loads the tag. Check you pasted it into the right template and published it.
Snippet is not in the head The tag loads too late to change the page before a visitor sees it. Move it into the head.
Only half the snippet is there Part of the script is missing. Copy it again and paste the whole thing.
Could not reach the site The page did not answer. We cannot check a page behind a login, a firewall or a password.

Good to know

  • The script is the same on every domain in the project, so you copy it once.
  • Your project's key is inside the script. It is not a secret: it tells the script which project it belongs to, and anyone can read it in your page source.
  • Verify reads one page, your home page. Paste the tag into the layout or theme header your pages share, then open the page you plan to test and look for the script in its page source.
  • Tag Manager starts the script after the page has begun to show, so a visitor in a test can see the original for a moment first.
  • In an app that changes pages without reloading, the Next.js script starts a test when a visitor moves to its page. A change to something that stays on screen, such as a menu, can stay visible after they leave the test's page, until the app redraws it or the page reloads. A split URL test still sends the visitor to its address with a full page load.
  • Shopify's checkout and thank-you pages do not load your theme, so the script cannot run there.
  • If your site sends a Content Security Policy, the tag needs one more step: Content Security Policy.
  • Could not reach the site does not mean the tag is broken. It means we could not look. Check a private site yourself by looking for the script in the page source.