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

# Snitcher

> Identify website visitors and track sessions with Snitcher

Snitcher is a website visitor identification platform that reveals which companies are visiting your website and tracks their browsing sessions. The Cargo integration enables you to sync visitor data and search sessions.

## Authentication

There are two ways to connect Snitcher to Cargo:

### Bring your own API key

If you already have a Snitcher account, connect using your API key. This gives you full control over your Snitcher workspace and billing.

| Field       | Description           |
| ----------- | --------------------- |
| **API key** | Your Snitcher API key |

You can find your API key in the [Snitcher dashboard](https://app.snitcher.com) under **Settings > API**.

### Use Cargo credits

If you don't have a Snitcher account, you can use Cargo credits instead. Cargo will automatically create and manage a Snitcher workspace for you — no API key required.

***

## Setting up the tracking script

To identify companies visiting your website, you need to install the Snitcher tracking script on your site. This script collects anonymous visitor data that Snitcher uses to match visits to companies.

### Step 1: Create a data model

1. In Cargo, create a new data model using the **Snitcher** integration
2. Select the **Fetch organisations** extractor
3. Choose your workspace (if using your own API key) or enter the website URL you want to track (if using Cargo credits)
4. Save the data model

### Step 2: Copy the tracking script

Once the data model is created, Cargo displays the tracking script snippet in the model settings. The script looks like this:

```html theme={null}
<script>
  !(function (s, n, i, t, c, h) {
    s.SnitchObject = i;
    s[i] ||
      (s[i] = function () {
        (s[i].q = s[i].q || []).push(arguments);
      });
    s[i].l = +new Date();
    c = n.createElement(t);
    h = n.getElementsByTagName(t)[0];
    c.src = "//snid.snitcher.com/YOUR_TRACKING_ID.js";
    h.parentNode.insertBefore(c, h);
  })(window, document, "snid", "script");

  snid("verify", "YOUR_TRACKING_ID");
</script>
```

`YOUR_TRACKING_ID` will be replaced with the actual tracking ID assigned to your workspace.

### Step 3: Install the script on your website

Add the tracking script to every page you want to track. Place it in the `<head>` section of your HTML, or use your tag manager.

<AccordionGroup>
  <Accordion title="Direct HTML" icon="code">
    Paste the script inside the `<head>` tag of your website's HTML:

    ```html theme={null}
    <head>
      <!-- Other head tags -->
      <script>
        !(function (s, n, i, t, c, h) {
          s.SnitchObject = i;
          s[i] || (s[i] = function () { (s[i].q = s[i].q || []).push(arguments); });
          s[i].l = +new Date();
          c = n.createElement(t);
          h = n.getElementsByTagName(t)[0];
          c.src = "//snid.snitcher.com/YOUR_TRACKING_ID.js";
          h.parentNode.insertBefore(c, h);
        })(window, document, "snid", "script");
        snid("verify", "YOUR_TRACKING_ID");
      </script>
    </head>
    ```
  </Accordion>

  <Accordion title="Google Tag Manager" icon="tag">
    1. Open [Google Tag Manager](https://tagmanager.google.com)
    2. Create a new **Custom HTML** tag
    3. Paste the tracking script into the HTML field
    4. Set the trigger to **All Pages**
    5. Publish the container
  </Accordion>

  <Accordion title="Next.js / React" icon="react">
    Add the script using the Next.js `Script` component or a regular `<script>` tag in your layout:

    ```jsx theme={null}
    import Script from "next/script";

    export default function Layout({ children }) {
      return (
        <html>
          <head />
          <body>
            {children}
            <Script
              id="snitcher-tracking"
              strategy="afterInteractive"
              dangerouslySetInnerHTML={{
                __html: `
                  !(function (s, n, i, t, c, h) {
                    s.SnitchObject = i;
                    s[i] || (s[i] = function () { (s[i].q = s[i].q || []).push(arguments); });
                    s[i].l = +new Date();
                    c = n.createElement(t);
                    h = n.getElementsByTagName(t)[0];
                    c.src = "//snid.snitcher.com/YOUR_TRACKING_ID.js";
                    h.parentNode.insertBefore(c, h);
                  })(window, document, "snid", "script");
                  snid("verify", "YOUR_TRACKING_ID");
                `,
              }}
            />
          </body>
        </html>
      );
    }
    ```
  </Accordion>
</AccordionGroup>

### Step 4: Verify the installation

Once the script is installed, visit your website and check back in Cargo after a few minutes. New visitor data should start appearing in your Snitcher data model. You can also verify the script is loading correctly by opening your browser's developer tools (Network tab) and looking for a request to `snid.snitcher.com`.

<Note>
  It may take up to 30 minutes for the first organisations to appear after installing the tracking script. Snitcher fetches new data incrementally every 30 minutes.
</Note>

***

## Snitcher actions

### Search sessions

Search and retrieve website visitor sessions with filtering options.

**Configuration**

| Field                 | Description                           |
| --------------------- | ------------------------------------- |
| **URL**               | The website URL you are tracking      |
| **Organisation UUID** | Filter by specific organization       |
| **Date from**         | Start date for filtering sessions     |
| **Date to**           | End date for filtering sessions       |
| **URL contains**      | Filter sessions by URL substring      |
| **Referrer contains** | Filter sessions by referrer substring |
| **Limit**             | Maximum records to retrieve           |

***

## Data models

### Fetch organisations

Track companies that visit your website.

**Configuration**

| Field         | Description              |
| ------------- | ------------------------ |
| **Workspace** | The workspace to track   |
| **URL**       | The website URL to track |

**Data returned**

Each organization includes company details, website, and visit metrics.

### Fetch sessions

Track individual website sessions and visitor activity.

**Configuration**

| Field   | Description                      |
| ------- | -------------------------------- |
| **URL** | The website URL you are tracking |

***

## Credits

| Action/Extractor    | Cost                 |
| ------------------- | -------------------- |
| Search sessions     | Free                 |
| Fetch organisations | 3 credits per record |
| Fetch sessions      | Free                 |

***

## Use cases

<AccordionGroup>
  <Accordion title="Account-based marketing" icon="bullseye">
    Identify target accounts visiting your website and trigger campaigns.
  </Accordion>

  <Accordion title="Session analysis" icon="chart-line">
    Understand visitor behavior by analyzing session data.
  </Accordion>

  <Accordion title="Lead scoring" icon="star">
    Boost lead scores based on website engagement patterns.
  </Accordion>
</AccordionGroup>

***

## Best practices

1. **Install the script on all pages** - The more pages you track, the better Snitcher can identify visitor intent
2. **Track high-value pages** - Pay special attention to visitors on pricing, demo, or product pages
3. **Use date filters** - Filter sessions to analyze specific time periods
4. **Combine with CRM data** - Match visitor data with existing account records
