diff --git a/src/js/controllers/addressbookAdd.js b/src/js/controllers/addressbookAdd.js index a57839aa1..dcdb43b9f 100644 --- a/src/js/controllers/addressbookAdd.js +++ b/src/js/controllers/addressbookAdd.js @@ -35,6 +35,16 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu var translated = bitcoinCashJsService.readAddress(addressbook.address); addressbook.address = translated.legacy; } + + var channel = "firebase"; + if (platformInfo.isNW) { + channel = "ga"; + } + var log = new window.BitAnalytics.LogEvent("contact_created", [{ + "coin": $scope.addressbookEntry.coin + }], [channel]); + window.BitAnalytics.LogEventHandlers.postEvent(log); + $timeout(function() { addressbookService.add(addressbook, function(err, ab) { if (err) { diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index f1fab5b02..03af26fd1 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -643,6 +643,19 @@ angular.module('copayApp.controllers').controller('confirmController', function( soundService.play('misc/payment_sent.mp3'); } + var channel = "firebase"; + if (platformInfo.isNW) { + channel = "ga"; + } + var log = new window.BitAnalytics.LogEvent("transfer_success", [{ + "coin": $scope.wallet.coin, + "type": "outgoing", + "amount": $scope.amount, + "fees": $scope.fee + }], [channel, "adjust"]); + window.BitAnalytics.LogEventHandlers.postEvent(log); + + // Should be removed firebaseEventsService.logEvent('sent_bitcoin', { coin: $scope.wallet.coin }); $timeout(function() { $scope.$digest(); diff --git a/src/js/controllers/preferencesNotifications.js b/src/js/controllers/preferencesNotifications.js index 7351a9f23..edfb983b5 100644 --- a/src/js/controllers/preferencesNotifications.js +++ b/src/js/controllers/preferencesNotifications.js @@ -75,6 +75,15 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr }; emailService.updateEmail(opts); + + var channel = "firebase"; + if (platformInfo.isNW) { + channel = "ga"; + } + var log = new window.BitAnalytics.LogEvent("settings_email_notification_toggle", [{ + "toggle": $scope.emailNotifications.value + }], [channel]); + window.BitAnalytics.LogEventHandlers.postEvent(log); }; $scope.soundNotificationsChange = function() { diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 629e59b51..6c11c2dbd 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -143,6 +143,16 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi } $scope.paymentReceivedCoin = $scope.wallet.coin; + var channel = "firebase"; + if (platformInfo.isNW) { + channel = "ga"; + } + var log = new window.BitAnalytics.LogEvent("transfer_success", [{ + "coin": $scope.wallet.coin, + "type": "incoming" + }], [channel, "adjust"]); + window.BitAnalytics.LogEventHandlers.postEvent(log); + if ($state.current.name === "tabs.receive") { soundService.play('misc/payment_received.mp3'); } diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 88ee871ff..24237f6c9 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -12,6 +12,13 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.isAndroid = platformInfo.isAndroid; $scope.isIOS = platformInfo.isIOS; + var channel = "firebase"; + if (platformInfo.isNW) { + channel = "ga"; + } + var log = new window.BitAnalytics.LogEvent("wallet_details_open", [], [channel]); + window.BitAnalytics.LogEventHandlers.postEvent(log); + $scope.amountIsCollapsible = !$scope.isAndroid; $scope.openExternalLink = function(url, target) { diff --git a/src/js/routes.js b/src/js/routes.js index ee7abba58..63b436a85 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -1232,7 +1232,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }); - var channel = "ga"; + var channel = "firebase"; if (platformInfo.isNW) { channel = "ga"; } diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 25f2a6852..4f8710c28 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -427,6 +427,15 @@ angular.module('copayApp.services') }, function(err, secret) { if (err) return bwcError.cb(err, gettextCatalog.getString('Error creating wallet'), cb); + var channel = "firebase"; + if (platformInfo.isNW) { + channel = "ga"; + } + var log = new window.BitAnalytics.LogEvent("wallet_created", [{ + "coin": opts.coin + }], [channel]); + window.BitAnalytics.LogEventHandlers.postEvent(log); + return cb(null, walletClient, secret); }); });