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

# Tracking Snippet

> Configuring how the tracking snippet behaves.

The tracking snippet is a small piece of JavaScript code that you embed into your website to track visitor interactions. This document outlines how the tracking snippet works and how you can configure it.

## Installation

Your tracking snippet is hosted on your analytics server. To install it on your website, you need to include the following script tag in the `<head>` section of your website:

```html theme={null}
<script defer src="https://[your-analytics-server].com/script.js"></script>
```

## Configuration

The tracking snippet can be configured using the following options:

| Option      | Description                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------- |
| `data-api`  | Optional hostname + path to the analytics server. Default is the domain where the script is being hosted. |
| `data-hash` | Include this to track browser navigations for websites that use a hash router.                            |

Here's an example of a fully configured tracking snippet:

```html Example theme={null}
<script defer src="https://[where-your-script-is-hosted].com/script.js" data-api="[different-analytics-server].com/api/" data-hash></script>
```
