Skip to content

Commit 4ca2350

Browse files
committed
add events for tracking primers
1 parent c939939 commit 4ca2350

File tree

6 files changed

+49
-6
lines changed

6 files changed

+49
-6
lines changed

client/controllers/controllerApp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function ControllerApp(
2020
debounce,
2121
demoFlowService,
2222
errs,
23+
eventTracking,
2324
featureFlags,
2425
fetchInstancesByPod,
2526
keypather,
@@ -44,6 +45,10 @@ function ControllerApp(
4445
CA.instancesByPod = instancesByPod;
4546
});
4647

48+
CA.openedFirstAuthPrimer = function () {
49+
eventTracking.openedFirstAuthPrimer();
50+
};
51+
4752
CA.showDemoRepo = function () {
4853
return ahaGuide.isAddingFirstRepo() && !ahaGuide.hasConfirmedSetup() && ahaGuide.hasDemoRepo();
4954
};

client/directives/components/newContainer/newContainerController.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function NewContainerController(
1616
currentOrg,
1717
demoFlowService,
1818
errs,
19+
eventTracking,
1920
fetchInstances,
2021
fetchInstancesByPod,
2122
fetchOwnerRepos,
@@ -74,6 +75,10 @@ function NewContainerController(
7475
loading('newContainerRepos', false);
7576
});
7677

78+
NCC.openedFirstAuthPrimer = function () {
79+
eventTracking.openedFirstAuthPrimer();
80+
};
81+
7782
NCC.fetchTemplateServers = function () {
7883
loading('newContainerTemplates', true);
7984
// Fetch all non-repo containres

client/directives/instances/instance/branchMenuPopover/templateMenuEmptyPopoverView.jade

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
)
77
p.p.text-center To add your own repositories and services, try Runnable with a GitHub team.
88
button.btn.btn-sm.gray.margin-top-xs(
9+
ng-if = "!$root.featureFlags.demoPersistentAddTeam"
910
ui-sref = "orgSelect"
1011
ui-sref-opts = "{reload: true}"
1112
) Switch to a Team
13+
button.btn.btn-sm.gray.margin-top-xs(
14+
internal-modal-helper = "gitHubScopeView"
15+
ng-click = "NCC.openedFirstAuthPrimer()"
16+
ng-if = "$root.featureFlags.demoPersistentAddTeam"
17+
) Open First Auth Primer
1218

1319
.grid-block.align-center.vertical.padding-md.empty(
1420
ng-if = "!NCC.isPersonalAccount()"

client/directives/modals/modalChooseOrganization/chooseOrganizationModalController.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,21 @@ function ChooseOrganizationModalController(
5757

5858
COMC.grantAccess = function (isDemo) {
5959
var loadingString = 'grantAccess';
60-
if (isDemo) {
61-
loadingString = 'grantAccessDemo';
62-
}
63-
6460
var connectionUrl = '/githubAuth';
6561

6662
if (isDemo) {
63+
loadingString = 'grantAccessDemo';
6764
connectionUrl = connectionUrl + '?isDemo=true';
6865
}
66+
67+
// tracking with mixpanel
68+
eventTracking.openedSecondAuthPrimer();
69+
6970
var customWindow = customWindowService(connectionUrl, {
7071
width: 1020, // match github minimum width
7172
height: 660
7273
});
74+
7375
loading.reset(loadingString);
7476
loading(loadingString, true);
7577
COMC.cancelPollingForWhitelisted();

client/directives/navBar/viewNav.jade

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ a.a(
2929
//- without tooltip
3030
//- show during the "add team" step
3131
a.grid-block.align-center.justify-center.shrink.btn-add-team(
32-
data-event-name = "Open First Auth Primer"
3332
ng-click = "CA.demoAddOrg()"
3433
ng-if = "CA.shouldShowTeamCTA() && !$root.featureFlags.demoPersistentAddTeam"
3534
)
@@ -41,7 +40,9 @@ a.grid-block.align-center.justify-center.shrink.btn-add-team(
4140
//- with tooltip
4241
//- show for personal accounts outside the "add team step"
4342
a.grid-block.align-center.justify-center.shrink.btn-add-team(
44-
ng-click = "CA.demoAddOrg()"
43+
data-event-name = "Open First Auth Primer"
44+
internal-modal-helper = "gitHubScopeView"
45+
ng-click = "CA.openedFirstAuthPrimer()"
4546
ng-if = "$root.featureFlags.demoPersistentAddTeam"
4647
tooltip = "Add a team"
4748
tooltip-options = "{\"class\":\"right\",\"left\":42,\"top\":3}"

client/services/serviceEventTracking.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,30 @@ function EventTracking(
631631
return ETS;
632632
};
633633

634+
/**
635+
* Opened auth primer (1)
636+
* Reports to:
637+
* - mixpanel
638+
* @return this
639+
*/
640+
ETS.openedFirstAuthPrimer = function () {
641+
var eventName = 'Opened First Auth Primer';
642+
ETS._mixpanel('track', eventName);
643+
return ETS;
644+
};
645+
646+
/**
647+
* Opened auth primer (2)
648+
* Reports to:
649+
* - mixpanel
650+
* @return this
651+
*/
652+
ETS.openedSecondAuthPrimer = function () {
653+
var eventName = 'Opened Second Auth Primer';
654+
ETS._mixpanel('track', eventName);
655+
return ETS;
656+
};
657+
634658
/**
635659
* Clicked ‘Change Team’
636660
* Reports to:

0 commit comments

Comments
 (0)