Hack73.Measure Browser Plug-ins


Hack 73. Measure Browser Plug-ins

If you're developing any advanced functionality that requires external plugins, you should use your web measurement application to make sure your visitors have the right plug-ins installed.

Understanding the plug-ins your visitors use helps guide web site technology decisions. For example, if only 20 percent of your visitors have RealPlayer support, you may consider offering videos in other formats such as QuickTime or Windows Media. You may be looking at research data to understand plug-in penetration. Research data is a starting point, but you will want to check your own web site visitors. For example, a software company web site may have a much higher concentration of advanced plug-ins than a generic search portal.

Determining which plug-ins are installed on a visitor's browser is difficult, because each browser works differently. Before Internet Explorer became so popular, you could easily get a list of plug-ins by accessing the navigator. plug-ins array, which contains all of the installed plug-ins for Netscape and Mozilla-based browsers. The problem with Internet Explorer is that it does not provide a list of plug-ins. Instead, you basically ask the browser about each plug-in.

5.7.1. Ask the Browser

To detect and track a plug-in with Internet Explorer, you will need to add some code to your pageusually JavaScript, but in some cases VBScriptand pass in the information to a variable or URL of your web measurement application (note that some vendors have this functionality by default).

Tracking plug-ins is not an exact science and does not work in all versions of Internet Explorer; however, it should work with the majority of your visitors.


Since it is not feasible to check all plug-ins at once with Internet Explorer, we will add some JavaScript code to our web pages to test three media plug-ins. The code example below checks each of our site visitors to see if they have QuickTime, Macromedia Flash, and/or Windows Media Player installed.

5.7.2. The Code

If you use the following code with your web measurement application you will need to pass the results into JavaScript variables, which will be collected by the web measurement application. With some additional modifications to this code, you can even display the plug-in version in your web measurement application.

 <script language="JavaScript">  <!-- function ie_plugin_check(id) { document.body.addBehavior("#default#clientCaps"); if (id.substring(0,1) != '{') { id = '{' + id + '}';  } if (document.body.isComponentInstalled(id,'ComponentID')) { return true;  } return false; } var plugin_list = new Array; plugin_list[0] = new Object;  plugin_list[0].id = 'D27CDB6E-AE6D-11CF-96B8-444553540000'; plugin_list[0].name = 'Macromedia Flash'; plugin_list[1] = new Object;  plugin_list[1].id = '22D6F312-B0F6-11D0-94AB-0080C74C7E95'; plugin_list[1].name = 'Windows Media Player'; plugin_list[2] = new Object; plugin_list[2].id = '23064720-C4F8-11D1-994D-00C04F98BBC9';  plugin_list[2].name = 'Windows Media Player RealNetwork Support'; var s_prop1 = ""; for (var plugin_num = 0;plugin_num < plugin_list.length;plugin_num++) {  if (1 || ie_plugin_check(plugin_list[plugin_num].id)) {  s_prop1 += (s_prop1 ? ',' : '') + plugin_list[plugin_num].name;  } } //--> </script>  

Once your analytics application collects the data, you can run reports to determine plug-in usage. You should be able to view a report that shows you the page views, visits, visitors, and even success events by plug-in. This helps you determine how critical plug-ins may be to the success of your web site.

5.7.3. Hacking the Hack

Another way to understand your visitors is to segment them based on a plug-in and then measure how they interact with it. For example, if you're running a clothing web site with a three-dimensional model, does the model increase sales versus a two-dimensional image?

On the product pages in which the visitors used the 3D model plug-in, we would pass in to a JavaScript variable something like "3D Image Used," and for the visitors that used the standard 2D image, we would pass in to a JavaScript variable "2D Image Used." From within your web measurement application, you would see a report that looks something like Figure 5-12.

Figure 5-12. Browser plug-in report


By looking at simple reports, you can understand the usefulness of plug-in technologies and how they can help create a better web site experience.

John Pestana and Eric T. Peterson



    Web Site Measurement Hacks
    Web Site Measurement Hacks: Tips & Tools to Help Optimize Your Online Business
    ISBN: 0596009887
    EAN: 2147483647
    Year: 2005
    Pages: 157

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net