Skip to main content
Enterprise The analytics API is a JavaScript API available on all published projects. It lets your custom scripts listen to visitor interactions like page views, downloads, and more.

Quickstart

In your header or footer scripts, register a listener:
Or listen to all events at once using *:

How it works

A window.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.

download_file

Fired when a visitor clicks a download link.

play_video

Fired when a visitor explicitly triggers video playback (click or hover). Not fired when a video autoplays on scroll.

change_slide

Fired when a visitor navigates slides in a Sequence or Toggle element. Not fired on autoplay transitions.

change_language

Fired when a visitor switches the project’s language.

copy_hex_code

Fired when a visitor clicks a color swatch to copy its value. Fired when a visitor clicks a share link button.

User identity

By default, events include only a session_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 Platform

API reference

standards.on(event, callback)

Register a listener for a specific event or all events.

standards.hasGoogleAnalytics

A boolean indicating whether the native Google Analytics integration is active on this project. Use this to avoid sending duplicate events to GA.