# Install the analytics script

> Add the Checkend snippet, verify the domain and check the first visit.

## Add the snippet

1. In Checkend, add your site.
2. Copy its snippet.
3. Paste it in the `<head>` of every page.
4. Deploy your site.

The snippet has this form:

```html
<script defer data-domain="example.com" data-verify="YOUR_SITE_KEY" src="https://app.checkend.com/s.js"></script>
```

Use the snippet from your account, because the key is different for each site.

For WordPress, use a plugin that adds code to the header, for example WPCode.

## Verify the domain

> **Caution**
> Checkend does not store events until the domain is verified.

The first visit starts a check of your home page. The check looks for the key in the HTML of `https://your-domain/`.

If a tag manager adds the snippet, the key is not in that HTML. Use a DNS record:

| Field | Value |
| --- | --- |
| Type | `TXT` |
| Name | Your domain, or `_checkend.your-domain` |
| Value | `checkend-verify=YOUR_SITE_KEY` |

Then click **Check now** in the settings of the site.

## What the script counts

- Pageviews, also when a single-page app changes the path.
- Clicks on links to other sites, as `Outbound Link: Click`.
- Your [custom events](/docs/events.md).

A change of only the query or the `#` part of an address is not a new pageview.

## Visits that are not counted

- Bots that Checkend recognizes, and automated browsers.
- Pages on localhost. Add `data-allow-localhost` to the script to send events from localhost.
- The excluded IP addresses in the settings of the site.
- A browser in which you set `localStorage.checkend_ignore = 'true'` on your site.

## Prompt for a coding agent

```text
Install Checkend web analytics on this site.
1. Ask me for the snippet of the site from my Checkend account. Do not make up the site key.
2. Find the root layout or the template of the head element.
3. Add the snippet one time, so that it is on every page and in the HTML of the home page.
4. Show me the change. Stop before you deploy and wait for my approval.
```
