> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rankraft.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Website snippet

> One line in your site's head to count visitors who arrive from AI answers.

The website snippet counts people who arrive from ChatGPT, Perplexity and other AI answers. Crawlers don't run JavaScript, so it can't see them. For crawlers, use [Cloudflare](/agent-analytics/integrations/cloudflare-worker) or [send your server logs](/agent-analytics/integrations/server-logs).

**Sees:** AI referrals.

## Install

Paste this line into your site's `<head>`, replacing `YOUR_SITE_KEY` with your key from **Integrations**:

```html theme={"system"}
<script async src="https://ingest.rankraft.ai/rankraft.js" data-site-key="YOUR_SITE_KEY" data-endpoint="https://ingest.rankraft.ai"></script>
```

### Where to paste it

| Site builder | Where | Notes |
| - | - | - |
| Shopify | Online Store → Themes → ⋯ → Edit code → `layout/theme.liquid` | Paste it on the line just before `</head>`, then Save. |
| Webflow | Site settings → Custom code → Head code | Save, then publish your site. Custom code needs a paid site plan. |
| Wix | Settings → Custom code → Add Custom Code | Choose **All pages** and place it in **Head**. Needs a premium plan and a connected domain. |
| Squarespace | Settings → Developer tools → Code injection → Header | Save. Code injection needs a Core plan or higher. |
| Framer | Site settings → General → Custom code → End of `<head>` tag | Save, then publish. |
| Ghost | Settings → Code injection → Site header | Save. |
| Anything else | Your site's main layout or template | Paste it just before `</head>` so it loads on every page. |

## Options

| Attribute | Required | Description |
| - | - | - |
| `data-site-key` | Yes | Your site key. |
| `data-endpoint` | No | Defaults to `https://ingest.rankraft.ai`. |
| `data-honor-dnt` | No | Set to `"true"` to send nothing when the browser has Do Not Track enabled. |

## How it behaves

* Sends **one** small request per page load: the hostname, path, query string, referrer and time.
* Loads asynchronously and never throws errors into your page.
* Sets **no cookies** and stores nothing in the browser.
* The visitor's IP address, user agent and country are read by RankRaft AI from the request itself, never from the page, so they can't be forged from the browser.
* Visits that aren't from an AI engine are counted toward your daily totals and not stored individually.

<Tip>
  The site key in the snippet is visible to anyone who views your page source. That is expected. Data is only accepted for your site's [allowed hostnames](/agent-analytics/integrations/site-data-controls#allowed-hostnames).
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.