Fourth variable is 'SD_Tut_TimeOffset'. It contains a numeric value of the number of hours which will be added to date and time on the server before SD_Tut_Track stored procedure is called. The reason I decided to add a time (zone) offset variable is that if the server of your website is located in US, for example, it will mark the start and end of the day according to the time zone on the server which will be the US (Eastern or Western, or whatever is set by the server administrator) time zone. But, if for example's sake, you want to use UK's (GMT) time to mark the start and end of the day, then you should set the value of this variable to "-5" (with the assumption that US EST is GMT-5). And to give you another example, if your server is in UK (GMT) and you want to use CET (Central European Time), then you should set the value of this variable to "+1" (GMT+1). I hope you have understood what this variable is all about and how to use it in your application.
Tip: If you don't care about what time zone is used to mark the start and end of the day, don't change it's default value of "+0".
Fifth and the last variable is 'SD_Tut_WebSiteName', the value of which is the name of your website. Again, the value of this variable/constant is trivial. On Stardeveloper.com, I set it to "Stardeveloper.com", which then appears in the reports as is shown in this image:

Next item in Web.config file is "connectionStrings". It contains one or more connection strings. Connection strings if you don't know what they are, are regular strings (text) which contain key value pairs of data like name of server, name of database, and user name/password required for authentication. The default value which this Web.config file contains key names with 'equal to' ("=") signs after them, separated by semi-colons (";"). You should insert appropriate values of your server name (insert a . (dot) if the database server resides on the same machine ASP.NET page resides on), database name, and username/password to correctly connect to your database. The last attribute is 'providerName' which for SQL Server is "System.Data.SqlClient".
<connectionStrings>
<add name="SD_Tut_TrackerDB"
connectionString="server=;database=;user id=;password="
providerName="System.Data.SqlClient"/>
</connectionStrings>
The last segment of Web.config file is system.web, the items of which are not required for our ASP.NET Tracker application to work. The default values that this Web.config file contains can be edited or removed as you desire.
Ok, this is all that I wanted to say about Web.config file.
Global.asax
Next file is Global.asax file. It took it's name from Global.asa file of Classic ASP pages, which contained subs (methods) for Application and Session startup and closing down events. Same level of events have been maintained for ASP.NET and the file is now called Global.asax.
Create a new text file in Notepad and copy/paste following code in it. Then save it in the root folder of your ASP.NET application as "Global.asax":
<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
// Caching the tracker image in memory
byte[] trackerImg = File.ReadAllBytes(
Context.Request.MapPath(
ConfigurationManager.AppSettings[
"SD_Tut_ImageFileLocation"]));
Application[ConfigurationManager.AppSettings[
"SD_Tut_ImageFileKeyName"]] = trackerImg;
}
</script>
Explanation
The first line sets the language that we will use in Global.asax file to "C#".
<%@ Application Language="C#" %>
Since we are going to be reading the 43 bytes trans.gif (transparent 1x1 GIF file) and storing it in the Application object in memory, we will be using the File class of System.IO namespace. We import this namespace with following declaration:
<%@ Import Namespace="System.IO" %>
Finally, we make use of Application_Start() method which will be called by ASP.NET runtime engine at the start up of this ASP.NET application before any request is handled by the ASP.NET page. Thus storing the trans.gif file in memory at this stage will mean that this trans.gif file in-memory data will be available to track.aspx ASP.NET page to service requests to our Tracker.
In this method, we first of all read all the bytes of trans.gif file into a local byte array. The path trans.gif file is retrieved from is obtained from the "SD_Tut_ImageFileLocation" variable we placed in the Web.config file earlier in this tutorial. Next, we push this small byte array into an Application level variable, where it will be stored in peace, ready to be used by the track.aspx page to be sent to the client browsers.
Note: It is not strictly necessary for us to cache trans.gif file. But we do this to avoid the hard disk reads every time our tracker will receive a request by the client browser. Caching such small files which are updated infrequently (and not at all in trans.gif file's case) improves the performance of ASP.NET application by a good deal.
We are now done with Global.asax file.
track.aspx
Beginning with track.aspx page, we will now be developing ASP.NET pages and their back-end code files. This track.aspx page will be the one that will be called by <img> tags that we will insert in the pages we want to be tracked. So, this single ASP.NET page (and it's back-end class file) is the most important ASP.NET page in this ASP.NET Tracker application.
Open Notepad and create a new text file. Copy/paste following code in it and then save it as "track.aspx" in the folder of your ASP.NET application.
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="track.aspx.cs" Inherits="_Track" %>
Explanation
All this page contains is a Page level directive that directs all the processing to it's base class _Track which is contained in the "track.aspx.cs" file.
track.aspx.cs
Now we need to code the backend _Track class file for our track.aspx page. For this, open Notepad and create a new text file. Copy/paste following code in it and then save it as "track.aspx.cs".
Note: The code for this and coming ASP.NET pages and back-end class files will not be possible to be fully accommodated on any single page of this tutorial. Thus when you are asked to copy their code, you should copy the one present in this page to the Note pad, and then move to the next page to copy the remaining code from there to paste it below the previous code. Repeat this procedure if code continues further on the next page.