Netscape DevEdge

Skip to: [content] [navigation]

Tracking Gecko Browser Statistics

Learn how to accurately track website visitors using Netscape Gecko-based browsers. For more information regarding detecting browsers related to content development, please see Browser Detection and Cross Browser Support.

Background

It is no longer a two-browser world (Navigator and Internet Explorer). Netscape GeckoTM based browsers present a unique challenge for properly reporting browser usage due the variety of browsers which use Netscape Gecko embeddable browser. If your web analytics software reports solely on Netscape 6.x and/or Netscape 7.x in web logs, you will miss the other browsers based upon Netscape Gecko such as Mozilla, CompuServe 7, AOL for Macintosh OS X, Galeon, Phoenix, Chimera and others.

Tracking Netscape Gecko Server Side

Tracking Netscape Gecko traffic on the server requires use of the user-agent string reported by the browser. Mozilla user-agent strings define the Netscape Gecko user-agent string format:

Mozilla/5.0 (Platform; Security; OS-or-CPU; Localization; rv:x.x.x) Gecko/CCYYMMDD Vendor/Version

Where

The most important parts of the Gecko user-agent string for reporting browser statistics are:

Gecko

The string Gecko is the unique identifier for all Gecko based browsers. This is the single most important aspect of the user-agent string to detect in order to properly report Gecko usage.

rv

rv signifies which version of Netscape Gecko is being used and is the second most important aspect of the user-agent string to report for Gecko based browsers since each version of Gecko may be used by a variety of different browsers from different vendors.

Vendor/Version

The value of the Vendor/Version portion of the Gecko user-agent string is not specified by the Mozilla user-agent string reference and can be any value determined by the organization responsible for creating each particular browser based upon Gecko.

Netscape branded browsers based upon Netscape Gecko will contain the string Netscape following the Gecko/CCYYMMDD portion of the user-agent string. For example, Netscape 6.x browsers will contain Netscape6/6.x following the Gecko/CCYYMMDD and Netscape 7.x browsers will contain Netscape/7.x following Gecko/CCYYMMDD.

AOL-branded Gecko-based browsers based upon Netscape Gecko will contain the string AOL following the Gecko/CCYMMDD portion of the user-agent string. For example, AOL agents based upon Netscape Gecko will contain AOL/7.0 or AOL/8.0 depending upon their version.

CompuServe branded browsers based upon Netscape Gecko will contain the string CS 2000 7.0 following the Gecko/CCYMMDD portion of the user-agent string.

See Gecko User Agent Strings for a list of Netscape/AOL released user-agents based upon Netscape Gecko.

Example

The following code fragment illustrates the process of detecting Netscape Gecko using Perl.

my $hittotal = 0;
my $geckototal = 0;
my $geckorv;
my $geckovendor;

while (<ARGV>)
{
  ++$hittotal;

  my ($rv, $gecko) = 
      $_ =~ /rv:([^); ]+).*(Gecko)\/[0-9]{8}/;

  if ($gecko)
  {
    my ($vendor, $version) = 
        $_ =~ /Gecko\/[0-9]{8} ([^\/"]+)\/([^" ]+)"/;

    if (!$vendor)
    {
      $vendor  = "Mozilla";
      $version = "$rv";
    }

    $vendorversion = "$vendor/$version";
    $vendorrv      = "$vendor/$rv";

    if (!$geckorv{$rv})
    {
      $geckorv{$rv} = 0;
    }

    if (!$geckovendor{$vendorversion})
    {
      $geckovendor{$vendorversion} = 0;
    }

    if (!$geckovendorrv{$vendorrv})
    {
      $geckovendorrv{$vendorrv} = 0;
    }

    $geckototal += 1;
    $geckorv{$rv} += 1;
    $geckovendor{$vendorversion} += 1;
    $geckovendorrv{$vendorrv} += 1;
  }
}

printf "%-20s = %9d\n", "total hits", $hittotal;
print "\n";

printf "%-20s = %9d\n", "total gecko hits", $geckototal;
print "\n";

print "gecko by rv\n";
foreach $x (sort keys %geckorv)
{
  printf "%-20s = %9d\n", $x, $geckorv{$x};
}
print "\n";

