Thursday, January 12, 2006

I checked today and the script I wrote yesterday is working!  I was feeding the entire URI to the tracker which makes the document path show up with the protocol as the folder name in the tool.  I decided to modify the TrackIt function slightly.  I am peeling off the protocol from the link and prepending it with my own folder name to make it easy to distinguish document downloads for other content.

Enjoy!

function TrackIt(link)
{
// Remove the conversion to Lowercase if you are on a Case sensitive web server
var slashes = link.href.indexOf("//") + 2;
var docPath = link.href.toLowerCase().substring(slashes, link.href.length);
urchinTracker(
"/#docs/" + docPath);
}

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):