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.

IP Addresses

By default we will store the IP address that accompanies each error. This is useful information that can reveal the origin of the error. However, in some areas it is against the law or otherwise undesirable for this information to be retained. We have two options for sanitizing IP addresses:

1) We can ignore the data for your account. The IP will not be persisted anywhere.
2) We can truncate the last octet to 0. So 123.12.34.56 would become 123.12.34.0

Just email us at hello@trackjs.com if you’d like us to apply either of these settings to your account!