WillMaster Possibillites Logo EzineSeek Award
A Database of Visitor Browser Capabilities
by
Mari Bontrager

Permission is granted to reprint this article in its entirety, provided no reprints are sent in conjunction with unsolicited bulk email, provided no fee or other value is exchanged, provided no changes are made to the article, and provided the author's name, signature lines, and copyright line are printed with the article; except you may change the article's title.

Are you guessing or making assumptions?

If you knew the following information, could your web site be made more effective?

  1. How many page hits are with JavaScript enabled browsers compared to those with JavaScript turned off.

  2. How many can run Java applets and how many can't.

  3. Which time zone(s) most of your site visitors are from.

  4. Which languages are the browsers set for: How many English. How many German. How many Spanish. Etc.

  5. How many can run Flash movies.

  6. The screen sizes your site visitors are using, a count for each unique size.

  7. How many colors the screens can display.

  8. How many browsers have the Adobe Acrobat plugin to view PDF files.

  9. Which browsers, both brands and versions, your site visitors are using.

It's done with Master ABD (Aggregate Browser Details). You can pick it up at http://willmaster.com/a/16/pl.pl?artdownload168

The program is a combination of JavaScript and Perl CGI. The JavaScript gathers the details that are available and the CGI program records them in a database for you.

The CGI program records only the details that can be gathered, of course. If the browser is JavaScript-disabled, special HTML code provided with the Master ABD download provides that lone detail to the CGI program.

It's a free program. The results aren't nicely graphed like they might be if you paid money for it. Instead, the database file is plain text, which you can download from your server and peruse. Actually, you'll probably be able to read the database with your browser, if the database has a ".txt" file name extension, by typing the URL of the file into your browser's address bar.

The program comes in three parts. Here is what you do with each:

I. The Perl CGI program

When you download Master ABD, the package will contain a number of files. One of them is named Mabd.cgi and that is the Perl CGI program.

If your server requires Perl CGI files to have a .pl file name extension, rename Mabd.cgi to Mabd.pl

When you modify Mabd.cgi, do so with a plain text word processor like NotePad or BBEdit.

First, verify that the first line of this file points toward your Perl 5+ program.

Then, specify the file name where you data will be stored. The script has the place marked where you type the file name. If you'll be putting the file in a subdirectory, make sure the subdirectory has write permissions.

II. The JavaScript

This is named Mabd.js in the downloaded package. Upload the file to your server in the same directory where you put web pages.

III. The Web Page

In the downloaded package, you'll find an example HTML page named Mabd.html. It contains three sections of code:

  1. The one-line JavaScript function retrieval code.

    It is what loads the JavaScript function that collects the browser information.

    The code specifies the src of the file you uploaded in part II. Make sure the src contains the URL of the file -- a relative or absolute URL will do.

    This type of code is usually put in the HEAD area of the page. This particular code, however, may be placed immediately above the three-line CGI program calling code (see below), instead, if you prefer to have all your code together in your page. Either position will be fine.

  2. The three-line CGI program calling code.

    It is what sends the browser information to the CGI program and loads a transparent GIF image.

    The code specifies the src of the Perl CGI program that you uploaded in part I. Make sure the URL contains the URL of the program -- a relative or absolute URL will do. NOTE: Change only the URL, not any of the quotation marks or apostrophes.

    The code also specifies the height and width for the GIF image. You may change this to any dimensions you wish. I recommend using numbers greater than 1 because 1x1 pixel GIFs have been associated for spamming, in the past. Search engines might or might not still see them this way.

    Put this code on your web page where the dimensions of the transparent image won't interfere with your content or design. If you put it at the bottom of the page, it's possible that the image might not load (and statistics not be gathered) if the visitor abandons the page after it's been partially loaded.

  3. The three-line CGI program calling code for JavaScript-disabled browsers.

    It is what sends the browser information to the CGI program and loads a transparent GIF image when the browser is JavaScript-disabled. This code can be omitted if you don't need to know how many JavaScript-disabled browsers visit your site compared to those with JavaScript.

    The code specifies the src of the Perl CGI program that you uploaded in part I. Make sure the URL contains the URL of the program -- a relative or absolute URL will do.

    The code also specifies the height and width for the GIF image. You may change this to any dimensions you wish. Again, I recommend using numbers greater than 1.

    Put this code on your web page where the dimensions of the transparent image won't interfere with your content or design. Usually, it would be immediately below the other CGI program calling code (see above).

When you've put the code into your web page, upload it to your server. You may put the code into as many web pages as you wish, only one Mabd.js file is required (see part II).

When you put the code into more than one web page, the data file records the aggregate -- not hits on specific pages.

Now, when you design or re-design your sites, you're not working in the dark.

By: Will Bontrager

Copyright 2002 Bontrager Connection, LLC
http://willmaster.com/possibilities/
subscribe-possibilities@willmaster.com