# Отправка события о просмотре страницы

Метод используется для single-page application для реализации корректного подсчёта статистики. В код страницы необходимо добавить вызов метода trackPageview для созданного экземпляра счетчика в те моменты, когда необходимо отправлять события показа страницы. Опционально можно передать url страницы. Если url не передан, то счетчик сам его возьмет из location.href (без учета хэш). Если нужно учитывать хэши, то необходимо активировать [учет хэшей](/top100-documentation/nastroika-sbora-i-otpravki-dannykh/veb-schyotchik/uchet-kheshei.md)

```
top100Counter.trackPageView("URL");
```

**URL** (опциональный) - url web страницы, например, "<https://rambler.ru>"

#### Примеры вызова в коде страницы метода:

```
window.top100Counter.trackPageview();
```

```
window.top100Counter.trackPageview('https://rambler.ru');
```


---

# 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://top-100-writer.gitbook.io/top100-documentation/nastroika-sbora-i-otpravki-dannykh/veb-schyotchik/metody-po-rabote-s-schyotchikom-top-100/otpravka-sobytiya-o-prosmotre-stranicy.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.
