> For the complete documentation index, see [llms.txt](https://docs.roivenue.com/roivenue-resources/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roivenue.com/roivenue-resources/howto/roivenue-measurement-implementation/implementation-through-gtm/custom-pageviews-tracking.md).

# Custom Pageviews Tracking

This is a more detailed page about how capturing page views works in Roivenue Measurement and how to customize it.

## General Behavior

By default, the page\_view event is captured every time on the first load of our script and every time a page\_view event is being pushed into dataLayer.&#x20;

* This works fine in most scenarios - f.e. when a user makes steps in checkout process without full page reloads, you push the page\_view event to dataLayer and Roivenue Measurement captures it even when the page did not change.&#x20;
* But if you have a page\_view event on every page in dataLayer after page is loaded **and you do not have a single page application**, it will cause a duplication of page views in Roivenue. This can be easily solved by removing ‘page\_view’ from event\_types in the roivenue.tracking.config variable. If you then want to track additional page views, you can still do so by calling.\
  \
  `dataLayer.push({ ‘event’: ‘roivenue_measurement_event', ‘type’ : 'page_view’})`
* If you for some don’t want to track page\_view automatically after page is loaded, you can disable autocapture in roivenue.measurement.config by adding: `"autocapture" : false`

## Single Page Applications

* If you have a single page website you need to inform us about page views by pushing `page_view` event into the `dataLayer`.
  * `dataLayer.push({'event' : 'page_view'});`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.roivenue.com/roivenue-resources/howto/roivenue-measurement-implementation/implementation-through-gtm/custom-pageviews-tracking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
