Closed Bug 592104 Opened 16 years ago Closed 16 years ago

Modify Webtrends Tags to Track Offsite Links

Categories

(www.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: lforrest, Unassigned)

Details

Please make the following 2 changes to the javascript include files of these sites to allow us to track offsite link click information within Webtrends: -Mozilla.com -Mozilla.org -Mozilla-Europe.org -Addons.mozilla.com Step 1 -- Add last line pointed out by the brackets below (do not include brackets) to the following function: WebTrends.prototype.dcsET = function() { var e = (navigator.appVersion.indexOf("MSIE") != -1) ? "click": "mousedown"; this.dcsBind(e, this.dcsDownload); this.dcsBind("contextmenu", this.dcsRightClick); [Add this line START -->] this.dcsBind(e, this.dcsOffsite); [<-- END] } Step 2 – Insert this function AFTER "WebTrends.prototype.dcsSplit=function(list){" function // Code section for Track clicks to links leading offsite. WebTrends.prototype.dcsOffsite=function(evt){ evt=evt||(window.event||""); if (evt&&((typeof(evt.which)!="number")||(evt.which==1))){ var e=this.dcsEvt(evt,"A"); if (e.href){ var hn=e.hostname?(e.hostname.split(":")[0]):""; var pr=e.protocol||""; if ((hn.length>0)&&(pr.indexOf("http")==0)&&!this.dcsIsOnsite(hn)){ var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):""; var pth=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/"; this.dcsMultiTrack("DCS.dcssip", hn, "DCS.dcsuri", pth, "DCS.dcsqry", this.trimoffsiteparams ? "" : qry, "DCS.dcsref", window.location, "WT.ti", "Offsite:" + hn + pth + (qry.length ? ("?" + qry) : ""), "WT.dl", "24", "WT.nv", this.dcsNavigation(evt)); } } } }
This code will also need to be added. Here are an additional 3 steps for a total of 5 modifications. These instructions come via Webtrends - let me know if you have any questions: Modify the base include code: Step 1 -- Add last line of code to the following function: function WebTrends(){ var that=this; // begin: user modifiable this.dcsid="dcsdkzffivz5bduxv7m68vd6u_0000"; this.domain="statse.webtrendslive.com"; this.timezone=-8; this.fpcdom=""; this.adclickparam="WT.ac"; Step 2 – Insert this function AFTER "WebTrends.prototype.dcsFPC=function(){" function // Code section for Generate an Ad View query parameter for every Ad Click link. WebTrends.prototype.dcsAdSearch=function(){ if (document.links){ var param=this.adclickparam+"="; var paramlen=param.length; var paramre=new RegExp(param,"i"); var len=document.links.length; var pos=end=-1; var anch=urlp=value=""; var urlpre; var url=document.URL+""; var start=url.search(paramre); if (start!=-1){ end=url.indexOf("&",start); urlp=url.substring(start,(end!=-1)?end:url.length); urlpre=new RegExp(urlp+"(&|#)","i"); } for (var i=0;i<len;i++){ if (document.links[i].href){ anch=document.links[i].href+""; if (urlp.length>0){ anch=anch.replace(urlpre,"$1"); } pos=anch.search(paramre); if (pos!=-1){ start=pos+paramlen; end=anch.indexOf("&",start); value=anch.substring(start,(end!=-1)?end:anch.length); this.WT.ad=this.WT.ad?(this.WT.ad+";"+value):value; } } } } } Step 3 -- Add the last line to the following function: WebTrends.prototype.dcsAdv=function(){ this.dcsFPC(); this.dcsAdSearch(); }
I can follow these directions to edit the existing js file but I'm concerned about possibly making a mistake. Is regenerating the tag and dropping a new js file in place an option?
Closing this bug - turns out these changes can't be made across all sites at once. Will follow up with David B. and Webtrends.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INCOMPLETE
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.