Browser History Change Event
The browser history change event monitors the browser history API for changes in navigation for single-page applications (SPA).
Requirements
- utag v4.38 or later. For more information about updating the
utag.js
template, see our knowledge base article Best Practices for Updating to the Latest Version of utag.js. - The page or app uses
history.pushState()
andhistory.replaceState()
functions in the browser’s history API for navigation.
How it works
The browser history change event listener monitors the functions history.pushState()
and history.replaceState()
in the browser’s history API. These two functions are used to manage navigation in SPA without full page reloads. When the visitor navigates to a new page within the app or goes back, the tracking call is triggered.
For more information about how to add an event listener, see Manage events.
Event triggers
Event triggers are the actions the event listener tracks.
History change
This event is triggered by the browser change history.
Identifier | Description |
---|---|
tealium_event="history_change" |
The visitor navigated to a new page within the app or went back a page. |
Event trigger variables
Event trigger variables are the values the event sends with the tracking call. This event has the following default variables:
Variable | Description | Example | Type |
---|---|---|---|
tealium_event |
Tealium event name. | history_change |
String |
iq_event_id |
The UID of the event listener that sent the event. | history_change_events_1 |
String |
Example
{
"tealium_event" : "history_change",
"iq_event_id:" : "history_change_events_1"
}
This page was last updated: July 23, 2024