# Tracking 404 Pages

{% hint style="info" %}
You can not tell if a page did load or showed 404 just by viewing the visited pages list.

You might want to know if users land on a page that renders your 404 content.&#x20;
{% endhint %}

To get better insights, we can:

1. Create a 404 Tag, so we can easily filter those sessions.
2. Create a 404 Event, so we can see which page triggered the 404 error.

Include this JavaScript snippet in your 404 page template.

{% code title="File: 404.html" fullWidth="false" %}

```html
<!-- After the tracker is included -->
<script>
UST.addTag('404-page-not-found');
UST.addEvent({
    category: 'ERROR',
    action: '404_NOT_FOUND',
});
</script>
```

{% endcode %}

The end result will be something like this:

<figure><img src="/files/qpYT32ADBJU6qWJ8e1KG" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uxwizz.com/useful-examples/tracking-404-pages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
