It is currently Fri Jul 30, 2010 10:55 pm


Free adSense space Give-Away




Post new topic Reply to topic  [ 3 posts ] 
How are outbound referals tracked? 
Author Message

Joined: Sat Jan 31, 2009 4:42 pm
Posts: 6
Post How are outbound referals tracked?
How does MS Gatineau track outbound referals?

I've got the autoTracker feature running for some time now and it works like a dream. Google offers something similar but only tracks links if their javascript is called onClick or when the site linked to also has the Google Trackcode implemented. MS seems to be able to track all outbound links regardless of javascript being called onCLick, or the other site containing their code.

How do they do this?


Sat Jan 31, 2009 4:50 pm
Profile

Joined: Tue Feb 03, 2009 1:07 am
Posts: 3
Post Re: How are outbound referals tracked?
Don't know how they do this, but work like a dream!


Tue Feb 03, 2009 1:13 am
Profile
Site Admin

Joined: Sat Jan 24, 2009 3:17 pm
Posts: 131
Post Re: How are outbound referals tracked?
Microsoft initiates the following code onLoad:
Code:
MicrosoftAnalytics.prototype.AttachLinkEvent=function(){
var mouseEvent="onclick";
for(var i=0;i<document.links.length;i++){
document.links[i].LoggingObject=this;
if(typeof(document.links[i][mouseEvent])!="function"&&document.links[i].href.indexOf("javascript:")<0){document.links[i][mouseEvent]=this.OnTrackLink;
} else{
}
}
};


The OnTrackLink function is called whenever a user clicks a link calling the follwing:

Code:
MicrosoftAnalytics.prototype.OnTrackLink=function(evt){
var srcElement=typeof(event)!="undefined"&&$assertValue(event)?event.srcElement:this;
if(srcElement.tagName!="A"){
do{
srcElement=$assertValue(srcElement.parentElement)?srcElement.parentElement:srcElement.parentNode;
}
while($assertValue(srcElement)&&srcElement.tagName!="A");
}
var loggingObject=srcElement.LoggingObject;
if(loggingObject==null){return true;
} var urlPath=srcElement.pathname;
var dotIndex=urlPath.lastIndexOf(".");
var foundMatch=false;
if(dotIndex>=0){
var fileExt=urlPath.substring(dotIndex+1);
if(srcElement.LoggingObject.Extensions){
foundMatch=loggingObject.Extensions.Find(fileExt)!=null;
}
}
if(!foundMatch&&srcElement.host.indexOf(location.host)>=0){
return true;
} if(!$assertValue(loggingObject.Links)){loggingObject.Links=new List();
loggingObject.Taxonomy.Add("Links","lnk",ListNodeType.Variable);
} loggingObject.Links.Add(srcElement.href,new SimpleLink(srcElement.href,foundMatch?LinkType.Download:LinkType.Outbound));
var eventPayload=loggingObject.SubmitPayload(PayloadType.Link);
if($assertValue(eventPayload)){
loggingObject.ImageRequest(eventPayload);
} if(loggingObject.EnableLinkTimeout==true){loggingObject.PauseLink(loggingObject.LinkTimeout);
} return true;
};


This basically asings all urlPaths clicked to the srcElement object, which is then tracked and sent to the MS analytics database to later show in your data.

This is a very brief explanation of the code found in the javascript (that is loaded in each page to be tracked) but it explains the basics.
Any better explanations are welcome!

_________________
MS Analytics Forum Administrator


Tue Feb 03, 2009 1:31 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.

phpBB SEO