// gaAddons FREE v1.0, Copyright 2011, Stephane Hamel - http://gaAddons.com
// Licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License
// gaAddons FREE v1.0, Copyright 2011, Stéphane Hamel - http://gaAddons.com
// gaAddons by Stéphane Hamel is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
// This code is provided as is, without guarantee or support.
///////////////////
// _formAnalysis: not provided - use ClickTale!
///////////////////
// _setDayOfWeek: obsolete - this metric is available within GA
///////////////////
// _setDualMode: not provided - refer to _setLocalRemoteServerMode documentation on GA website
///////////////////
// _setXDomain: multiple top domains & sub-domains
var crossDomains = '(mysite.com|myothersite.com)'; // regex matching the list of top domains you own
var baseDomain = location.hostname.match(RegExp(crossDomains + '$'));
baseDomain = (baseDomain ? baseDomain[1].replace(/\:\d+/, '') : location.hostname);
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-99999999-9']); // change the UA account!
_gaq.push(['_setDomainName', baseDomain]);
_gaq.push(['_setAllowLinker', true]);
(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';
s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
jQuery(document).ready(function($) {
// for any link starting with http, but not pointing to the current domain or any of its subdomains, but matching one of our tracked domains...
$('a:regex(href,^http[^/]+' + crossDomains + ')').live('click', function(e) {
if (this.href.match(crossDomains)[1] != baseDomain) {
var t = _gat._getTrackerByName();
this.href = t._getLinkerUrl(this.href);
}
});
});
///////////////////
//...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.