Ajax Metrics

Lightweight usage statistics for Web 2.0 sites

Ajax Metrics Project

Other Projects

Metrics Viewer: Details

Site owner should be able to do the following through the Metrics Viewer:

1) View a list of all users that ever logged in to the website. The following columns are available:

  • User ID
  • Last Session Start (Date/Time)
  • Total Sessions
  • Number of days between the first and last sessions
  • Average actions per session
  • Number of actions during the last session
  • Total number of actions across all sessions

Approximate look of the user browser section:
browsing user list

2) Filter or sort any list by any column. Any column can be hidden.

3) Drill down on a particular user; see every single action they performed, across sessions. Approximate look:
drill down on actions of a particular user

4) Filter the list of user actions by:

  • action type
  • session number

5) Custom views can be defined and persisted (Pri 2). View are defined as settings for:

  • filters
  • sort orders
  • hide/show status for columns

JavaScript API: Details

AjaxMetrics.start (string api_key) // implemented

Start tracking usage statistics; api_key parameter is a unique, per-site key given at signup time.

AjaxMetrics.track (string eventName, Object eventDetails) // implemented

Report that a particular event type eventName has happened. Optionally, provide additional event details; these can be any object (it will be persisted as its JSON serialization).

It should be possible to report new events without having to go to the management console. However, these eventNames should not be used for communication with the server: AjaxMetrics should request eventID's from the AjaxMetrics server, and use those. AjaxMetrics client code should be smart enough to dynamically associate event string names with event id's (as they are created on the back end), so that strings are only sent once?

ISSUE: This has security implications (DoS attacks); need to cap maximum number of allowed event types.

AjaxMetrics.setUpdateFrequency (int maxSeconds, int maxActions) // pri 2, not yet implemented

The action log is sent back to the server after maxSeconds passes, or if maxActions have been accumulated in the log (thanks to Theo Hultbergfor for suggesting this!).

If maxSeconds = 0, the "call home" will only happen after maxActions have been accumulated

If maxActions = 0, the "call home" will happen every maxSeconds (provided that at least one action took place).

The call to this function is optional; by default, controlled dynamically by the server.

Issue: If the AjaxMetrics server determines that the provided parameters are inappropriate for a site (abuse, or simply too high volume of requests), it should not honor this setting, instead, going with a more conservative frequency.

AjaxMetrics.useFramework (int framework) // pri 3, not yet implemented

Ajax websites are likely already using some popular XmlHTTPRequest framework; by allowing the website owner to specify the framework he's using, we can save on the download time for JavaScript.

Possible values for the framework parameter:

  • Prototype
  • Dojo
  • YUI
  • Maybe others?

Note that calling this function will be optional; by default, AjaxMetrics will load and use the Prototype library.