washingtonstateuniversity/jTrack — pull request #8 by jeremyBass (2014-10-14 23:05:18+00:00)
Title: Conversion to UA is completed

There are still many things that will be done but this closes #3 and closes #1
Change log:

- general switch to UA
- refactor the options - break compatibility and will be for the 1.0.0

New format is

```js

{
accounts:[{
id:'UA-xxxxxxx-xx',
settings:{}
}],
defaults:{
namedSpace:false, //string
cookieName:false, //string
cookieDomain:window.location.host, //string
cookieExpires:false, //string
cookiePath:'/', //string
autoLink:true, //bool
autoLinkDomains:[], //array
sampleRate:false, //int
displayfeatures:false, //bool
ecommerce:false, //bool
linkid:true, //bool
onload:false //bool
},
debug : false, //bool
clearCampaignUrls:true, //bool
domainName : window.location.host //string
}

```

Example usage is

```js

$.jtrack.defaults.debug = true;

$.jtrack({
analytics:{
accounts:[
{
id:'UA-XXXXXXXX-1',
settings:{
namedSpace:'WSUTestGlobal',
}
}
],
defaults:{
autoLinkDomains:['wsu.edu'],
ecommerce:true,
}
},
events:'track/load.php?load=test'
});

```
This will set up one tracker and names it, and then adds the events to it.

A fuller example:

```js

$.jtrack({
analytics:{
accounts:[{
id:'UA-xxxxxxx-x2',
settings:settings:{
namedSpace:'WSUTestGlobal',
}
},{
id:'UA-xxxxxxx-xx',
settings:{
namedSpace:'siteOnly',
linkid:false,
}
},{
id:'UA-xxxxxxx-xx',
settings:{
ecommerce:true,
}
}],
defaults:{
namedSpace:false, //string
cookieName:false, //string
cookieDomain:window.location.host, //string
cookieExpires:false, //string
cookiePath:'/', //string
autoLink:true, //bool
autoLinkDomains:[], //array
sampleRate:false, //int
displayfeatures:false, //bool
ecommerce:false, //bool
linkid:true, //bool
onload:false //bool
},
debug : false, //bool
clearCampaignUrls:true, //bool
domainName : window.location.host //string
},
events:'track/load.php?load=test'
});
$.jtrack.defaults.debug = true; //note this over rides the first setting called above

```