<% Option Explicit '########################################################### '## COPYRIGHT (C) 2002-2005, Brinkster Site Statistics Corp. '## '## For licensing details, lease read the license.txt file '## included with MetaTraffic or located at: '## http://www.metasun.com/products/metatraffic/license.asp '## '## All copyright notices regarding MetaTraffic '## must remain intact in the scripts and in the '## outputted HTML. All text and logos with '## references to Metasun or MetaTraffic must '## remain visible when the pages are viewed on '## the internet or intranet. '## '## For support, please visit http://www.metasun.com '## and use the support forum. '########################################################### %> <% Dim strScriptDir, strAction, blnExclude, strTarget Dim intTracking : intTracking = Request.Querystring("t") Dim strActionCode : strActionCode = Request.Form("action") Dim strCampaignCode : strCampaignCode = Request.Form("campaign") strScriptDir = Request.Servervariables("script_name") strScriptDir = Left(strScriptDir, InStrRev(strScriptDir, "/")) Dim objReport : Set objReport = New MTReport With ObjReport .Database = aryMTDB .Config = aryMTConfig End With Call CreateDatabaseConnection(1) Dim blnAdmin : blnAdmin = Authenticate(False, aryMTDB(5)) strAction = Request.Form("action") Select Case strAction Case "Exclude Visits" Response.Cookies("mt_exclude") = 1 Response.Cookies("mt_exclude").Path = "/" Response.Cookies("mt_exclude").Expires = DateAdd("m", 24, Date()) Case "Include Visits" Response.Cookies("mt_exclude") = "" Response.Cookies("mt_exclude").Path = "/" End Select If Request.Cookies("mt_exclude") <> "" Then blnExclude = False Else blnExclude = True End If %> Site Statistics
<% Response.Write objReport.SiteName %> <% Response.Write objReport.Version %>
Tracking
Overview
Javascript
Active Server Pages
Campaigns
Redirects
Exclude Visits
<% If blnExclude = True Then %>

Your visits are being tracked.

If you have a dynamic IP address, click the button below to set a cookie that will exclude your visits from being tracked with this browser.

<% Else %>

Your visits are not being tracked.

This browser is currently being excluded from tracking. Click the button below to remove this.


<% End If %>
<% Select Case intTracking %> <% Case 1 %>
Javascript
Overview

Javascript tracking provides a way to track any type of web page including .htm, .html, .php, .aspx, .cfm, etc. Robots cannot be tracked using javascript because they will not execute the javascript code.

Select Action

Actions allow you to track special events on your web site such as a product sale, member signup, etc. If you wish to track an action, make a selection from the drop down menu below and click the Update button.

<% Call DisplayActionsSelect(strActionCode) %>
Tracking Code

Copy and paste the following code into each web page that you would like to track:

More Information

The ideal spot to place your tracking code is at the bottom of each web page before the closing html tag (</html>). For the page title to be automatically inserted, you must place the tracking code after the </title> tag and there must be text in the title tag.

Actions can be configured in the Settings section. When using actions to track events on your web site, enter an amount and order number if available into the tracking code in the designated spots. Entering an amount will allow you to track the sales for each action. Entering an order number ensures that duplicate actions don't occur as Site Statistics will only count a distinct order number for each action. The order number should be unique and can be up to 100 characters long.

