gaAddons v2.0® - Google Analytics addons
gaAddons® is a collection of useful enhancements to extend and improve upon the default Google Analytics implementation. It actually leverage the popular jQuery lightweight JavaScript library.
Current stable version: 2.0.7
Current beta version: 2.0.8
Last updated:
2010-09-03 10:29
What's new in v2.0.7?
Upcoming
There are a number of ideas and upcoming features - use the Feedback tab on the right to share your ideas!
Integration gaAddons® to your site should be a snap!
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-XXXXX-X'],
['_trackPageview']
);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script>gaAddons® is dependent on the jQuery library but maybe your site already use it. In any case, if jQuery isn't already loaded, gaAddons will automatically add it for you.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-XXXXX-X'],
['_trackPageview']
);
var gaAddons = gaAddons || [];
gaAddons.push(
// put gaAddons calls here
);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
var gaAddons = document.createElement('script'); gaAddons.type = 'text/javascript'; gaAddons.async = true;
gaAddons.src = 'gaAddons-2.0.min.js';
s.parentNode.insertBefore(gaAddons, s);
})();
</script>
gaAddons.push(['_options', {
debug: true, // show console information as gaAddons is working
autoload: true, // automatically load jQuery if it's not there
timeout: 100, // delay between retries to check if all depencencies are loaded
jQuerySrc: 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' // URL of jQuery library
}]);
gaAddons.push(['_trackOutbound', {
onBounce: false,
method: 'event',
category: 'outbound',
action: 'click',
value: 0,
include: /./,
exclude: /^$/,
tracker: _gaq
}]);
gaAddons.push(['_trackDownloads', {
onBounce: false,
method: 'page',
category: 'download',
action: 'click',
value: 0,
include: /\.(docx*|xlsx*|pptx*|exe|rar|zip|pdf|xpi|mp3)$/i,
exclude: /^$/,
tracker: _gaq
}]);
gaAddons.push(['_trackMailto', {
onBounce: false,
method: 'event',
category: 'mailto',
value: 0,
include: /./,
exclude: /^$/,
tracker: _gaq
}]);
gaAddons.push(['_trackRealBounce', {
onBounce: false,
method: 'event',
category: 'NoBounce',
value: 0,
delay: 30,
include: /./,
exclude: /^$/,
tracker: _gaq
}]);
gaAddons.push(['_trackLoadTime', {
onBounce: false,
category: 'loadTime',
bucket: [100, 500, 1500, 2500, 5000],
time: (new Date()).getTime(),
value: 0,
include: /./,
exclude: /^$/,
tracker: _gaq
}]);
gaAddons.push(['_trackError', {
method: 'event',
category: 'error',
action: '404',
value: 0,
include: /404.htm/, // mandatory
exclude: /^$/,
tracker: _gaq
}]);
gaAddons.push(['_4Q', {
account: 'sdfc account ID provided by 4Q', // mandatory
tracker: _gaq,
allowLinker: true,
domainName: 'none',
...
}]);

gaAddons.push(['_setDayOfWeek', {
onBounce: false,
index: 1,
name: 'DayOfWeek',
value: null,
scope: 2,
days: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
include: /./,
exclude: /^$/,
tracker: _gaq
}]);

gaAddons.push(['_setHourOfDay', {
onBounce: false,
index: 2,
name: 'HourOfDay',
value: (new Date()).getHours(),
scope: 2,
include: /./,
exclude: /^$/,
tracker: _gaq
}]);
Unless mentionned as MANDATORY, you don't have to specify any option if you want to use the default values.
Share ideas, ask questions or report problems.
Please note any support request where gaAddons® is not at fault will be billable.
Only authorized consultants and agencies will receive email support, all other requests should be done through GetSatisfaction.
Hint: Use the Web Analytics Solution Profiler (WASP), to see gaAddons® calls firing and the data being sent to Google Analytics.
gaAddons® by Stéphane Hamel is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.Simply put, I don't want consultants & agencies to use my work and make money out of it without being fairly compensated. When I created the Excel Dashboard sample I realized consultants & agencies started to use it, saved a lot of time by leveraging my work, and charged their clients... With WASP, a similar situation happened - consultants consistently used the free version without ever paying a license.
Please be fair, if you find gaAddons® useful, contribute or request a waiver if you are a consultant or agency.