Skip to content

Commit

Permalink
track download events #4
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Mar 19, 2018
1 parent 9ae0641 commit 2bdb150
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
13 changes: 13 additions & 0 deletions _includes/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,18 @@

ga('create', 'UA-47201501-1', 'auto');
ga('send', 'pageview');

/**
* 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>
<!-- End Google Analytics -->
15 changes: 15 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,22 @@
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);
})();

</script>
<script type="text/javascript">
/**
* 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>

<style id="simpler-css-style" type="text/css">
.site-content .entry-header,
Expand Down
9 changes: 6 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
<h2>Download</h2>
<p>The latest version of BEAST 2 is version 2.4.8:</p>
<ul>
<li><a id="windowsDownload" href="https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Windows.zip">Download for Windows</a></li>
<li><a id="macDownload" href="https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Mac.dmg">Download for Mac OS X</a></li>
<li><a id="linuxDownload" href="https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Linux.tgz">Download for Linux</a></li>
<li><a id="windowsDownload" href="https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Windows.zip"
onclick="trackOutboundLink('https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Windows.zip'); return false;">Download for Windows</a></li>
<li><a id="macDownload" href="https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Mac.dmg"
onclick="trackOutboundLink('https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Mac.dmg'); return false;">Download for Mac OS X</a></li>
<li><a id="linuxDownload" href="https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Linux.tgz"
onclick="trackOutboundLink('https://github.com/CompEvol/beast2/releases/download/v2.4.8/BEAST.v2.4.8.Linux.tgz'); return false;">Download for Linux</a></li>
</ul>
<p class="p1">The BEAST 2 source code is available from the <a href="http://www.github.com/CompEvol/beast2">GitHub repository</a>, which produces the latest cutting edge jar file here: <a href="http://hudson.cs.auckland.ac.nz/job/BEAST2/lastSuccessfulBuild/artifact/build/dist/beast.jar">beast.jar</a></p>
<h3>Previous releases and version history</h3>
Expand Down

0 comments on commit 2bdb150

Please sign in to comment.