From e97ba54c94a042fe6cfb3fbd47461ebccb234cc7 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Thu, 20 Nov 2014 20:31:17 -0800 Subject: [PATCH] Reduced how much we're sending to Mixpanel. Turned off experimental languages A/B test. --- app/lib/LevelSetupManager.coffee | 4 ++-- app/models/User.coffee | 13 ------------- app/views/game-menu/InventoryModal.coffee | 2 +- app/views/kinds/RootView.coffee | 2 +- app/views/play/WorldMapView.coffee | 8 ++++---- app/views/play/modal/PlayHeroesModal.coffee | 15 +++------------ 6 files changed, 11 insertions(+), 33 deletions(-) diff --git a/app/lib/LevelSetupManager.coffee b/app/lib/LevelSetupManager.coffee index 60231415e..911a9af9f 100644 --- a/app/lib/LevelSetupManager.coffee +++ b/app/lib/LevelSetupManager.coffee @@ -62,14 +62,14 @@ module.exports = class LevelSetupManager extends CocoClass @inventoryModal.didReappear() @inventoryModal.onShown() @inventoryModal.setHero(e.hero) - window.tracker?.trackEvent 'Play Level Modal', Action: 'Choose Inventory' + window.tracker?.trackEvent 'Play Level Modal', Action: 'Choose Inventory', ['Google Analytics'] onChooseHeroClicked: -> @options.parent.openModalView(@heroesModal) @heroesModal.render() @heroesModal.didReappear() @inventoryModal.endHighlight() - window.tracker?.trackEvent 'Play Level Modal', Action: 'Choose Hero' + window.tracker?.trackEvent 'Play Level Modal', Action: 'Choose Hero', ['Google Analytics'] onInventoryModalPlayClicked: -> @navigatingToPlay = true diff --git a/app/models/User.coffee b/app/models/User.coffee index e39f7efbb..cd571a9b6 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -131,19 +131,6 @@ module.exports = class User extends CocoModel application.tracker.identify directFirstGroup: @directFirstGroup @directFirstGroup - getExperimentalLangGroup: -> - # Group -1 is not participating - # Group 0 is original behavior - # Group 1 isn't shown experimental languages in hero modal when launching beginner campaign level - # Targetting users with testGroupNumber >= 128 - unless @experimentalLangGroup? - if me.isAdmin() or me.get('testGroupNumber') < 128 - @experimentalLangGroup = -1 - else - @experimentalLangGroup = me.get('testGroupNumber') % 2 - application.tracker.identify experimentalLangGroup: @experimentalLangGroup - @experimentalLangGroup - ## Test complete; feel free to repurpose for another test. # https://mixpanel.com/report/227350/segmentation/#action:segment,arb_event:'Saw%20Victory',bool_op:and,chart_type:bar,from_date:-17,segfilter:!((filter:(operand:!('Dungeons%20of%20Kithgard'),operator:%3D%3D),property:level,selected_property_type:string,type:string),(filter:(operand:'',operator:set),property:highlightArrowGroup,selected_property_type:string,type:string),(property:highlightArrowGroup,selected_property_type:string,type:string)),segment_type:string,to_date:0,type:unique,unit:day # https://www.dropbox.com/s/jot1ikz7nk7jti5/Screenshot%202014-11-18%2008.04.00.png?dl=0 diff --git a/app/views/game-menu/InventoryModal.coffee b/app/views/game-menu/InventoryModal.coffee index d83089468..618af9815 100644 --- a/app/views/game-menu/InventoryModal.coffee +++ b/app/views/game-menu/InventoryModal.coffee @@ -436,7 +436,7 @@ module.exports = class InventoryModal extends ModalView hasGoneFullScreenOnce = true @updateConfig => @trigger? 'play-click' - window.tracker?.trackEvent 'Play Level Modal', Action: 'Play' + window.tracker?.trackEvent 'Play Level Modal', Action: 'Play', ['Google Analytics'] updateConfig: (callback, skipSessionSave) -> sessionHeroConfig = @options.session.get('heroConfig') ? {} diff --git a/app/views/kinds/RootView.coffee b/app/views/kinds/RootView.coffee index a66eb004e..02c080596 100644 --- a/app/views/kinds/RootView.coffee +++ b/app/views/kinds/RootView.coffee @@ -61,7 +61,7 @@ module.exports = class RootView extends CocoView onClickAnchor: (e) -> return if @destroyed anchorText = e?.currentTarget?.text - window.tracker?.trackEvent 'Homepage', Action: anchorText if @id is 'home-view' and anchorText + window.tracker?.trackEvent 'Homepage', Action: anchorText, ['Google Analytics'] if @id is 'home-view' and anchorText @toggleModal e showLoading: ($el) -> diff --git a/app/views/play/WorldMapView.coffee b/app/views/play/WorldMapView.coffee index 33d6a7c95..39070135b 100644 --- a/app/views/play/WorldMapView.coffee +++ b/app/views/play/WorldMapView.coffee @@ -50,7 +50,7 @@ module.exports = class WorldMapView extends RootView @hadEverChosenHero = me.get('heroConfig')?.thangType @listenTo me, 'change:purchased', -> @renderSelectors('#gems-count') @listenTo me, 'change:spent', -> @renderSelectors('#gems-count') - window.tracker?.trackEvent 'World Map', Action: 'Loaded' + window.tracker?.trackEvent 'World Map', Action: 'Loaded', ['Google Analytics'] destroy: -> @setupManager?.destroy() @@ -154,7 +154,7 @@ module.exports = class WorldMapView extends RootView levelElement = $(target).parents('.level') levelID = levelElement.data('level-id') @startLevel levelElement - window.tracker?.trackEvent 'World Map', levelID: firstLevelID, directFirstGroup: testGroup + window.tracker?.trackEvent 'World Map', levelID: firstLevelID, directFirstGroup: testGroup, ['Google Analytics'] else @ABTestSkipHighlight = false @@ -184,12 +184,12 @@ module.exports = class WorldMapView extends RootView levelElement = $(e.target).parents('.level') levelID = levelElement.data('level-id') @startLevel levelElement - window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelID + window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelID, ['Google Analytics'] onClickStartLevel: (e) -> levelElement = $(e.target).parents('.level-info-container') @startLevel levelElement - window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelElement.data('level-id') + window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelElement.data('level-id'), ['Google Analytics'] startLevel: (levelElement) -> @setupManager?.destroy() diff --git a/app/views/play/modal/PlayHeroesModal.coffee b/app/views/play/modal/PlayHeroesModal.coffee index b126c4e0e..c4f98019a 100644 --- a/app/views/play/modal/PlayHeroesModal.coffee +++ b/app/views/play/modal/PlayHeroesModal.coffee @@ -78,20 +78,11 @@ module.exports = class PlayHeroesModal extends ModalView {id: 'python', name: "Python (#{$.i18n.t('choose_hero.default')})"} {id: 'javascript', name: 'JavaScript'} {id: 'coffeescript', name: 'CoffeeScript'} + {id: 'clojure', name: "Clojure (#{$.i18n.t('choose_hero.experimental')})"} + {id: 'lua', name: "Lua (#{$.i18n.t('choose_hero.experimental')})"} + {id: 'io', name: "Io (#{$.i18n.t('choose_hero.experimental')})"} ] - # A/B test showing experimental languages on first hero select - # Group -1 is not participating - # Group 0 is original behavior - # Group 1 isn't shown experimental languages in hero modal when launching beginner campaign level - testGroup = me.getExperimentalLangGroup() - if hadEverChosenHero? or testGroup isnt 1 - @codeLanguageList.push id: 'clojure', name: "Clojure (#{$.i18n.t('choose_hero.experimental')})" - @codeLanguageList.push id: 'lua', name: "Lua (#{$.i18n.t('choose_hero.experimental')})" - @codeLanguageList.push id: 'io', name: "Io (#{$.i18n.t('choose_hero.experimental')})" - unless hadEverChosenHero? or testGroup is -1 - window.tracker?.trackEvent 'Heroes Modal', experimentalLangGroup: testGroup - onHeroChanged: (e) -> direction = e.direction # 'left' or 'right' heroItem = $(e.relatedTarget)