var _gaq = _gaq || []; _gaq.push( ['_setAccount', 'UA-47761645-1'], ['_setDomainName', '.buydomains.com'], ['_setAllowLinker', true], ['_trackPageview'], ['_trackPageLoadTime'] ); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('http:' == document.location.protocol ? 'http://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); /** IP Address tracking for BOT identification */ _gaq.push(['_setCustomVar', 1, 'IP', '54.239.167.92', 1]); /** * custom event and page tracking helper functions */ var customGATracking = { /** track a specific event then redirect to new location if needed */ eventTrack: function(cat,act,val,follow) { if (!follow) var follow = false; _gaq.push(['_trackEvent',cat,act,val]); if (follow !== false) { window.location = follow; return false; } }, /** track a custom page view */ pageTrack: function(uri) { _gaq.push(['_trackPageview', uri]); }, /** track specific links being clicked */ linkEvent : function(cat, act, val, uri) { customGATracking.eventTrack(cat, act, val); setTimeout(function() { window.location = uri; }, 500); return false; }, gaStartTime: false, gaTimer: {'start':0,'end':0}, gaTrackTiming: function(event,category,el,label) { var endTime = new Date().getTime(); var timeSpent = endTime - customGATracking.gaStartTime; ga('send', 'timing', category, el, timeSpent, label); }, gaStartTiming: function() { customGATracking.gaStartTime = new Date().getTime(); }, startTimer: function() { customGATracking.gaTimer['start'] = new Date().getTime(); }, endTimer: function(cat,el) { customGATracking.gaTimer['end'] = new Date().getTime(); var tdiff = customGATracking.gaTimer['end'] - customGATracking.gaTimer['start']; _gaq.push(['_trackTiming',cat,el,tdiff]); } }