<% Case 2 %>
Active Server Pages (ASP)
<% Dim strCode If strAction <> "" Then strCode = "<%" & vbcrlf &_ "Response.Cookies(""mt"")(""pagetitle"") = """" 'INSERT PAGE NAME (OR LEAVE BLANK)" & vbcrlf &_ "Response.Cookies(""mt"")(""action"") = """ & strAction & """ 'ACTION CODE" & vbcrlf &_ "Response.Cookies(""mt"")(""amount"") = """" 'ACTION AMOUNT (LEAVE BLANK OR 0 IF NO AMOUNT)" & vbcrlf &_ "Response.Cookies(""mt"")(""order"") = """" 'INSERT UNIQUE ORDER NUMBER" & vbcrlf &_ "Server.Execute("" & strScriptDir & "track.asp")" & vbcrlf &_ "%>" Else strCode = "<%" & vbcrlf &_ "Response.Cookies(""mt"")(""pagetitle"") = """" 'INSERT PAGE NAME (OR LEAVE BLANK)" & vbcrlf &_ "Server.Execute("" & strScriptDir & "track.asp")" & vbcrlf &_ "%>" End If %> <% If strAction <> "" Then strCode = "<%" & vbcrlf &_ "Response.Cookies(""mt"")(""pagetitle"") = """" 'INSERT PAGE NAME (OR LEAVE BLANK)" & vbcrlf &_ "Response.Cookies(""mt"")(""action"") = """ & strAction & """ 'ACTION CODE" & vbcrlf &_ "Response.Cookies(""mt"")(""amount"") = """" 'ACTION AMOUNT (LEAVE BLANK OR 0 IF NO AMOUNT)" & vbcrlf &_ "Response.Cookies(""mt"")(""order"") = """" 'INSERT UNIQUE ORDER NUMBER" & vbcrlf &_ "%>" & vbcrlf & _ "<!-- #Include Virtual="" & strScriptDir & "track.asp" -->" Else strCode = "<%" & vbcrlf &_ "Response.Cookies(""mt"")(""pagetitle"") = """" 'INSERT PAGE NAME (OR LEAVE BLANK)" & vbcrlf &_ "%>" & vbcrlf & _ "<!-- #Include Virtual="" & strScriptDir & "track.asp" -->" End If %>
Overview

Using ASP is the optimal way to track your web pages. It allows you to track robots accessing your web pages which javascript will not. The only limitation with using ASP tracking is that you will not collect screen area data from your visitors.

Select Action

Actions allow you to track special events on your web site such as a product sale, member signup, etc. If you wish to track an action, make a selection from the drop down menu below and click the Update button.

<% Call DisplayActionsSelect(strActionCode) %>
Tracking Code

To track your .ASP files, add the following code to any .ASP page that you want to track:

You can also use a standard include in your asp pages like this:

More Information

The ideal spot to place your tracking code is at the bottom of each web page.

Actions can be configured in the Settings section. When using actions to track events on your web site, enter an amount and order number if available into the tracking code in the designated spots. Entering an amount will allow you to track the sales for each action. Entering an order number ensures that duplicate actions don't occur as Site Statistics will only count a distinct order number for each action. The order number should be unique and can be up to 100 characters long.

<% Case 3 %>
Redirects

You can track files that aren't web pages by linking to them in your web page with HTML. This is useful for tracking downloads, media files, etc.

Here is an example of how to link to a file and track it:

<% Case 4 %>
Campaigns
<% If strCampaignCode <> "" Then %> <% End If %>
Overview

This will help you to generate links to track campaigns you have setup in the Settings section. Select the campaign you want from the drop down menu below and press the update button.

<% Call DisplayCampaignsSelect(strCampaignCode) %>
Campaign Tracking Links

Here are some examples of how to link to your site and track a campaign:

Linking to your home page:

Linking to a specific page on your web site:

In the example above, replace the "somedirectory" and "somepage.html" with the actual directory and filename of where you want to send the visitor.

<% Case Else '0 %>
Overview

To track activity on your web site, you will need to insert tracking code on each web page. There are three different types of tracking code:

To setup web site tracking, follow these steps:

  1. Choose a tracking method
  2. Copy the code and paste it into your web pages
<% End Select %>
© Copyright 2007, Brinkster Site Statistics, powered by MetaTraffic
 
<% Sub DisplayActionsSelect(strCode) Dim strSelected Dim strSql : strSql = "SELECT a_code, a_name " &_ "FROM " & aryMTDB(5) & "Actions " If aryMTDB(0) = "MSSQL" Then strSql = strSql & "WHERE a_display = 1" Else strSql = strSql & "WHERE a_display = -1" End If Dim rsAction : Set rsAction = Server.CreateObject("ADODB.Recordset") rsAction.Open strSql, objConn, 1, 2, &H0001 With Response .Write ("") .Write ("") Do While Not rsCampaign.Eof If strCode = rsCampaign(0) Then strSelected = " selected" Else strSelected = "" End If strName = rsCampaign(1) If strName = "" Then strName = rsCampaign(0) End If .Write ("") rsCampaign.Movenext Loop End With rsCampaign.Close : Set rsCampaign = Nothing End Sub Set objReport = Nothing Call CloseDatabaseConnection() %>