Sending more events to Leanplum.

This commit is contained in:
Brendon Duncan 2018-09-13 11:56:18 +12:00
commit 28ce4d302d
11 changed files with 56 additions and 13 deletions

View file

@ -45,7 +45,7 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu
}
var log = new window.BitAnalytics.LogEvent("contact_created", [{
"coin": $scope.addressbookEntry.coin
}], [channel]);
}], [channel, 'leanplum']);
window.BitAnalytics.LogEventHandlers.postEvent(log);
$timeout(function() {

View file

@ -705,7 +705,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
"type": "outgoing",
"amount": $scope.amount,
"fees": $scope.fee
}], [channel, "adjust"]);
}], [channel, 'adjust', 'leanplum']);
window.BitAnalytics.LogEventHandlers.postEvent(log);
$timeout(function() {

View file

@ -82,7 +82,7 @@ angular.module('copayApp.controllers').controller('preferencesNotificationsContr
}
var log = new window.BitAnalytics.LogEvent("settings_email_notification_toggle", [{
"toggle": $scope.emailNotifications.value
}], [channel]);
}], [channel, 'leanplum']);
window.BitAnalytics.LogEventHandlers.postEvent(log);
};

View file

@ -4,7 +4,7 @@ angular
.module('copayApp.controllers')
.controller('reviewController', reviewController);
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
function reviewController(addressbookService, bitAnalyticsService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
var vm = this;
vm.buttonText = '';
@ -65,6 +65,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
var destinationWalletId = '';
var lastTxId = '';
var originWalletId = '';
var personalNoteWasBlank = true;
var priceDisplayIsFiat = true;
var satoshis = null;
var toAddress = '';
@ -156,6 +157,10 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
return;
}
if (personalNoteWasBlank && vm.memo && vm.memo.length > 0) {
bitAnalyticsService.postEvent('transfer_adds_memo', [], ['leanplum']);
}
ongoingProcess.set('creatingTx', true, statusChangeHandler);
getTxp(lodash.clone(tx), vm.originWallet, false, function(err, txp) {
ongoingProcess.set('creatingTx', false, statusChangeHandler);
@ -534,6 +539,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
tx.toAddress = shapeshiftData.toAddress;
vm.memo = 'ShapeShift Order:\nhttps://www.shapeshift.io/#/status/' + shapeshiftData.orderId;
vm.memoExpanded = !!vm.memo;
personalNoteWasBlank = !vm.memo;
ongoingProcess.set('connectingShapeshift', false);
cb();
}
@ -803,7 +809,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
"type": "outgoing",
"amount": amount,
"fees": vm.feeCrypto
}], [channel, "adjust"]);
}], [channel, "adjust", 'leanplum']);
window.BitAnalytics.LogEventHandlers.postEvent(log);
$timeout(function() {

View file

@ -40,7 +40,7 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
});
};
$scope.shapeshift = function() {
$scope.shapeshift = function() {
var stateParams = {
thirdParty: {
id: 'shapeshift'

View file

@ -154,7 +154,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
var log = new window.BitAnalytics.LogEvent("transfer_success", [{
"coin": $scope.wallet.coin,
"type": "incoming"
}], [channel, "adjust"]);
}], [channel, "adjust", 'leanplum']);
window.BitAnalytics.LogEventHandlers.postEvent(log);
if ($state.current.name === "tabs.receive") {

View file

@ -52,7 +52,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
if (platformInfo.isCordova) {
channel = "firebase";
}
var log = new window.BitAnalytics.LogEvent("wallet_details_open", [], [channel]);
var log = new window.BitAnalytics.LogEvent("wallet_details_open", [], [channel, 'leanplum']);
window.BitAnalytics.LogEventHandlers.postEvent(log);
$scope.openExternalLink = function(url, target) {

View file

@ -0,0 +1,39 @@
'use strict';
(function(){
angular
.module('bitcoincom.services')
.factory('bitAnalyticsService', bitAnalyticsService);
function bitAnalyticsService(platformInfo) {
var service = {
postEvent: postEvent
};
var defaultChannels = ['ga'];
if (platformInfo.isCordova) {
defaultChannels = 'firebase';
}
return service;
/**
* Sends an event to analytics channels.
* @param {string} name - The name of the event.
* @param {Object[]} params - Parameters to send with the event.
* [0] - shared parameters for all channels.
* [1] - parameters for the default channel.
* Subsequent objects are sent with the other channels, in the corresponding order.
* @param {string[]} additionalChannels - Names of more channels to send the event to.
*/
function postEvent(name, params, additionalChannels) {
var allChannels = defaultChannels.concat(additionalChannels);
var log = new window.BitAnalytics.LogEvent(name, params, allChannels);
window.BitAnalytics.LogEventHandlers.postEvent(log);
}
}
})();

View file

@ -26,8 +26,7 @@ angular.module('copayApp.services').factory('buyAndSellService', function(gettex
title: gettextCatalog.getString('Buy Bitcoin'),
name: 'buyandsell',
icon: 'icon-buy-bitcoin2',
sref: 'tabs.buyandsell',
trackingClass: 'track_buy_bitcoin_click'
sref: 'tabs.buyandsell'
});
} else {
servicesService.unregister({

View file

@ -5,8 +5,7 @@ angular.module('copayApp.services').factory('servicesService', function(configSe
name: 'shapeshift',
title: 'Shapeshift',
icon: 'icon-shapeshift',
sref: 'tabs.shapeshift',
trackingClass: 'track_link_click_out'
sref: 'tabs.shapeshift'
}];
root.register = function(serviceInfo) {

View file

@ -6,7 +6,7 @@
</div>
<div ng-show="!hide">
<div ng-repeat="service in services track by $index">
<a ui-sref="{{service.sref}}" id="home_{{service.name}}" title="{{service.title || service.name}}" class="{{service.trackingClass}} item item-sub item-icon-left item-big-icon-left item-icon-right next-step">
<a ui-sref="{{service.sref}}" id="home_{{service.name}}" title="{{service.title || service.name}}" class="track_link_click_out item item-sub item-icon-left item-big-icon-left item-icon-right next-step">
<i class="icon big-icon-svg theme-circle theme-circle-services">
<div class="bg {{service.icon}}"></div>
</i>