Skip to content

Commit

Permalink
feat(analytics): a/b on tour (counter, finish button)
Browse files Browse the repository at this point in the history
  • Loading branch information
lefnire committed Mar 30, 2015
1 parent e0dae01 commit edb50f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion website/public/js/controllers/footerCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl) {
// Google Analytics, only in production
if (window.env.NODE_ENV === 'production') {
// Get experiments API
$.getScript('//www.google-analytics.com/cx/api.js?experiment=OPMHlSzSTj2gVYwUS72wlQ', function(){
$.getScript('//www.google-analytics.com/cx/api.js?experiment=wud1Ba5qT1m9qR3PP0-Mmg', function(){
$rootScope.variant = cxApi.chooseVariation();
$rootScope.$apply();

Expand Down
12 changes: 10 additions & 2 deletions website/public/js/services/guideServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,22 @@ function($rootScope, User, $timeout, $state) {
name: k,
backdrop: true,
template: function(i,step){
var showFinish = step.final || k == 'classes';
var showCounter = k=='intro' && !step.final;

// Experiment wud1Ba5qT1m9qR3PP0-Mmg , remove this when experiment complete
// 0=No Finish; Yes Counter 1=No Finish; No Counter 2=Yes Finish; Yes Counter 3=Yes Finish; No Counter
showFinish = showFinish || $rootScope.variant==2 || $rootScope.variant==3;
showCounter = showCounter && ($rootScope.variant==0 || $rootScope.variant==2);

return '<div class="popover" role="tooltip">' +
'<div class="arrow"></div>' +
'<h3 class="popover-title"></h3>' +
'<div class="popover-content"></div>' +
'<div class="popover-navigation"> ' +
//'<button class="btn btn-sm btn-default" data-role="end" style="float:none;">' + (step.final ? 'Finish Tour' : 'Hide') + '</button>' +
((step.final || k == 'classes') ? '<button class="btn btn-sm btn-default" data-role="end" style="float:none;">Finish Tour</button>' : '') +
(k=='intro' && !step.final ? '<span style="float:right;">'+ (i+1 +' of '+ _.flatten(chapters[k]).length) +'</span>' : '')+ // counter
(showFinish ? '<button class="btn btn-sm btn-default" data-role="end" style="float:none;">Finish Tour</button>' : '') +
(showCounter ? '<span style="float:right;">'+ (i+1 +' of '+ _.flatten(chapters[k]).length) +'</span>' : '')+ // counter
'<div class="btn-group">' +
'<button class="btn btn-sm btn-default" data-role="prev">&laquo; Prev</button>' +
'<button class="btn btn-sm btn-default" data-role="next">Next &raquo;</button>' +
Expand Down

0 comments on commit edb50f7

Please sign in to comment.