Skip to main content

Track generic site timings on web

Use the trackTiming method to track user timing events such as how long resources take to load. This method is provided as part of the site-tracking plugin.

Timing events must be manually tracked.

Install plugin​

Tracker DistributionIncluded
sp.js✅
sp.lite.js❌

Download:

Download from GitHub Releases (Recommended)Github Releases (plugins.umd.zip)
Available on jsDelivrjsDelivr
Available on unpkgunpkg

Note: The links to the CDNs above are pinned to a specific version at the time of writing. Check the plugin's GitHub releases for newer versions, and update the pinned version when you upgrade.

javascript
window.snowplow('addPlugin',
"https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-site-tracking@4.10.2/dist/index.umd.min.js",
["snowplowSiteTracking", "SiteTrackingPlugin"]
);

Timing event​

Use the trackTiming method to track how long something took. Here are its arguments:

NameRequired?DescriptionType
categoryYesTiming categorystring
variableYesTimed variablestring
timingYesNumber of milliseconds elapsednumber
labelNoLabel for the eventstring

An example:

javascript
snowplow('trackTiming', {
category: 'load',
variable: 'map_loaded',
timing: 50,
label: 'Map loading time'
});

Timing events are implemented as Snowplow self describing events. Here is the schema for a timing event.

On this page

Try Snowplow Free for 14 Days

Collect behavioral data and act on it in real time. Design a schema, send an event, and fetch live context with the AI Assistant and MCP server.

Want to see a custom demo instead? Book a demo