am 86028756: am 46c5804c: add analytics tracking event for sdk/ndk downloads

* commit '860287560db20e6f46a282284d8a04d5e001d2ea':
  add analytics tracking event for sdk/ndk downloads
This commit is contained in:
Scott Main 2012-10-03 17:40:45 -07:00 committed by Android Git Automerger
commit ded6dc0137

View file

@ -87,7 +87,8 @@
<tr>
<td>Windows</td>
<td>
<a href="http://dl.google.com/android/ndk/<?cs var:ndk.win_download ?>"><?cs var:ndk.win_download ?></a>
<a onClick="_gaq.push(['_trackEvent', 'Tools', 'Download NDK', 'Link <' + <?cs var:ndk.win_download ?> + '>']);"
href="http://dl.google.com/android/ndk/<?cs var:ndk.win_download ?>"><?cs var:ndk.win_download ?></a>
</td>
<td><?cs var:ndk.win_bytes ?> bytes</td>
<td><?cs var:ndk.win_checksum ?></td>
@ -95,7 +96,8 @@
<tr class="alt-color">
<td>Mac OS X (intel)</td>
<td>
<a href="http://dl.google.com/android/ndk/<?cs var:ndk.mac_download ?>"><?cs var:ndk.mac_download ?></a>
<a onClick="_gaq.push(['_trackEvent', 'Tools', 'Download NDK', 'Link <' + <?cs var:ndk.mac_download ?> + '>']);"
href="http://dl.google.com/android/ndk/<?cs var:ndk.mac_download ?>"><?cs var:ndk.mac_download ?></a>
</td>
<td><?cs var:ndk.mac_bytes ?> bytes</td>
<td><?cs var:ndk.mac_checksum ?></td>
@ -103,7 +105,8 @@
<tr>
<td>Linux 32/64-bit (x86)</td>
<td>
<a href="http://dl.google.com/android/ndk/<?cs var:ndk.linux_download ?>"><?cs var:ndk.linux_download ?></a>
<a onClick="_gaq.push(['_trackEvent', 'Tools', 'Download NDK', 'Link <' + <?cs var:ndk.linux_download ?> + '>']);"
href="http://dl.google.com/android/ndk/<?cs var:ndk.linux_download ?>"><?cs var:ndk.linux_download ?></a>
</td>
<td><?cs var:ndk.linux_bytes ?> bytes</td>
<td><?cs var:ndk.linux_checksum ?></td>
@ -147,7 +150,7 @@
<tr>
<td rowspan="2">Windows</td>
<td>
<a onclick="onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_download
<a onclick="onDownload(this,false)" href="http://dl.google.com/android/<?cs var:sdk.win_download
?>"><?cs var:sdk.win_download ?></a>
</td>
<td><?cs var:sdk.win_bytes ?> bytes</td>
@ -156,7 +159,7 @@
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="onDownload(this)" id="win-sdk" href="http://dl.google.com/android/<?cs
<a onclick="onDownload(this,false)" id="win-sdk" href="http://dl.google.com/android/<?cs
var:sdk.win_installer
?>"><?cs var:sdk.win_installer ?></a> (Recommended)
</td>
@ -166,7 +169,7 @@ var:sdk.win_installer
<tr class="alt-color">
<td>Mac OS X (intel)</td>
<td>
<a onclick="onDownload(this)" id="mac-sdk" href="http://dl.google.com/android/<?cs
<a onclick="onDownload(this,false)" id="mac-sdk" href="http://dl.google.com/android/<?cs
var:sdk.mac_download
?>"><?cs var:sdk.mac_download ?></a>
</td>
@ -176,7 +179,7 @@ var:sdk.mac_download
<tr>
<td>Linux (i386)</td>
<td>
<a onclick="onDownload(this)" id="linux-sdk" href="http://dl.google.com/android/<?cs
<a onclick="onDownload(this,false)" id="linux-sdk" href="http://dl.google.com/android/<?cs
var:sdk.linux_download
?>"><?cs var:sdk.linux_download ?></a>
</td>
@ -187,12 +190,18 @@ var:sdk.linux_download
<script>
function onDownload(link) {
function onDownload(link,fromButton) {
$("#filename").text($(link).html());
$("#next-steps").fadeIn('slow');
$("#intro").fadeOut('slow');
$('.pax').slideUp();
$('.reqs').slideUp();
// Deliver Analytics event
if (fromButton) {
_gaq.push(['_trackEvent', 'Tools', 'Download SDK', 'Button <' + text($(link).html()) + '>']);
} else {
_gaq.push(['_trackEvent', 'Tools', 'Download SDK', 'Link <' + text($(link).html()) + '>']);
}
}
@ -213,7 +222,7 @@ var:sdk.linux_download
$('#not-supported').hide();
$('#download-button').show();
$('#download-button').text("Download the SDK for " + os);
$('#download-button').click(function() {onDownload($link.get());}).attr('href', $link.attr('href'));
$('#download-button').click(function() {onDownload($link.get());}).attr('href', $link.attr('href'),true);
} else {
$('.pax').show();
}