Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/instrument/view-tracking.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/instrument/view-tracking/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
View tracking
Note
The view tracking instrumentation is available as of Grafana Faro Web SDK version 1.0.0-beta6.
The view tracking instrumentation reports the change of the view meta as an event. This is useful for RUM because you can track when a new view is set.
For example, you can set the following different views for an application:
- The register and login pages can be considered
authviews - The homepage page can be considered a
homeview - The users listing and user profile pages can be seen as
usersviews
Using the view tracking instrumentation, you can correlate errors, logs, and events that occurred for a particular user when using a particular section of the application.
In order for the view tracking instrumentation to work correctly, the view meta should be set accordingly.
How to use the view tracking instrumentation
The following view tracking instrumentation is enabled by default. No additional configuration is required.
initializeFaro({
url: 'https://my-domain.my-tld/collect/{app-key}',
app: {
name: 'my-app',
},
});Note
If you overwrite the
instrumentationsarray when you initialize the Grafana Faro Web SDK, you must manually include the View tracking instrumentation.
To manually include the view instrumentation, use the following getWebInstrumentations helper function.
initializeFaro({
url: 'https://my-domain.my-tld/collect/{app-key}',
app: {
name: 'my-app',
},
instrumentations: [...getWebInstrumentations()],
});Alternatively, if you want to fine-tune which instruments are enabled, you can use the following ViewInstrumentation class.
initializeFaro({
url: 'https://my-domain.my-tld/collect/{app-key}',
app: {
name: 'my-app',
},
instrumentations: [new ViewInstrumentation()],
});Was this page helpful?
Related resources from Grafana Labs


