Simple Stats Tutorial
Posted by Daniel G. Taylor at 12:07 on 22 Jul 2008. There are 0 comments.

Simple Stats, put simply and in the simplest manner, is an easy to use statistics package for Jeroen Wijering's Flash video player. But, perhaps more importantly, you should be asking why you might want to use it, why you should be using it, why you will be using it even! For the first of a multi-part answer to those questions take a gander at the following screenshots:

<p>Simple Stats Screenshot
</p>

Simple Stats Screenshot

<p>Details view
</p>

Details view

<p>Single stream view
</p>

Single stream view

Simple Stats lets you take control of your videos! See which videos are the most popular, which are the most watched, which videos users spend the most time on. See where in each file the most views occur and see which videos are most popular from certain Internet addresses, as well as dozens of other features. Excited yet? We are, but that's just because we're always excited due to a horrific guarana processing plant and gene therapy incident. shivers excitedly

Installation

Using Wordpress? Simple Flash Video includes Simple Stats pre-setup!

Striving for simplicity, Simple Stats simply simplifies serious steps such as setup. Using the colonel's secret recipe as a model, we've crafted a three step installation process. Delicious!

  • Download Simple Stats
  • Extract & copy Simple Stats to your server
  • Visit the extracted folder through your web browser

Real World Example

To be as realistic as possible we'll use a fake domain for our real world example. Go figure. Imagine your website's domain name is www.myvideos.tld. You want to install Simple Stats, so you follow the not-so-secret three step recipe above:

  • Download Simple Stats
  • Extract & copy the simplestats-1.2 directory to www.myvideos.tld/simplestats
  • Go to http://www.myvideos.tld/simplestats/ in a browser
<p>Welcome page
</p>

Welcome page

Techno-babble

Simple Stats requires PHP 4.3 or higher and Python 2.3 or higher. It works best with PHP 5 or higher and Python 2.4 or higher, due to some extra features and speed improvements in those versions. Almost all servers already include this software, but if not contact your admin and it will hopefully just be an 'apt-get install' away!

The web server needs to be able to write to the Simple Stats directories and some files (notably simplestats.js) for autoconfiguration and storing and processing logs to work. If permissions are not copied when you copy the files to the server you will need to modify permissions to either allow the web server or all users write access to your Simple Stats directories! Simple Stats, when run, will check these permissions and report any potential problems along with a solution.

Player Setup

Congratulations! Simple Stats is installed! Congratulate yourself with a drink. No seriously, we'll wait. It's bound to be five o'clock somewhere.

Invalid image name: responsiblebehavior.png_

Prost! Next on our agenda is setting up the player and your website for collecting stats. Copy and paste the script tag from the setup page to the head section of your website. Next, if you already have videos on your site, modify the code invoking the player to be like what you see on the setup page example. If not, just copy and paste the example, modifying it as needed for a video on your site.

Real World Example

Building upon our previous example, the pages on www.myvideos.tld now might look almost, but not quite, dissimilar to the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Awesome Videos</title>
<link rel="Stylesheet" type="text/css" href="/styles/default.css"/>
<script type="text/javascript" src="/simplestats/simplestats.js"></script>
</head>
<body>
<div id="videocontainer1">This text will be replaced</div>
 
<script type="text/javascript">
var so = new SWFObject('/scripts/mediaplayer.swf','video1','400','320','8');
so.addParam('allowscriptaccess','always');
so.addVariable('width','400');
so.addVariable('height','320');
so.addVariable('file','/videos/test.mp4');
so.write('videocontainer1');
</script>
<body>
<html>

Techno-babble

The above example assumes you have the JW FLV player installed to /scripts/mediaplayer.swf and an example video accessible via /videos/test.mp4, so modify the example to suit your needs. There are plenty of tutorials on JW's site about installing and using the player itself.

Live Test

Time to test Simple Stats! Yeah, we're still excited. You must be by now! Our fingers are crossed! Navigate to a page on your site which has a video and begin watching, then navigate to another page. Now go to your Simple Stats page to see if anything registered in the logs, and...

<p>First hit screenshot
</p>

First hit screenshot

Voila! Simple Stats is setup and working on your website! Congratulations on a job well done.

Not Working?

If you receive an error, use the email link to send us an error report. If there is no error, make sure you've typed evertyhing correctly and are pointing to your own domain! If it just won't work or you think you've found some kind of new issue, please email us so that we can fix it!

<p>Error report
</p>

Error report

Next Steps

Here are some things you can do next:

Comments

No comments have been posted yet.

Post a Comment

Post a new comment. You may use Markdown syntax here. Posts abusing the flexibility this provides will be removed.