Search Blog

Recent Comments
Re: Stats plugin ported to Model-Glue (by J.mihai at 12/14 8:52 AM)
Re: CFC DAO Generator (by rui at 7/04 5:42 AM)
Re: Updates to the DAO, Bean and Gateway generator (by rui at 7/04 4:49 AM)
Re: CFC DAO Generator (by fwscott at 6/22 7:03 PM)
Re: CFC DAO Generator (by dan at 6/22 12:38 PM)
Re: Trip to Thailand (by fwscott at 3/27 2:10 AM)
Re: CFC DAO Generator (by fwscott at 3/27 2:03 AM)
Re: CFC DAO Generator (by Garry Harstad at 3/26 12:30 PM)
Re: Trip to Thailand (by Niqui Merret at 3/23 4:51 PM)
Re: Adding a blogger ping utility to BlogCFM (by fwscott at 2/20 9:01 PM)
Categories
Annoucements (1 entries)
BlogCFM (3 entries)
CFC Generator (5 entries)
Coldfusion (11 entries)
Fusebox (2 entries)
Greasemonkey (1 entries)
Misc (3 entries)
Archives
November 2005 (2 entries)
October 2005 (1 entries)
August 2005 (1 entries)
July 2005 (4 entries)
June 2005 (5 entries)
May 2005 (7 entries)

Powered by
BlogCFM v1.01

July 2005
Fusebox plugin for log based stats programs
Post a Comment
So I was reading on Pete Freitag's blog about the most common screen resolutions...

It got me interested in what my websites were being viewed at.  Come to find out my hosting provider's new stats engine does not support this natively.  I think quite a few Coldfusion people use HostMySite which recently dropped using Deep Metrixs and went to SmarterStats, so I hope this plugin will be useful to others.

First thing, the plugin could be integrated directly into the layout file but I decided to use a plugin instead.  I put this into the PreProcess stage. The javascript came from a few places on the internet.

<cfsavecontent variable="request.clientstats">
<script>
var screenW = 640, screenH = 480;
if (parseInt(navigator.appVersion)>3) {
 screenW = screen.width;
 screenH = screen.height;
}
else if (navigator.appName == "Netscape"
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   )
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 screenW = jScreenSize.width;
 screenH = jScreenSize.height;
}

var innerwidth= 640, innerheight= 480; // defaults
if (self.innerHeight)
    // all except Explorer
    {
    innerwidth= self.innerWidth;
    innerheight= self.innerHeight;
    }

    else if (document.documentElement && document.documentElement.clientHeight)
    // Explorer 6 Strict Mode
    {
    innerwidth= document.documentElement.clientWidth;
    innerheight= document.documentElement.clientHeight;
    }

    else if (document.body)
    // other Explorers
    {
    innerwidth= document.body.clientWidth;
    innerheight= document.body.clientHeight;
    }
<cfoutput>
document.write('<img src="clientresolution.htm?resolution=' + screenW + 'x' + screenH + '" height="1" width="1" />');
document.write('<img src="fusebox.htm?fuseaction=#myfusebox.originalcircuit#.#myfusebox.originalfuseaction#" height="1" width="1" />');
document.write('<img src="clientviewableres.htm?resolution=' + innerwidth + 'x' + innerheight + '" height="1" width="1" />');
</cfoutput>
</script>
</cfsavecontent>

Then I <cfoutput>ed #request.clientstats# in the body section on my layout files.

In order to not generate a bunch of 404 errors in the server logs, I also created empty htm files for clientresolution.htm,clientviewableres.htm and fusebox.htm.

Now in SmarterStats I can run a custom report on querystrings for the files above that show client resolutions and the original fuseaction that is called per view (useful if any/all of your fuseactions are not URL submitted).

Oh and so far the results on my main website show only 16% of the requests coming in use 800x600 or lower.

Posted by fwscott at 5:46 PM | Comments (0)
 
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Anti-spam key

Type in the text that you see in the above image:

Your comment:

Sorry, no HTML allowed!