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

# Any other website

> Add pagent to any website by pasting one snippet into the head of every page.

On any website, pagent goes into the `<head>` of every page. If your pages share a template or layout file, you only need to add it once there.

Copy your pagent snippet. You find it in the install step after you start your trial, and any time later in pagent under **Settings → Setup**. It looks like this, with your own client key:

```html theme={"dark"}
<script
  src="https://cdn.pagent.ai/js/sdk.js"
  data-client-key="YOUR_CLIENT_KEY">
</script>
```

Paste it unchanged. Don't add `async`, `defer` or `type="module"`: pagent needs to load before your page shows, so visitors never see the original flash.

## Add the snippet to your pages

**1. Open your page template**

Open the HTML of each page, or the shared template or layout file your pages use.

**2. Paste the snippet early in the head**

Paste your snippet as early as possible inside `<head>`: right after `<meta charset="…">`, before your stylesheets and other scripts.

**3. Publish**

Upload or deploy the change to your live site.

```html theme={"dark"}
<head>
  <meta charset="utf-8">
  <script
    src="https://cdn.pagent.ai/js/sdk.js"
    data-client-key="YOUR_CLIENT_KEY">
  </script>
  <!-- your stylesheets and other scripts -->
</head>
```

Building with a framework such as Next.js, Nuxt or SvelteKit? See [Frameworks](https://www.pagent.ai/docs/install/frameworks.md).

## Check it worked

1. Open your site in a private browser window, so no cached version shows.
2. Back in pagent, click **Check connection** in the install step. If you've finished setup already, open **Settings → Setup**: it shows **You are ready** once pagent has received visits from your site.
3. pagent loads your live site and looks for the snippet. When it finds it, you can start your first test.

> [!TIP]
>
> pagent couldn't find the snippet? Make sure you published or saved the change on your live site, then check again. If you installed it through Google Tag Manager, open your site once in a normal browser window first.


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