The UserMetrics
class provides methods to log events and measure metrics for user
interactions. This documentation covers the usage of the UserMetrics
class.
new UserMetrics(config)
Creates an instance of the UserMetrics
class.
new UserMetrics({ apikey: 'xxxxx-apikey-xxxxx' });
UserMetrics.log("some log");
Writes to the log. The log tail can be viewed in the LOG section
UserMetrics.metric(#tag, #value, #jsondata);
Adds a metric for viewing in Graph, Dashboard
UserMetrics.metric("item", 1.2, {some:"data"});
UserMetrics.beginSpan(tag);
Begins measurement of a named time
UserMetrics.endSpan(tag);
Ends measurement of a named time
UserMetrics.lapSpan(tag);
Appends measurement of a named time
UserMetrics.error(tag);
Logs an error
Record user sessions for playback in the Replay player. Replay is useful for debugging user interaction or providing support.
UserMetrics.startReplay();
For session recording you must call startReplay on every new page load. Replay actions are added to the current session until UserMetrics.stopReplay() or UserMetrics.newSession()
Replay can be enabled for: