< web  portfolio >

Brenda C. Mondragon

< Main Page >


ASP.NET :: Link Tracker


Link Tracking application in ASP.NET that can track incoming or outgoing links from a site and produce charts, reports or downloadable stats.


This link tracking application provides a management back-end for creating and editing tracking links to be used for web advertising campaigns (e.g. AdWords, site advertisement links) or even other purposes (e.g. e-mail campaigns, outgoing links from the site). On the front-end, a user clicking on a tracked link is transparently forwarded to the defined end URL.

General and detailed stats and reports are produced for all tracking links or by individual tracked link. These include such stats as clicks per week, by group, or number of clicks from a remote host or clicks within an hour's time (to help spot pay-per-click fraud attempts).


Sample code:


private void displayTrackLinks(int intTheID, int intGroupID)
{
this.phList_TrackLinks.Visible = true;
WebSite.DB DB = new WebSite.DB();
SqlDataReader _dr = DB.GetTrackLinkList(intTheID, intGroupID);
if
(!(_dr.Read()))
{
if (!(_dr.IsClosed)) { _dr.Close(); }
//do something if nothing was found
ltlMsg.Text = "<div align=\"center\">No tracking link(s) data was found.</div>\n";
}
else
{
if (!(_dr.IsClosed)) { _dr.Close(); }
_dr
= DB.GetTrackLinkList(intTheID, intGroupID);
DataSet oDS = Utilities.ConvertDataReaderToDataSet(_dr);
//add a column to the dataset to contain the total number
DataColumn dtCol = new DataColumn(); dtCol.ColumnName = "total"; oDS.Tables[0].Columns.Add(dtCol);
DataRowCollection oDRC = oDS.Tables[0].Rows;
foreach
(DataRow row in oDRC)
{
//get the total number
int thisID = Convert.ToInt32(row["id"]);
string
strTotal = this.getTotal(thisID,0);
if
(strTotal != string.Empty)
{
Double dblFileSize
= Convert.ToDouble(strTotal);
strTotal = dblFileSize.ToString("N0");
}
else { strTotal = "0"; }
row[
"total"] = strTotal;
Trace.Warn("default.aspx","row[total] " + row["total"].ToString());
}
this.rptList_TrackLinks.DataSource = oDS;
this
.rptList_TrackLinks.DataBind();
_dr.Close();
}
}
...

Categories:



< Main Page >

This portfolio powered by Blosxom

All content Copyright © 1995 - 2024 Brenda C. Mondragon