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

# Validate your events

> Check your click and conversion tracking implementation and make sure you get the most value.

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

Events unlock Algolia's most powerful features.
If you need background on how events work,
see [Click and conversion events](/doc/guides/sending-events).
If you still need to choose an implementation path,
see [Choose how to send events](/doc/guides/sending-events/getting-started).
This page describes tools and methods to check your implementation for errors.

## Browser developer tools

To check your frontend implementation,
use your browser's built-in developer tools.

* [Chrome DevTools](https://developer.chrome.com/docs/devtools/open/)
* [Firefox DevTools](https://firefox-source-docs.mozilla.org/devtools-user/)
* [Safari developer tools](https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/mac)

### Check the search-insights library

Open the **Network** tab of your browser's developer tools and check that the `search-insights` library loads without errors.

<img src="https://mintcdn.com/algolia/JoMDf1PtMFIqKpzx/images/validating-events/insights-loads.png?fit=max&auto=format&n=JoMDf1PtMFIqKpzx&q=85&s=5670bf770fc5c28bc99fc81514c162d8" alt="Chrome DevTools network tab shows the search insights library loads correctly with a status 200" width="602" height="170" data-path="images/validating-events/insights-loads.png" />

Open the **Console** and run:

```js JavaScript icon=code theme={"system"}
window.aa;
```

If the `search-insights` library loads, you should see:

```js JavaScript icon=code theme={"system"}
ƒ (){(t.aa.queue=t.aa.queue||[]).push(arguments)}
```

If the `search-insights` library isn't loaded, you'll see `undefined` as output.

### Check the user token

To check if the `userToken` or `authenticatedUserToken` is set,
open the **Console** and run:

```js JavaScript icon=code theme={"system"}
// For anonymous user tokens
window.aa("getUserToken", null, (_, token) => console.log(token));

// For authenticated user tokens
window.aa("getAuthenticatedUserToken", null, (_, token) => console.log(token));
```

You should see the current user token as an output.

If you're using the cookie-based anonymous `userToken` from the `search-insights` library,
open the **Application** tab of your browser's developer tools (**Storage** in Firefox or Safari) and go to **Cookies**.

The `search-insights` library stores the generated `userToken` in the `_ALGOLIA` cookie.

<img src="https://mintcdn.com/algolia/JoMDf1PtMFIqKpzx/images/validating-events/insights-cookie.png?fit=max&auto=format&n=JoMDf1PtMFIqKpzx&q=85&s=9f5e5239e10e570888fd80b7ac50d588" alt="The browser developer tools show the Algolia cookie with an anonymous user token" width="500" height="70" data-path="images/validating-events/insights-cookie.png" />

For more information, see [User token](/doc/guides/sending-events/concepts/usertoken).

### Test sending an event to the Insights API

You can send a test event from your browser's developer tools.
For example, to send a view event, open the **Console** and run:

```js JavaScript icon=code theme={"system"}
window.aa("viewedObjectIDs", {
  eventType: "view",
  eventName: "Test View Event",
  index: "TestIndex",
  objectIDs: ["test-object"],
});
```

You shouldn't see an error in the console.
To check the corresponding API request, open the **Network** tab
and check for the POST request to the Insights API.

<img src="https://mintcdn.com/algolia/JoMDf1PtMFIqKpzx/images/validating-events/insights-request.png?fit=max&auto=format&n=JoMDf1PtMFIqKpzx&q=85&s=3dc5b5c5ae17ca6e503e252c15b8ec9e" alt="The network tab in the browser developer tools shows the Post request to the Insights API" width="500" height="70" data-path="images/validating-events/insights-request.png" />

If the status is `200`, the API request was successful.
Check the [debugger](#debugger) in the Algolia dashboard to see how the event was received by the Insights API.

<Info>
  In the Chrome browser, you might see a warning in the **Console**:
  Cross-Origin Read Blocking (CORB) blocked cross-origin response.
  This isn't an error and doesn't prevent the event from being sent.
  When testing, you can ignore this warning.
</Info>

## Events health

The [**Events health**](https://dashboard.algolia.com/events/health) page lets you check the status of your event tracking at a glance.
Follow these steps to get to the Events health page:

1. Go to the [Algolia dashboard](https://dashboard.algolia.com/explorer/browse) and select your Algolia <Application />.
2. On the left sidebar, select <Icon icon="database" /> **Data sources**.

The Events health page displays a card for each feature that requires event data to function optimally.
On each feature card, you'll see a **Manage** link and a status bar that alerts you to any event issues.

If there are errors, review and fix them as soon as possible to ensure the feature works correctly.
Potential issues are warnings that may suggest problems with your event tracking setup.

<img src="https://mintcdn.com/algolia/JoMDf1PtMFIqKpzx/images/validating-events/events-health.png?fit=max&auto=format&n=JoMDf1PtMFIqKpzx&q=85&s=476e5fc122c4f3b47715ba477a566a3e" alt="Screenshot of the 'Events Health' section showing event status and categories like 'A/B Testing' and 'Analytics' with issue statuses." width="1670" height="848" data-path="images/validating-events/events-health.png" />

If a feature has errors or potential issues, click its status bar to open the [debugger](#debugger).
The debugger shows only the events that won't be used for that feature:
it helps you check that you're sending the correct events for the feature.

### Debugger

The **Events collected** section of the debugger page displays the number of events received by the Insights API up to 90 days ago.
These numbers are approximate and can take up to 30 minutes to update.

The debugger, which can be found in the **Debug events collected** section, shows the livestream of your events as the Insights API receives them.
Your most recent 3000 events appear in this table.

<img src="https://mintcdn.com/algolia/JoMDf1PtMFIqKpzx/images/validating-events/events-debugger.png?fit=max&auto=format&n=JoMDf1PtMFIqKpzx&q=85&s=52d6b3c88a3d48697261fae7112f617b" alt="Events debugger in the Algolia dashboard with a table of incoming events." width="1326" height="587" data-path="images/validating-events/events-debugger.png" />

Use the search box or click the
**Filter events** button to filter the list of events.
For example, enter `httpCode=422` in the search box to show only the events with the HTTP status code `422`.

If the debugger doesn't show any events even though you're sending them, check that you're not using an ad blocker.
Turn off your ad blocker and reload the page.

#### Destinations

In the debugger, you can check the properties of the events,
which user agent sent each event,
and the number of [Algolia features](/doc/guides/sending-events/concepts/event-types#events-by-features) that can consume each event.
You can view more details about where events are used on the [**Details**](#event-details) panel.

#### Event details

Select any event in the Events debugger to see its details.

<img src="https://mintcdn.com/algolia/JoMDf1PtMFIqKpzx/images/validating-events/events-debugger-details.png?fit=max&auto=format&n=JoMDf1PtMFIqKpzx&q=85&s=9e9f7f193a0ef3e078f2a0fe57a9cdd7" alt="Event details for a valid event without errors. The list of attributions show that the event can be used with all Algolia features." width="544" height="614" data-path="images/validating-events/events-debugger-details.png" />

You can check the following details:

* **Event Validity.** If there are errors, such as a missing `userToken` parameter, or if you use a number instead of a string as a parameter value, you can see the error message under **Errors**.
  Under **Destinations**, you can see where the event can be used. Events with the status **Warning** can't be used in all Algolia features. For more information, see [Event types](/doc/guides/sending-events/concepts/event-types).
* **HTTP Data.** Details about the HTTP request sending the event, such as the referrer, user agent, and Insights library version.
* **User Timeline.** A list of events sent by the same user.
* **Query Details.** If the event includes a [query ID](/doc/guides/sending-events/guides/queryid), you can see the associated Search API request with the matching query ID.
