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

# HTML / CDN

> Add InfiniteWatch session replay to any website with a single script tag

## Overview

The simplest way to add InfiniteWatch to your website — just drop in a script tag. No build tools, no npm install, no configuration files.

## Installation

Add the following script tag at the end of your HTML `<head>` section, before the closing `</head>` tag:

```html theme={null}
<script async
  src="https://unpkg.com/@infinitewatch/web-core@^1/dist/watch.js"
  data-iw-organization-id="YOUR_ORGANIZATION_ID">
</script>
```

<Info>
  Replace `YOUR_ORGANIZATION_ID` with your actual organization ID. You can find this in your [InfiniteWatch dashboard](https://app.infinitewatch.ai/dashboard/settings).
</Info>

That's it — the script loads asynchronously and starts recording sessions automatically.

## Using Google Tag Manager

If you prefer to load InfiniteWatch via Google Tag Manager, use this snippet instead:

```html theme={null}
<script>
  window.__IW_CONFIG__ = {
    organizationId: "YOUR_ORGANIZATION_ID"
  };
</script>

<script async src="https://unpkg.com/@infinitewatch/web-core@^1/dist/watch.js"></script>
```

## Identify Users

After the tracker is initialized, you can associate sessions with specific users using the `identify()` method:

```javascript theme={null}
InfiniteWatch.identify({
  external_id: 'user-12345'
});
```

With additional user information:

```javascript theme={null}
InfiniteWatch.identify({
  external_id: 'user-12345',
  email: 'user@example.com',
  full_name: 'John Doe',
  metadata: {
    plan: 'premium',
    signup_date: '2024-01-15'
  }
});
```

<Note>
  Call `identify()` after the user logs in. The `external_id` is persisted in a cookie so it carries across page reloads and sessions.
</Note>

## How It Works

Once the script is added, InfiniteWatch will automatically:

* Record user sessions and interactions
* Capture DOM events, mouse movements, and clicks
* Generate web insights data
* Send data to your InfiniteWatch dashboard

<Note>
  The script loads asynchronously, so it won't block your page load.
</Note>
