@@ -38,6 +38,7 @@ define(function (require, exports, module) {
3838 Strings = require ( "strings" ) ,
3939 StringUtils = require ( "utils/StringUtils" ) ,
4040 ThemeManager = require ( "view/ThemeManager" ) ,
41+ Metrics = require ( "utils/Metrics" ) ,
4142 proUpgradeHTML = require ( "text!./html/pro-upgrade.html" ) ,
4243 proEndedHTML = require ( "text!./html/promo-ended.html" ) ;
4344
@@ -51,9 +52,12 @@ define(function (require, exports, module) {
5152 } ) ) ;
5253 Dialogs . showModalDialogUsingTemplate ( $template ) . done ( function ( id ) {
5354 console . log ( "Dialog closed with id: " + id ) ;
55+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgShow" , "promo" ) ;
5456 if ( id === 'secondaryButton' ) {
55- // todo add metrics
57+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgAct" , "promoLearn" ) ;
5658 Phoenix . app . openURLInDefaultBrowser ( brackets . config . purchase_url ) ;
59+ } else {
60+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgAct" , "promoCancel" ) ;
5761 }
5862 } ) ;
5963 }
@@ -69,9 +73,12 @@ define(function (require, exports, module) {
6973 } ) ) ;
7074 Dialogs . showModalDialogUsingTemplate ( $template ) . done ( function ( id ) {
7175 console . log ( "Dialog closed with id: " + id ) ;
76+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgShow" , "localUpgrade" ) ;
7277 if ( id === 'ok' ) {
73- // todo add metrics
78+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgAct" , "localGetPro" ) ;
7479 Phoenix . app . openURLInDefaultBrowser ( brackets . config . purchase_url ) ;
80+ } else {
81+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgAct" , "localCancel" ) ;
7582 }
7683 } ) ;
7784 }
@@ -86,8 +93,12 @@ define(function (require, exports, module) {
8693 const $template = $ ( Mustache . render ( proEndedHTML , { Strings, title, buttonGetPro, promoURL} ) ) ;
8794 Dialogs . showModalDialogUsingTemplate ( $template ) . done ( function ( id ) {
8895 console . log ( "Dialog closed with id: " + id ) ;
96+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgShow" , "remoteUpgrade" ) ;
8997 if ( id === 'get_pro' ) {
98+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgAct" , "remoteGetPro" ) ;
9099 Phoenix . app . openURLInDefaultBrowser ( upsellPurchaseURL || brackets . config . purchase_url ) ;
100+ } else {
101+ Metrics . countEvent ( Metrics . EVENT_TYPE . PRO , "dlgAct" , "remoteCancel" ) ;
91102 }
92103 } ) ;
93104 }
0 commit comments