# Test, debug and troubleshoot the web trackers
> Test and debug your web tracker implementation using Snowplow Inspector, Snowplow Micro, and the debugger plugin.
> Source: https://docs.snowplow.io/docs/sources/web-trackers/testing-debugging/
> Documentation index: https://docs.snowplow.io/llms.txt

To prevent data loss and bad events, it's important to test and validate your tracking implementation. Snowplow provides two main tools for this, which work well together.

## Snowplow Inspector for browsers

Use our [browser extension](/docs/testing/snowplow-inspector/) to inspect event requests in the browser Developer Tools window.

## Snowplow Micro

A [lightweight Snowplow pipeline](/docs/testing/snowplow-micro/) ideal for sending test events into. You can [deploy it through Console](/docs/testing/snowplow-micro/console/) or [run it locally](/docs/testing/snowplow-micro/local/) via Docker.

## Debugger plugin

The debugger plugin logs detailed information about tracked events to your browser's Developer Tools console. For each event, it displays:

- Event type
- Schema information for self-describing events and entities
- All entities attached to the event
- The complete event payload sent to the Collector

The plugin uses color-coded output to distinguish between different types of information, making it easier to scan through logged events.

> **Note:** You may need to enable **Verbose** logs in your Developer Tools console, as this plugin uses `console.debug` to output results.

![Browser Developer Tools console showing color-coded debugger plugin output for a tracked event, including the event name, attached context entities, and the full payload sent to the Collector](/assets/images/Screenshot-2021-03-28-at-20.08.35-ca0922b97b07198a894a3627e34ff92b.png)

### Install plugin

**JavaScript (tag):**

| Tracker Distribution | Included |
| -------------------- | -------- |
| `sp.js`              | ❌        |
| `sp.lite.js`         | ❌        |

**Download:**

|                                             |                                                                                                         |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| Download from GitHub Releases (Recommended) | [Github Releases (plugins.umd.zip)](https://github.com/snowplow/snowplow-javascript-tracker/releases)   |
| Available on jsDelivr                       | [jsDelivr](https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-debugger@4.10.2/dist/index.umd.min.js) |
| Available on unpkg                          | [unpkg](https://unpkg.com/@snowplow/browser-plugin-debugger@4.10.2/dist/index.umd.min.js)               |

**Note:** The links to the CDNs above are pinned to a specific version at the time of writing. Check the [plugin's GitHub releases](https://github.com/snowplow/snowplow-javascript-tracker/releases) for newer versions, and update the pinned version when you upgrade.

```javascript
window.snowplow('addPlugin',
  "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-debugger@4.10.2/dist/index.umd.min.js",
  ["snowplowDebugger", "DebuggerPlugin"]
);
```

**Browser (npm):**

- `npm install @snowplow/browser-plugin-debugger`
- `yarn add @snowplow/browser-plugin-debugger`
- `pnpm add @snowplow/browser-plugin-debugger`

```javascript
import { newTracker } from '@snowplow/browser-tracker';
import { DebuggerPlugin } from '@snowplow/browser-plugin-debugger';

newTracker('sp1', '{{collector_url}}', {
   appId: 'my-app-id',
   plugins: [ DebuggerPlugin() ],
});
```

***

### Configuration

The `DebuggerPlugin` function accepts an optional `logLevel` parameter that controls the verbosity of console output.

**JavaScript (tag):**

```javascript
window.snowplow('addPlugin',
  "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-debugger@4.10.2/dist/index.umd.min.js",
  ["snowplowDebugger", "DebuggerPlugin"],
  [3] // Log level: 3 = debug (default)
);
```

**Browser (npm):**

```javascript
import { newTracker } from '@snowplow/browser-tracker';
import { DebuggerPlugin } from '@snowplow/browser-plugin-debugger';
import { LOG_LEVEL } from '@snowplow/tracker-core';

newTracker('sp1', '{{collector_url}}', {
   appId: 'my-app-id',
   plugins: [ DebuggerPlugin(LOG_LEVEL.debug) ],
});
```

***

The available log levels are:

| Level   | Value | Description                                         |
| ------- | ----- | --------------------------------------------------- |
| `none`  | 0     | Disables all logging                                |
| `error` | 1     | Logs errors only                                    |
| `warn`  | 2     | Logs errors and warnings                            |
| `debug` | 3     | Logs errors, warnings, and debug messages (default) |
| `info`  | 4     | Logs all messages                                   |
