Page load events
Glean can automatically collect an event on each page load. The default values that are captured are:
- url:
window.location.href
- referrer:
document.referrer
- title:
document.title
Automatic page load events
You can turn on automatic page load events by adding a value in the Glean initialize configuration.
Page load event API
Glean.js provides an API for manually collecting page load events.
When to use the GleanMetrics.pageLoad
API
- You want to trigger page loads with custom data overrides.
- You are using a framework that doesn’t truly reload pages on navigation, like React.
Usage
Try it out
To see automatic page load events in action, check out our interactive playground.