Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dojox / analytics / Urchin.js @ 12

History | View | Annotate | Download (1.09 KB)

1 9 andrej.cim
/*
2
        Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3
        Available via Academic Free License >= 2.1 OR the modified BSD license.
4
        see: http://dojotoolkit.org/license for details
5
*/
6
7
8
if(!dojo._hasResource["dojox.analytics.Urchin"]){
9
dojo._hasResource["dojox.analytics.Urchin"]=true;
10
dojo.provide("dojox.analytics.Urchin");
11
dojo.declare("dojox.analytics.Urchin",null,{acct:"",constructor:function(_1){
12
this.tracker=null;
13
dojo.mixin(this,_1);
14
this.acct=this.acct||dojo.config.urchin;
15
var re=/loaded|complete/,_2=("https:"==dojo.doc.location.protocol)?"https://ssl.":"http://www.",h=dojo.doc.getElementsByTagName("head")[0],n=dojo.create("script",{src:_2+"google-analytics.com/ga.js"},h);
16
n.onload=n.onreadystatechange=dojo.hitch(this,function(e){
17
if(e&&e.type=="load"||re.test(n.readyState)){
18
n.onload=n.onreadystatechange=null;
19
this._gotGA();
20
h.removeChild(n);
21
}
22
});
23
},_gotGA:function(){
24
this.tracker=_gat._getTracker(this.acct);
25
this.GAonLoad.apply(this,arguments);
26
},GAonLoad:function(){
27
this.trackPageView();
28
},trackPageView:function(_3){
29
this.tracker._trackPageview.apply(this,arguments);
30
}});
31
}