(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-127684-2', 'auto'); ga('send', 'pageview'); // Using jQuery Event API v1.3 function gaSendEvent(href, ident, text) { ga('send', 'event', { 'eventCategory' : href, 'eventAction' : ident, 'eventLabel' : text, 'hitCallback' : function () { } }); } $(document).ready(function(){ $(function(){ $("a").on('click', function() { var currentURL = window.location.href; if ($(this).parents('#global-dropdown','.dropdown-menu').length) { gaSendEvent(this.href, 'global-dropdown', $(this).text()); } if ($(this).parents('#footer-global-links').length) { gaSendEvent(this.href, 'global-footer-links', $(this).text()); } if ($(this).parents('#social-stack').length) { gaSendEvent(this.href, 'global-footer-social', $(this).text()); } if ($(this).parents('.footer-buttons').length) { gaSendEvent(this.href, 'global-footer-buttons', $(this).text()); } if ($(this).parents('.footer-disclaimer').length) { gaSendEvent(this.href, 'global-footer-disclaimer-links', $(this).text()); } if ($(this).parents('#main-container','#mainnav').length) { if (this.hostname == $(window.location).attr('hostname')) { gaSendEvent(this.href, "main-container_"+$(this).closest("[id]").attr("id")+'_'+currentURL, $(this).text()); return true; } else { gaSendEvent(this.href, 'outgoing-links_'+$(this).closest("[id]").attr("id")+'_'+currentURL, $(this).text()); } } }); }); });