print "gecko by vendor/rv\n";
foreach $x (sort keys %geckovendorrv)
{
  printf "%-20s = %9d\n", $x, $geckovendorrv{$x};
}
print "\n";

print "gecko by vendor/version\n";
foreach $x (sort keys %geckovendor)
{
  printf "%-20s = %9d\n", $x, $geckovendor{$x};
}

The output of this perl script on recent DevEdge logs shows the variety of user-agent strings which are possible with Gecko. Note how the "gecko by rv" report and the "gecko by vendor/rv" report are more reliable than the "gecko by vendor/version" due to the non-standard format used by some user agents.

Note that commonly available browser statistics reporting programs under reported Gecko based browsers by over 5% on the same input.

total hits           =  10799274

total gecko hits     =   3317791

gecko by rv
0.1                  =        51
0.9                  =       122
0.9.1                =       621
0.9.1+               =        13
0.9.2                =     26209
0.9.2+               =        10
0.9.2.1              =      3392
0.9.3                =       405
0.9.4                =    121583
0.9.4.1              =    186999
0.9.4.2              =      1382
0.9.5                =      1575
0.9.5+               =         2
0.9.6                =       673
0.9.6+               =       213
0.9.7                =       838
0.9.7+               =       190
0.9.8                =      7517
0.9.8+               =       757
0.9.9                =     13948
0.9.9+               =       331
1.0                  =       124
1.0.0                =    219419
1.0.0+               =      1354
1.0.1                =   1415067
1.0.2                =     55378
1.01                 =        15
1.0rc1               =      5011
1.0rc2               =     65893
1.0rc3               =      7714
1.1                  =    437016
1.1+                 =        10
1.1.0                =        34
1.1:                 =        40
1.1a                 =     12710
1.1a+                =      1245
1.1b                 =     82288
1.2                  =     40398
1.2.0                =         6
1.2.1                =     87679
1.2.x                =         2
1.2a                 =     79352
1.2a+                =        42
1.2b                 =    345416
1.2b+                =        36
1.2b-s               =         1
1.3a                 =     94473
1.97                 =        47
2.5.7                =        76
21.0.3               =         8
9.9.9                =         8
alpha                =        98

