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

# Tracking Blocking

> Block tracking scripts in screenshots

## Tracking Blocking

Block tracking scripts, web bugs, and information collectors from running during screenshot capture.

## Basic usage

<CodeGroup dropdown>
  ```bash bash theme={null}
  curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&blockTracking=true" \
    --output screenshot.png
  ```

  ```typescript typescript theme={null}
  const params = new URLSearchParams({
    key: 'YOUR_API_KEY',
    url: 'https://example.com',
    blockTracking: 'true'
  });

  await fetch(`https://api.domshot.com/shot?${params}`)
    .then(res => res.blob())
    .then(blob => fs.writeFile('screenshot.png', blob));
  ```

  ```php php theme={null}
  $params = [
    'key' => 'YOUR_API_KEY',
    'url' => 'https://example.com',
    'blockTracking' => 'true'
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://api.domshot.com/shot?' . http_build_query($params));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  $result = curl_exec($ch);
  file_put_contents('screenshot.png', $result);
  curl_close($ch);
  ```

  ```go go theme={null}
  package main

  import (
      "net/http"
      "net/url"
  )

  func main() {
      params := url.Values{}
      params.Set("key", "YOUR_API_KEY")
      params.Set("url", "https://example.com")
      params.Set("blockTracking", "true")

      resp, _ := http.Get("https://api.domshot.com/shot?" + params.Encode())
      defer resp.Body.Close()

      // Save response to file
  }
  ```
</CodeGroup>

## What gets blocked

| Type                   | Examples                      |
| ---------------------- | ----------------------------- |
| Web bugs               | Invisible tracking pixels     |
| Tracking scripts       | Analytics scripts             |
| Information collectors | Fingerprinting scripts        |
| Beacons                | Telemetry and data collection |

## Combining with other blocking

Tracking blocking works alongside ad and banner blocking:

<CodeGroup dropdown>
  ```bash bash theme={null}
  curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&blockAds=true&blockTracking=true&blockBanners=true" \
    --output screenshot.png
  ```

  ```typescript typescript theme={null}
  const params = new URLSearchParams({
    key: 'YOUR_API_KEY',
    url: 'https://example.com',
    blockAds: 'true',
    blockTracking: 'true',
    blockBanners: 'true'
  });

  await fetch(`https://api.domshot.com/shot?${params}`)
    .then(res => res.blob())
    .then(blob => fs.writeFile('screenshot.png', blob));
  ```

  ```php php theme={null}
  $params = [
    'key' => 'YOUR_API_KEY',
    'url' => 'https://example.com',
    'blockAds' => 'true',
    'blockTracking' => 'true',
    'blockBanners' => 'true'
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://api.domshot.com/shot?' . http_build_query($params));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  $result = curl_exec($ch);
  file_put_contents('screenshot.png', $result);
  curl_close($ch);
  ```

  ```go go theme={null}
  package main

  import (
      "net/http"
      "net/url"
  )

  func main() {
      params := url.Values{}
      params.Set("key", "YOUR_API_KEY")
      params.Set("url", "https://example.com")
      params.Set("blockAds", "true")
      params.Set("blockTracking", "true")
      params.Set("blockBanners", "true")

      resp, _ := http.Get("https://api.domshot.com/shot?" + params.Encode())
      defer resp.Body.Close()

      // Save response to file
  }
  ```
</CodeGroup>

See also:

* [Ad Blocking](/guides/content/ad-blocking) - Block advertisements
* [Cookie Banner Blocking](/guides/content/cookie-blocking) - Block cookie consent banners

## Parameters

| Parameter       | Type    | Default | Description              |
| --------------- | ------- | ------- | ------------------------ |
| `blockTracking` | boolean | `false` | Enable tracking blocking |
