Quickstart
In your header or footer scripts, register a listener:*:
How it works
Awindow.standards object is initialized in the <head> of every published project, before any custom scripts run. This means your header scripts can call standards.on() immediately — no need to wait for a load or DOMContentLoaded event.
Events are emitted by the application after the page renders. All listeners registered by the time the page renders will receive events.
Event shape
Every event has the same structure:Events
page_view
Fired on initial page load and when the visitor navigates between pages.
| Property | Type | Description |
|---|---|---|
page_path | string | The path of the page viewed |
page_title | string | The title of the page viewed |
language | string | The locale code of the active language (e.g. en, fr, es) |
download_file
Fired when a visitor clicks a download link.
| Property | Type | Description |
|---|---|---|
file_id | string | The file’s unique ID |
file_name | string | The file’s display name |
file_type | string | The file extension (e.g. pdf, png) |
play_video
Fired when a visitor explicitly triggers video playback (click or hover). Not fired when a video autoplays on scroll.
| Property | Type | Description |
|---|---|---|
video_id | string | The video file’s unique ID |
video_title | string | The video’s alt text or file name |
change_slide
Fired when a visitor navigates slides in a Sequence or Toggle element. Not fired on autoplay transitions.
| Property | Type | Description |
|---|---|---|
slide_id | string | The slide element’s unique ID |
slide_title | string | The slide element’s name |
slide_index | number | The zero-based index of the new slide |
change_language
Fired when a visitor switches the project’s language.
| Property | Type | Description |
|---|---|---|
language | string | The locale code selected (e.g. en, fr, es) |
copy_hex_code
Fired when a visitor clicks a color swatch to copy its value.
| Property | Type | Description |
|---|---|---|
hex_code | string | The copied color value |
copy_share_link
Fired when a visitor clicks a share link button.
| Property | Type | Description |
|---|---|---|
share_link | string | The URL or text that was copied to the clipboard |
User identity
By default, events include only asession_id — a randomly generated UUID that persists for the browser session.
To include the visitor’s email, user_id, and ip in events, enable Include User Identity in the Custom Scripts settings. This only applies to projects that require a sign in to view. Public and password-protected projects do not have user identity data available.
Example
Forwarding to a Third-Party Analytics PlatformAPI reference
standards.on(event, callback)
Register a listener for a specific event or all events.
| Parameter | Type | Description |
|---|---|---|
event | string | Event name (e.g. 'page_view') or '*' for all events |
callback | function | Called with the event object when the event fires |