gecko by vendor/rv
AOL/1.0.1            =       444
AOL/1.0.2            =       198
AOL/1.0rc1           =         7
AOL/1.0rc3           =         4
AOL/1.1a             =         1
AOL/1.1b             =         1
Bayanihan/1.0.1      =        83
Beonex/1.0.1         =        88
CS 2000 7.0/0.9.4.2  =      1230
CS-Netscape6/0.9.2   =        10
CSIV-Netscape6/0.9.2 =        19
Chimera/1.0.1        =     50471
CyberSouls/1.1       =       204
Debian/0.9.9         =       183
Debian/1.0.0         =     23590
Debian/1.0.1         =       572
Debian/1.0rc1        =        85
Debian/1.0rc2        =        49
Debian/1.1           =     11992
Debian/1.1a          =        21
Debian/1.2           =      1927
Debian/1.2.1         =      1272
Debian/1.2b          =        11
E-kochanPower/1.0.1  =        13
Explorer/0.9.4       =        10
GLU/1.0.0            =         8
GLU/1.2.1            =        16
GLU/1.2a             =       123
GalionPublicLibrary/1.1 =        27
GalionPublicLibrary/1.2b =         7
IBM Web Browser for OS/1.0.1 =        30
K-Meleon/1.2b        =        45
Kent Pharmaceuticals Ltd/0.9.4.1 =        11
Kristof/0.9.5        =        16
Mozilla-Gumi/1.1     =        49
Mozilla/0.1          =        51
Mozilla/0.9          =       122
Mozilla/0.9.1        =       293
Mozilla/0.9.1+       =        13
Mozilla/0.9.2        =      2416
Mozilla/0.9.2+       =        10
Mozilla/0.9.2.1      =      3392
Mozilla/0.9.3        =       405
Mozilla/0.9.4        =      7532
Mozilla/0.9.4.1      =      4407
Mozilla/0.9.4.2      =       152
Mozilla/0.9.5        =      1559
Mozilla/0.9.5+       =         2
Mozilla/0.9.6        =       673
Mozilla/0.9.6+       =       213
Mozilla/0.9.7        =       838
Mozilla/0.9.7+       =       190
Mozilla/0.9.8        =      7517
Mozilla/0.9.8+       =       757
Mozilla/0.9.9        =     13765
Mozilla/0.9.9+       =       331
Mozilla/1.0          =       124
Mozilla/1.0.0        =    193546
Mozilla/1.0.0+       =      1354
Mozilla/1.0.1        =    148622
Mozilla/1.0.2        =      1404
Mozilla/1.0rc1       =      4896
Mozilla/1.0rc2       =      5594
Mozilla/1.0rc3       =      7618
Mozilla/1.1          =    416077
Mozilla/1.1+         =        10
Mozilla/1.1.0        =        10
Mozilla/1.1:         =        40
Mozilla/1.1a         =     12603
Mozilla/1.1a+        =      1234
Mozilla/1.1b         =     79391
Mozilla/1.2          =     38416
Mozilla/1.2.0        =         6
Mozilla/1.2.1        =     86150
Mozilla/1.2.x        =         2
Mozilla/1.2a         =     77475
Mozilla/1.2a+        =        42
Mozilla/1.2b         =    147100
Mozilla/1.2b+        =        36
Mozilla/1.2b-s       =         1
Mozilla/1.3a         =     30681
Mozilla/1.97         =        47
Mozilla/2.5.7        =        76
Mozilla/21.0.3       =         8
Mozilla/9.9.9        =         8
Mozilla/alpha        =        98
MultiZilla/1.0.0     =      1817
MultiZilla/1.0.1     =       978
MultiZilla/1.0.2     =       127
MultiZilla/1.0rc2    =        35
MultiZilla/1.0rc3    =        59
MultiZilla/1.1       =      8343
MultiZilla/1.1.0     =        22
MultiZilla/1.1a      =        85
MultiZilla/1.1b      =      2337
MultiZilla/1.2       =        55
MultiZilla/1.2.1     =       160
MultiZilla/1.2a      =      1234
MultiZilla/1.2b      =      2068
MultiZilla/1.3a      =        13
Netscape 6/1.0rc1    =        23
Netscape/1.0.0       =       386
Netscape/1.0.1       =   1213553
Netscape/1.0.2       =     53649
Netscape/1.0rc2      =     60203
Netscape/1.1         =        57
Netscape/1.1a+       =        11
Netscape/1.1b        =       302
Netscape/1.2a        =       453
Netscape/1.2b        =      3784
Netscape/1.3a        =      3914
Netscape6/0.9.1      =       328
Netscape6/0.9.2      =     23764
Netscape6/0.9.4      =    114041
Netscape6/0.9.4.1    =    182581
Netscape6/1.0.0      =        71
Netscape6/1.0.1      =       154
Netscape6/1.0rc2     =        12
Netscape6/1.0rc3     =        33
Netscape6/1.1        =       222
Netscape6/1.1.0      =         2
Netscape6/1.1b       =       257
Netscape6/1.2.1      =        64
Netscape6/1.2a       =        44
Netscape6/1.2b       =       133
Netscape6/1.3a       =        15
Netscape7/1.01       =        15
Pescadero/1.3a       =        53
Phoenix/1.2b         =    192268
Phoenix/1.3a         =     59797
PiTech/1.0.1         =         6
Smart WebGuide/1.1   =        10
Sylera/1.2.1         =        17
TCODEUTIWB20__000 IBM Web Browser for OS/1.0.1 =         1
TCODEUTIWB20__001 IBM Web Browser for OS/1.0.1 =        52
WebWasher/1.1        =        35
Y la bestia será hecha legión/1.2a =         9
ZenonWT/1.0.0        =         1
[http:/1.2a          =        14

gecko by vendor/version
AOL/7.0              =       620
AOL/8.0              =        35
Bayanihan/1.0        =        83
Beonex/0.8.1         =        88
CS 2000 7.0/7.0      =      1230
CS-Netscape6/6.1     =        10
CSIV-Netscape6/6.1   =        19
Chimera/0.5+         =      3510
Chimera/0.6          =     38282
Chimera/0.6+         =      8679
CyberSouls/20020906  =       204
Debian/0.9.9-6       =       165
Debian/1.0.0-0.woody.1 =     17492
Debian/1.0.0-1       =       343
Debian/1.0.0-2       =        11
Debian/1.0.0-3       =      5682
Debian/1.0.0-3.Xft.0 =         1
Debian/1.0.0.xandros1-3 =       104
Debian/1.0.1-0.3     =        10
Debian/1.0.1-2       =       441
Debian/1.0.1.xandros1-1 =       121
Debian/1.0rc2-2      =        10
Debian/1.0rc2-3      =        10
Debian/1.1-0.Xft.0   =        11
Debian/1.1-0.bunk    =        14
Debian/1.1-0pre1v1   =        83
Debian/1.1-1         =     11888
Debian/1.1a          =        21
Debian/1.2-0beta1    =        11
Debian/1.2-1         =       993
Debian/1.2.1-0       =         9
Debian/1.2.1-1       =       925
Debian/1.2.1-2       =       661
Debian/1.2.1-3       =       611
Debian/1.rc1-1       =        85
E-kochanPower/2800+  =        13
Explorer/6           =        10
GLU/0.0.16           =         8
GLU/1.0.2            =         8
GLU/1.0.4            =       123
GLU/1.0.8            =         8
GalionPublicLibrary/1.1 =         7
GalionPublicLibrary/1.1a =        27
IBM Web Browser for OS/2 =        30
K-Meleon/0.7         =        45
Kent Pharmaceuticals Ltd/6.2.3 =        11
Kristof/1.0          =        16
Mozilla-Gumi/Wazilla-Mac-1.1-trial7 =         9
Mozilla-Gumi/Wazilla-Mac-1.1-trial9 =        40
Mozilla/0.1          =        51
Mozilla/0.9          =       122
Mozilla/0.9.1        =       293
Mozilla/0.9.1+       =        13
Mozilla/0.9.2        =      2416
Mozilla/0.9.2+       =        10
Mozilla/0.9.2.1      =      3392
Mozilla/0.9.3        =       405
Mozilla/0.9.4        =      7532
Mozilla/0.9.4.1      =      4407
Mozilla/0.9.4.2      =       152
Mozilla/0.9.5        =      1559
Mozilla/0.9.5+       =         2
Mozilla/0.9.6        =       673
Mozilla/0.9.6+       =       213
Mozilla/0.9.7        =       838
Mozilla/0.9.7+       =       190
Mozilla/0.9.8        =      7517
Mozilla/0.9.8+       =       757
Mozilla/0.9.9        =     13765
Mozilla/0.9.9+       =       331
Mozilla/1.0          =       124
Mozilla/1.0.0        =    193546
Mozilla/1.0.0+       =      1354
Mozilla/1.0.1        =    148622
Mozilla/1.0.2        =      1404
Mozilla/1.0rc1       =      4896
Mozilla/1.0rc2       =      5594
Mozilla/1.0rc3       =      7618
Mozilla/1.1          =    416077
Mozilla/1.1+         =        10
Mozilla/1.1.0        =        10
Mozilla/1.1:         =        40
Mozilla/1.1a         =     12603
Mozilla/1.1a+        =      1234
Mozilla/1.1b         =     79391
Mozilla/1.2          =     38416
Mozilla/1.2.0        =         6
Mozilla/1.2.1        =     86150
Mozilla/1.2.x        =         2
Mozilla/1.2a         =     77475
Mozilla/1.2a+        =        42
Mozilla/1.2b         =    147100
Mozilla/1.2b+        =        36
Mozilla/1.2b-s       =         1
Mozilla/1.3a         =     30681
Mozilla/1.97         =        47
Mozilla/2.5.7        =        76
Mozilla/21.0.3       =         8
Mozilla/9.9.9        =         8
Mozilla/alpha        =        98
MultiZilla/v1.1.15   =       350
MultiZilla/v1.1.16   =        12
MultiZilla/v1.1.17   =       179
MultiZilla/v1.1.18   =      2826
MultiZilla/v1.1.20   =      2904
MultiZilla/v1.1.21   =      1779
MultiZilla/v1.1.22   =      9261
MultiZilla/v1.1.26   =        22
Netscape 6/6.2.1+    =        23
Netscape/4.07        =         2
Netscape/6.2         =        24
Netscape/7.0         =   1216006
Netscape/7.0+        =      6479
Netscape/7.01        =     51648
Netscape/7.0;        =        16
Netscape/7.0b1       =     60163
Netscape/7.0b1+      =      1892
Netscape/7.1         =        11
Netscape/7.6         =        71
Netscape6/6.1        =     23793
Netscape6/6.1/FJUSF01 =        29
Netscape6/6.1b1      =       328
Netscape6/6.2        =     42958
Netscape6/6.2.1      =     71232
Netscape6/6.2.2      =     42398
Netscape6/6.2.3      =    140368
Netscape6/6.2gnu.org =        43
Netscape6/6.5        =       303
Netscape6/7          =       238
Netscape6/7.0        =        31
Netscape7/7.0        =        15
Pescadero/0.1a       =        53
Phoenix/0.1          =      1935
Phoenix/0.2          =     23811
Phoenix/0.3          =     59772
Phoenix/0.4          =    123028
Phoenix/0.5          =     43519
PiTech/0.9           =         6
Smart WebGuide/1.0   =        10
Sylera/1.1.0         =        17
TCODEUTIWB20__000 IBM Web Browser for OS/2/DB =         1
TCODEUTIWB20__001 IBM Web Browser for OS/2/DB =        52
WebWasher/1.2.2      =        12
WebWasher/2.1.1rce   =        21
WebWasher/2.1.1rcw   =         1
WebWasher/2.1.1rcÓ   =         1
Y la bestia será hecha legión/31.337. =         9
ZenonWT/1.0          =         1
[http://www.soraia.com] =        14

Caveats for Server-Side Tracking

Except for Netscape, CompuServe and AOL-branded Gecko-based browsers, the variety of reported Vendors and Versions is practically unlimited.

Netscape Gecko based browsers can spoof the user-agent string reported to the server. Therefore reliance on server reported user-agent strings to determine browser statistics will not be 100% accurate.

Netscape Gecko based browsers can block images and cookies from specific domains. If your reporting software uses images or cookies on external sites which have been blocked then you will not see a full report of Netscape Gecko based browsers visiting your site.

Tracking Netscape Gecko Client Side

Tracking Netscape Gecko traffic using client-side JavaScript requires use of the navigator object and depends upon whether JavaScript is enabled in the client.

Useful navigator properties for tracking Gecko

navigator.userAgent

reports the user-agent string exactly as is reported to the server by the user agent. Note that this property can be spoofed in the same fashion and is not 100% reliable in detecting Netscape Gecko based user agents.

navigator.userAgent is the only place where you can find the Gecko rv value.

navigator.product

will always be the string Gecko for Netscape Gecko browsers and is the most reliable means of detecting Gecko using JavaScript. This value can not be spoofed.

navigator.vendor

will be the vendor (blank for Mozilla). This value can not be spoofed.

navigator.vendorSub

will be the vendor's version. This value can not be spoofed.

Example

The following script uses URL encoded data to report on the version of Gecko or Microsoft Internet ExplorerTM used.

    var img = document.getElementById('tracker');
    var trk = '';

    if (navigator.product == 'Gecko')
    {
      var rv = navigator.userAgent.match(/rv:([\w.]+)/)[0];
      rv = rv.substr(3);
      var vendor = navigator.vendor;
      var version = navigator.vendorSub;
      if (!vendor)
      {
        vendor = 'Mozilla';
        version = rv;
      }
      trk = 'browser=Gecko/' + rv + ';vendor=' + vendor + '/' + version;
    }
    else 
    {
      var msiePos = navigator.userAgent.indexOf('MSIE ');
      if (msiePos != -1)
      {
        trk = 'browser=MSIE/' + parseFloat(navigator.userAgent.substr(msiePos + 5));
      }
    }

    img.setAttribute('src', img.getAttribute('src') + '?' + trk);
    

Caveats for Client Side Tracking

The value of the Gecko branch rv value can be modified if the user has spoofed their user-agent string.

The effectiveness of client-side reporting is dependent on whether the user has enabled JavaScript.

The effectiveness of of images or cookies in client-side reporting is depenendent on whether the user has blocked images or cookies for the domain.

Conclusion

Tracking accurate user agent statistics for Netscape Gecko-based browsers can be a very complicated affair. Rather than relying solely on your web analytics software reports, be sure to check the results against known results found in your web server logs.

References

A+R