API
Quickstart
- Step 1. Under API, click Generate API. This creates a javascript file to add to your page.
- Pro users can enable REPLAY session recording
- Step 2. The default pageload metric is automatically triggered when loaded.
- Step 3. (optional) Trigger extra metrics.
- Step 4. Integrations with Prestashop are automatically detected and used in Funnel analysis
// Step 1. Initialize API
window.UserMetrics = new UserMetrics({ host: um_host || "", apikey: um_apikey });
// Step 2. Edit the tag and (optional)funnel id.
UserMetrics.setTag("myApp");
UserMetrics.setFunnel({ funnelid: 'funnel1', page: 1);
// Step 3. The default metric is automatically triggered when loaded.
// Add extra metics:
UserMetrics.metric("Perfcheck", 55.1, { route: window.location.pathname });