Page Events
Page event tracking allows you to include additional metadata about your users when they visit a specific page on your website. This feature is useful for segmenting users based on their state, such as whether they are logged in or which color theme they have selected.
Usage
Enable Tracker
First, ensure that the page event tracking feature is enabled in your dashboard settings. Navigate to the Tracker section and check the box for Page View Events.
Attach HTML Data Attributes
By including the data-m:load
HTML attribute on any element on the page, you can automatically include additional metadata for each page visit. This attribute should be a key-value pair in the format key=value
that will be sent with the event.
The following example demonstrates how to attach custom properties on page load:
In this example, { "theme": "dark", "subscription": "paid", "logged_in": "true" }
will be attached to the page load event. Multiple properties can be separated by semi-colons.
You can set these attributes statically or dynamically based on the user’s state or any other relevant information.
View Events
Once the tracking code is updated on your website, you can view the custom properties in the event list on your dashboard. Each event will include the custom properties attached to the page view, allowing you to filter and segment your data based on these properties.