Welcome, Guest
  • Author Topic: Tracking problems  (Read 1671 times)

    Dirk Watkins

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Dirk Watkins
    Tracking problems
    « on: 07/02/04, 13:46 »
    Ok.  I got this code somewhere's and am using it to track our visitors flash availability (is plugin installed and what version) and it's giving me some odd numbers back.  Almost completely opposite from what Macromedia says it's penetration levels are (95% or so).  Could some one tell me what the heck is wrong with this.  It adds a query string on an image so we can track the log.

    Code: [Select]
    <SCRIPT LANGUAGE="Javascript">
    <!--

    var flashinstalled = 0;
    var flashversion = 0;
    MSDetect = "false";
    if (navigator.plugins && navigator.plugins.length)
    {
       x = navigator.plugins["Shockwave Flash"];
       if (x)
       {
          flashinstalled = 2;
          if (x.description)
          {
             y = x.description;
             flashversion = y.charAt(y.indexOf('.')-1);
          }
       }
       else
          flashinstalled = 1;
       if (navigator.plugins["Shockwave Flash 2.0"])
       {
          flashinstalled = 2;
          flashversion = 2;
       }
    }
    else if (navigator.mimeTypes && navigator.mimeTypes.length)
    {
       x = navigator.mimeTypes['application/x-shockwave-flash'];
       if (x && x.enabledPlugin)
          flashinstalled = 2;
       else
          flashinstalled = 1;
    }
    else
       MSDetect = "true";

    // -->
    </SCRIPT>

    <SCRIPT LANGUAGE="VBScript">

    on error resume next

    If MSDetect = "true" Then
       For i = 2 to 7
          If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then

          Else
             flashinstalled = 2
             flashversion = i
          End If
       Next
    End If

    If flashinstalled = 0 Then
       flashinstalled = 1
    End If

    </SCRIPT>


    <script type="text/javascript" language="JavaScript1.2">
    <!--
    var sImage = 'media/images/structure/u.gif?';
    sImage += 'screenRes=' + screen.width + 'x' + screen.height;
    sImage += '&availRes=' + screen.availWidth + 'x' + screen.availHeight;
    sImage += '&colorDepth=' + screen.colorDepth;
       if (flashinstalled == 2){
          sImage += "&flashInstalled=TRUE&flashVersion="+flashversion;
       } else if (flashinstalled == 1){
          sImage += "&flashInstalled=FALSE&flashVersion="+flashversion;
       } else if (flashinstalled == 0){
          sImage += "&flashInstalled=UNKNOWN&flashVersion="+flashversion;
       }
    document.write('<img src="' + sImage + '" width="100" height="100" border="0" alt="HellermannTyton">');
    // -->
    </script>

    Here's the data that we get back:

    Installed         Visits  
    -----------         ----------
    FALSE             14,697
    TRUE               595
    UNKNOWN      77


    « Last Edit: 07/02/04, 14:25 by Jorge Solis »