Skip to content

Commit 1fee7e1

Browse files
committed
Track download link
1 parent dc7ef7d commit 1fee7e1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/scripts/controllers/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
angular.module('angularGoogleMapsApp')
4-
.controller('MainCtrl', function ($scope, $github, $log) {
4+
.controller('MainCtrl', function ($scope, $github, $log, analytics) {
55

66
var DOWNLOAD_URL_TEMPLATE = 'https://raw.github.com/nlaplante/angular-google-maps/%REF%/dist/angular-google-maps.min.js',
77
FALLBACK_BRANCH = 'master';
@@ -21,6 +21,10 @@ angular.module('angularGoogleMapsApp')
2121
}
2222
};
2323

24+
$scope.dlClick = function () {
25+
analytics.trackEvent('click', 'download');
26+
};
27+
2428
$github.getTags().then(function (data) {
2529
$scope.latestTag = data && data.length ? data[0] : {};
2630
$scope.downloadUrl = DOWNLOAD_URL_TEMPLATE.replace('%REF%', $scope.latestTag.name);

app/views/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1 class="page-header" itemprop="name">Google Maps for AngularJS</h1>
99
into your applications.
1010
</p>
1111

12-
<a class="btn btn-success btn-sm" rel="external" ng-href="{{ downloadUrl }}">
12+
<a class="btn btn-success btn-sm" rel="external" ng-href="{{ downloadUrl }}" ng-click="dlClick()">
1313
Download (<span itemprop="softwareVersion">{{ latestTag.name }}</span>)
1414
</a>
1515

0 commit comments

Comments
 (0)