---
title: "JavaScript SDK: Track pages"
description: "Track the pages your customers visit with the Gleap JavaScript SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/411-javascript-sdk-track-pages
collection: "JavaScript"
updated: 2026-11-01
language: en
---

# JavaScript SDK: Track pages

Track the pages your customers visit with the Gleap JavaScript SDK. Follow the integration code examples.

The JS SDK tracks pages based on URL changes by default. If you want to customize the tracked pages you can do so by using the trackEvent() method below to track custom pages.

## Track a page

```javascript
Gleap.trackEvent("pageView", {
  page: "Example page",
});
```

You will be able to use the tracked pages as triggers in outbound messages as well as breadcrumbs for debugging.

## Related

- [JavaScript SDK setup](https://docs.gleap.ai/en/articles/393-javascript-sdk-setup.md)
- [JavaScript SDK: Code snippet](https://docs.gleap.ai/en/articles/394-javascript-sdk-code-snippet.md)
- [JavaScript SDK: User identity](https://docs.gleap.ai/en/articles/395-javascript-sdk-user-identity.md)
- [JavaScript SDK: Callbacks](https://docs.gleap.ai/en/articles/396-javascript-sdk-callbacks.md)
- [JavaScript SDK: AI chatbar](https://docs.gleap.ai/en/articles/397-javascript-sdk-ai-chatbar.md)
