Localytics events.

master
Nick Sergeant 2015-07-17 12:59:52 -04:00
parent b8dd4336be
commit f1e9ce6702
4 changed files with 28 additions and 1 deletions

View File

@ -37,6 +37,16 @@ jQuery(function($) {
root.app = app;
if (root.location.pathname === '/account/stats/') {
root.ll('tagEvent', 'Viewed stats page');
}
if (root.location.pathname === '/pro/') {
root.ll('tagEvent', 'Viewed Pro page');
}
if (root.location.pathname === '/pro/signup/') {
root.ll('tagEvent', 'Viewed Pro signup page');
}
app.controller('AppController', function($scope) {
$scope.ads = [
{

View File

@ -55,6 +55,8 @@
copy: function() {
window.ll('tagEvent', 'Copied snipt');
$('textarea', this.$copyModal).remove();
window.ui_halted = true;
@ -84,6 +86,8 @@
},
edit: function(adding) {
window.ll('tagEvent', 'Edited snipt');
window.editing = true;
window.ui_halted = true;
@ -255,6 +259,8 @@
},
embed: function() {
window.ll('tagEvent', 'Embedded snipt');
$('textarea', this.$embedModal).remove();
window.ui_halted = true;
@ -314,6 +320,7 @@
success: function() {
that.$el.removeClass('favorited');
that.$favorite.text('Favorite');
window.ll('tagEvent', 'Unfavorited snipt');
},
headers: {
'Authorization': 'ApiKey ' + window.user + ':' + window.api_key
@ -328,6 +335,7 @@
that.$el.addClass('favorited');
that.model.set({'favorite_id': resp.id}, {'silent': true});
that.$favorite.text('Favorited');
window.ll('tagEvent', 'Favorited snipt');
},
headers: {
'Authorization': 'ApiKey ' + window.user + ':' + window.api_key
@ -655,6 +663,8 @@
},
addNewSnipt: function() {
window.ll('tagEvent', 'Added snipt');
var $articleNewSnipt = $('article#new-snipt');
if ($articleNewSnipt.length === 0) {

View File

@ -20,6 +20,11 @@
$scope.$root.account = response.data;
$scope.$root.$watch('account.list_view', function(newView, oldView) {
if (oldView !== newView) {
if (newView === 'N') {
window.ll('tagEvent', 'Switched to normal view');
} else {
window.ll('tagEvent', 'Switched to compact view');
}
AccountStorage.saveAccount($scope.$root.account, ['list_view']).then(function(response) {
$scope.$root.account = response.data;
});

View File

@ -7,7 +7,9 @@
(s = y.createElement(t)).type = 'text/javascript';
s.src = '//web.localytics.com/v3/localytics.js';
(c = y.getElementsByTagName(t)[0]).parentNode.insertBefore(s, c);
ll('init', 'a62d3f2d950818261a89f2f-70c7cac4-2c9f-11e5-de49-00f078254409', {} /* Options */);
ll('init', 'a62d3f2d950818261a89f2f-70c7cac4-2c9f-11e5-de49-00f078254409', {
trackPageView: true
} /* Options */);
}(window, document, 'script', 'll');
</script>
<script type="text/javascript">