/** * Class for tracking web events */ /** * Enable Debug Mode on all Hosts except www.community.e-fellows.net, * www.e-fellows.net and limesurvey.e-fellows.net * * No tracking information is sent to Google Analytics if debug mode is enabled. * Instead the event is logged to the Firebug Console window. */ var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1512083-1']); _gaq.push(['_setDomainName', '.e-fellows.net']); _gaq.push(['_addOrganic', 'web.de', 'su']); _gaq.push(['_addOrganic', 'de.forestle.org', 'q']); _gaq.push(['_addOrganic', 'ecosia.org', 'q']); _gaq.push(['_addOrganic', 'suche.t-online.de', 'q']); _gaq.push(['_gat._anonymizeIp']); (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 efnwebtracker = new function() { /** * Tracks a generic Event * Utilizes Google Analytics tracking * * @param category * @param action * @param label * @param event_value */ this.event = function(category, action, label, event_value) { if (event_value === undefined) { _gaq.push(['_trackEvent', category, action, label]); } else { _gaq.push(['_trackEvent', category, action, label, event_value]); } } /** * Tracks a virtual click Event * Utilizes Gooogle Analytics tracking and sets action to 'Klick' * * @param category * @param label */ this.eventclick = function(category, label) { this.event(category, 'Klick', label); } /** * Tracks a virtual Pageview * Utilizes Gooogle Analytics tracking * * @param path */ this.pageview = function(path) { _gaq.push(['_trackPageview', path]); } /** * Handles internal logging * * @param message The message to log */ this.log = function(message) { if (typeof console !== 'undefined') { console.info(message); } } } // Track a pageview everytime this file is loaded efnwebtracker.pageview(document.location.pathname + document.location.search.toLowerCase());