2eNetWorX :: Development Community with Tutorial, Script, Code, Programming sections for Visual Basic, Active Server Pages and .Net Framework Developers.  

Adding More Fields, Statisticus :: Article - 2eNetWorX


This article focuses on basic statistical analysis methods and the techniques to implement them into the web pages.

 
  2eNetWorX :: ASP, VB, Asp.Net, Vb.Net, C#, dotNet, .Net OpenSource Projects
MyDev What's New | Projects | Tutorials & Articles | Services | Stats | Contact Us
Guest-11445    /dev :: home :: articles :: statisticus - part #4  79 online visitors
Popular Projects

  • TableEditor
  • StatCounteX
  • 2eNetWorX/Dev
  • MiniSurvey
  • OpenForum
  • PowerTool
  • ShopEZ
  • Trans-It
  • HiLiteR
  • (View All Projects)


    Top 10

    » Contributions


    Tutorials & Articles

    » Recordset Cache
    » OpenSource
    » Statisticus
    » OpenCYA!


    Code Samples

    » Undocumented...
    » Ask For Login
    » DSN'less Connection
    » Who's Online?
    » (All Samples)


    Link Back



    Site Banner


  • Statisticus, Why and How?
    Part IV - Adding More Fields

    by Hakan Eskici

    4. Adding More Fields

    By adding some more fields to our table, we will get some more statistics such as mostly used screen resolutions and color depths. It is very valuable piece of information. How do you feel about being stuck with that 216-safe color palette? Should you stay within safe palette or your visitors run in high color mode with more than 800x600 resolution? Well, here's how to learn:

    Client-side scripting gives you the ability to directly talk to the browser and ask about the environment. We will use JavaScript to do that.

    <script language="JavaScript" type="text/javascript"> <!-- f = "" + escape(document.referrer); v = navigator.appName; if (v=='Netscape') {b = 'NS';} if (v=='Microsoft Internet Explorer') {b = 'MSIE';} if (navigator.appVersion.indexOf('MSIE 3')>0) {b = 'MSIE';} u = "" + escape(document.URL); w = screen.width; h = screen.height; if (v != "Netscape") {c=screen.colorDepth;} else {c=screen.pixelDepth;} info= "w=" + w + "&h=" + h + "&c=" + c + "&r=" + f + "&u="+ u + "&b=" + b document.write("<img src=\"/count.asp?" + info + "\">"); --> </script>

    What we actually do here is a little bit tricky, we call an asp page externally! We tell the browser that our asp page (count.asp) is an image. We will do what we say to the browser, but first we will have a look at the information we are sending to count.asp.

    Our count.asp file, which is responsible for storing the data to the table needs to catch the following variables;

    w: screen width
    h: screen height
    c: color depth (in bits)
    r: referer
    u: url of the page
    b: browser brand

    We had used Request.Servervariables("script_name") before, why sending URL again? Answer is simple, script_name will always return count.asp because we are making a tricky external call to it. This is why we should send the url.

    Now, in count.asp, it's easy to store the variables into the table.

    After running such a counter for a long time, you'll see that the database size grows and grows. What should we do? We don't want to give up our new fields, but we need to somehow use less bytes. A kind of compression? No, it's called data normalization.

    Part I - Introduction
    Part II - Measurement Tools
    Part III - Simple Statistics
    Part IV - Adding More Fields
    Part V - Data Normalization
    Part VI - Data Gets Valuable




    Who's Online

     Bot: Msn
     Bot: Google
     (57) guests
     (20) repeated

    How is this done?


    Popular Web Sites

      FogBugz Hosting Plans
      SubVersion Hosting Plans
      SourceGear Vault
      Hosting Plans

      Note Thing - A Perfect
      To-Do List Software
      .net Localization
      components from SWBOX

      Mary Kay Products

    Admin's Toolbox

    Web Database Management
    Web Site Statistics
    Survey Manager
    Integrated forum for webpages
    OpenSource WebSite Framework


      privacy policy , license , disclaimer , © 2000-2004, 2eNetWorX.   [page generated in 31 ms.]