mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
feat(analytics): Track party buttons
This commit is contained in:
@@ -48,6 +48,7 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
|
|||||||
|
|
||||||
// TODO: refactor guild and party clickLeave into one function
|
// TODO: refactor guild and party clickLeave into one function
|
||||||
$scope.clickLeave = function(group, $event){
|
$scope.clickLeave = function(group, $event){
|
||||||
|
Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Leave Party'});
|
||||||
$scope.selectedGroup = group;
|
$scope.selectedGroup = group;
|
||||||
$scope.popoverEl = $($event.target);
|
$scope.popoverEl = $($event.target);
|
||||||
var html, title;
|
var html, title;
|
||||||
@@ -77,6 +78,7 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.clickStartQuest = function(){
|
$scope.clickStartQuest = function(){
|
||||||
|
Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Start a Quest'});
|
||||||
var hasQuests = _.find(User.user.items.quests, function(quest) {
|
var hasQuests = _.find(User.user.items.quests, function(quest) {
|
||||||
return quest > 0;
|
return quest > 0;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -106,6 +106,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function inviteOrStartParty(group) {
|
function inviteOrStartParty(group) {
|
||||||
|
Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Invite Friends'});
|
||||||
if (group.type === "party" || $location.$$path === "/options/groups/party") {
|
if (group.type === "party" || $location.$$path === "/options/groups/party") {
|
||||||
group.type = 'party';
|
group.type = 'party';
|
||||||
$rootScope.openModal('invite-party', {
|
$rootScope.openModal('invite-party', {
|
||||||
@@ -115,7 +116,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Invite Friends'});
|
|
||||||
$location.path("/options/groups/party");
|
$location.path("/options/groups/party");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user