How it works

{Track:js} gathers information and errors by instrumenting the host-functions of the browser, such as addEventListener, console, and XmlHttpRequest. After the script has been initialized, many of these functions are replaced by {Track:js} so that we can watch and trigger errors on actions.

Error Origins

There are 5 ways an error can be transmitted to {Track:js}:

  1. A direct call trackJs.track()
  2. A global call to window.onerror()
  3. An error is caught from a callback passed into a host function, or helper on our API
  4. A console message is sent to console.error()
  5. A network request returns with a response code of 400 or greater

Each of these origins is configurable.

Telemetry Timeline and Event Log

{Track:js} records events from:

  1. Calls to console.log, console.info, and the rest of the console functions.
  2. Network Ajax requests through XmlHttpRequest and XDomainRequest
  3. Visitor click and input interactions

Each event is stored into a rolling log of 30 entries. Each log entry is composed of only strings, so no memory leak should occur from this logging. When an error condition occurs the log is flushed out with the error.

Browser Support

{Track:js} tracking is supported on:

Internet Explorer 8 is partially supported. Errors will be tracked and some telemetry captured. However due to browser limitations, we are unable to capture network events.

Internet Explorer 7 and below are not supported, no errors will be tracked. However the TrackJS API will exist on the page and won’t break any code written against it.