diff --git a/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js b/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js index 51aaceecf..fabc0b918 100644 --- a/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js +++ b/client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js @@ -10,6 +10,7 @@ function ChooseOrganizationModalController( ahaGuide, createNewSandboxForUserService, errs, + eventTracking, featureFlags, fetchWhitelistForDockCreated, keypather, @@ -38,6 +39,7 @@ function ChooseOrganizationModalController( }; $scope.actions = { + selectedOrg: eventTracking.selectedOrg.bind(eventTracking), selectAccount: function (selectedOrgName) { $state.go('base.instances', { userName: selectedOrgName diff --git a/client/directives/modals/modalChooseOrganization/chooseOrganizationModalView.jade b/client/directives/modals/modalChooseOrganization/chooseOrganizationModalView.jade index c0948e443..668cb157d 100644 --- a/client/directives/modals/modalChooseOrganization/chooseOrganizationModalView.jade +++ b/client/directives/modals/modalChooseOrganization/chooseOrganizationModalView.jade @@ -79,6 +79,7 @@ ) span.grid-block.text-left.text-overflow {{org.oauthName()}} input.checkbox.hidden( + ng-change = "actions.selectedOrg(org.oauthName())" ng-model = "COS.selectedOrgName" value = "{{org.oauthName()}}" type = "radio" @@ -96,9 +97,8 @@ ) //- disabled until an org is selected button.btn.btn-md.green( - ng-click = "\ - actions.createOrCheckDock(COS.selectedOrgName, goToPanel);\ - " + data-event-name = "Org Confirmed" + ng-click = "actions.createOrCheckDock(COS.selectedOrgName, goToPanel)" ng-disabled = "!COS.selectedOrgName" ) Confirm Organization @@ -144,6 +144,7 @@ ng-class = "{'in': isActivePanel()}" ) button.btn.btn-md.green( + data-event-name = "Nav to Runnable (after infrastructure wait)" ng-click = "actions.selectAccount(COS.selectedOrgName)" ) Go to Runnable .grid-block.justify-center.modal-outer-footer( diff --git a/client/directives/ngclick.js b/client/directives/ngclick.js index 3a1415d24..67582e8f6 100644 --- a/client/directives/ngclick.js +++ b/client/directives/ngclick.js @@ -22,6 +22,7 @@ function ngClick( }); eventTracking.trackClicked({ attrs: cleanedAttrs, + eventName: attrs.eventName, text: text }); } diff --git a/client/services/serviceEventTracking.js b/client/services/serviceEventTracking.js index 76158191e..238b08ea9 100644 --- a/client/services/serviceEventTracking.js +++ b/client/services/serviceEventTracking.js @@ -309,7 +309,8 @@ EventTracking.prototype.update = function () { */ EventTracking.prototype.trackClicked = function (data) { var self = this; - self._mixpanel('track', 'clicked - ' + _keypather.get(data, 'text'), data); + + self._mixpanel('track', 'Click', data); self.analytics.ready(function () { self.analytics.track('Click', data); }); @@ -365,6 +366,7 @@ EventTracking.prototype.createdNonRepoContainer = function (containerName) { /** * Track user visit to /orgSelect page * Reports to: + * - mixpanel * - segment * @return this */ @@ -372,12 +374,30 @@ EventTracking.prototype.visitedOrgSelectPage = function () { var self = this; var eventName = 'Visited org-select page'; + self._mixpanel('track', eventName); self.analytics.ready(function () { self.analytics.track(eventName); }); return self; }; +/** + * Track user clicks on an org on the orgSelect page + * Reports to: + * - mixpanel + * @return this + */ +EventTracking.prototype.selectedOrg = function (org) { + var self = this; + var eventName = 'Org Selected'; + + self._mixpanel('track', eventName, { + org: org + }); + return self; +}; + + /** * Track org click on /orgSelect page * Reports to: diff --git a/layout.jade b/layout.jade index 1f2351e5e..15d9e12c3 100644 --- a/layout.jade +++ b/layout.jade @@ -120,12 +120,12 @@ html( (function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" "); for(g=0;g