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

# Tracking Script

Learn about the Conversion tracking script, which tracks page visit data on your website.

## Installation

Copy and paste the following JavaScript snippet into the `<HEAD>` section of your website. Then, save and publish your website.

```javascript theme={null}
<script src="https://p.conversion.ai" defer></script>
```

<Info>
  Learn more about [GDPR compliance](/product-docs/gdpr/overview) with the Conversion tracking script
</Info>

***

## How It Works

The tracking script allows Conversion to track page visit history, even for anonymized visitors. The Conversion tracking script collects and saves information such as UTM parameters and browser information.

### Conversion `trackingId`

Conversion uses first-party cookies to store a `trackingId` per website visitor in browser storage. When a visitor identifies themselves either through filling out a form or clicking on a link in a marketing email, the `trackingId` is tied to their contact record.

### Storage keys

The tracking script sets the following first-party storage keys. All contain random IDs only (no personal data) and are used for visit and attribution analytics.

| Key          | Type                     | Purpose                                                                   | Lifetime                    |
| ------------ | ------------------------ | ------------------------------------------------------------------------- | --------------------------- |
| `_s__t`      | First-party cookie       | Anonymous visitor ID (random UUID) used to recognize returning visitors.  | 1 year                      |
| `_s__s`      | First-party cookie       | Anonymous session ID (random UUID) used to group activity within a visit. | 1 year                      |
| `_s__s__set` | Browser `sessionStorage` | Temporary flag marking the session as active. Not a cookie.               | Cleared when the tab closes |

### Example

Here is an example scenario the tracking script would track:

<Steps>
  <Step title="LinkedIn ad click">
    A prospect clicks on a LinkedIn ad and gets brought to your website. The prospect then visits the "Solutions" page before closing the browser tab.
  </Step>

  <Step title="Visit blog">
    The same prospect opens up their browser and visits your blogs page.
  </Step>

  <Step title="Fills out form">
    The prospect decides to fill out a form on your website, identifying themselves with an email address.

    <Note>
      Once the prospect fills out the form, a [contact is created](https://docs.conversion.ai/product-docs/forms/contact-creation) in Conversion. At this moment the previous blog page visit, "Solutions" page visit, and LinkedIn ad click are tied to this contact.

      The contact is also now associated with this browser via the `trackingId`, so future page visits will also be linked to this contact.
    </Note>
  </Step>
</Steps>
