<script>
/**
* Function that tracks a click on an outbound link in Analytics.
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label. Setting the transport method to 'beacon' lets the hit be sent
* using 'navigator.sendBeacon' in browser that support it.
*/
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>
Then we need to have onclick event on download links that trigger trackOutboundLink function:
Download button pushes to google analytics (with irakli) => we are at least recording even if not showing
Acceptance Criteria
Tasks
Analysis
Useful link: https://support.google.com/analytics/answer/1136920?hl=en
Script to be included on Showcase page:
Then we need to have
onclick
event on download links that triggertrackOutboundLink
function: