LibX Edition Statistics Widget

This page will show how to integrate the usage statistics of a particular edition into any web page.

Adding statistics to your web page for a LibX Edition is done in the following way:

1. Include the “http://www.libx.org/stats/edition_stats_widget.js” script in your web page
2. Construct a div or span such that its class is set to “libxstats” and place it in the html of your web page
3. Add the edition_id attribute to your tag, and set it to your edition id

Consider the following simple example:

{code src=http://libx.org/libx2/examples/jsonexample.html lang=xml}

In the example above, the edition_id is “myedition”, and the field to display is “total_downloads”. The effect of this code is to insert the total number of downloads for edition “myedition” inside the span tag. Notice how you can naturally place this information inside a sentence. Below I will explain the different types of data you can show.

Options
You can change which data to show by changing the value of the “field” attribute. Possible values for the ‘field’ are:

“unique_updates”
The number of unique (by IP address) update.rdf requests in the past 7 days

“total_updates”
The totalĀ  number of unique and non-unique requests in the past 7 days

“unique_ff_downloads”
The number of unique users who downloaded the Firefox version of the edition since its creation

“unique_ie_downloads”
The number of unique users who downloaded the Internet Explorer version of the edition since its creation

“unique_total_downloads”
The sum of “unique_ff_downloads” and “unique_ie_downloads”

“total_downloads”
The number of unique and non-unique users who downloaded the edition for either browser

“all”
This will construct a table of all available statistics (i.e., all of the previously-listed options), and descriptions of what each field represents.