Created new event type for testing

'Outgoing links' is a new event type that excludes outlinks to sca.gmu.edu.

sca.gmu.edu still in Outbound Links

But not in Outgoing Links

The code:

if (el && el.href) { var link = el.href; /* Only if it is an external link */ if (link.indexOf(location.host) == -1 && link.indexOf("sca.gmu.edu") == -1 && !link.match(/^javascript\:/i)) { /* Is actual target set and not _(self|parent|top)? */ var target = (el.target && !el.target.match(/^_(self|parent|top)$/i)) ? el.target : false; /* Assume a target if Ctrl|shift|meta-click */ if (event.ctrlKey || event.shiftKey || event.metaKey || event.which == 2) { target = "_blank"; } var hbrun = false; // tracker has not yet run /* HitCallback to open link in same window after tracker */ var hitBack = function() { /* run once only */ if (hbrun) return; hbrun = true; window.location.href = link; }; if (target) { /* If target opens a new window then just track */ ga( "send", "event", "Outgoing Links", link, document.location.pathname + document.location.search ); } else { /* Prevent standard click, track then open */ event.preventDefault ? event.preventDefault() : event.returnValue = !1; /* send event with callback */ ga( "send", "event", "Outgoing Links", link, document.location.pathname + document.location.search, { "hitCallback": hitBack } ); /* Run hitCallback again if GA takes longer than 1 second */ setTimeout(hitBack, 1000); } } } }

Non-Interaction Events

Example implementation

if (link.indexOf("sca.gmu.edu") == -1) { event.preventDefault ? event.preventDefault() : event.returnValue = !1; /* send event with callback */ ga( "send", "event", "Outgoing Links", link, document.location.pathname + document.location.search, { "hitCallback": hitBack, nonInteraction: true } ); /* Run hitCallback again if GA takes longer than 1 second */ setTimeout(hitBack, 1000); }

Inline javascript implementation

<a href="www.google.com" onclick="ga('send', 'event', 'Google Link', 'Action label', 'Action Value', {'NonInteraction': 1});">link text</a>

Amount of traffic counted by GA and Piwik

library.gmu.edu/about
access log GA page views % of log views
counted by GA
pwik page views % of log views
counted by pwik
2016-04 2795 532 19.034% 505 18.07%
2015-04 1325 227 17.132% 206 15.55%