diff --git a/app/models/User.coffee b/app/models/User.coffee index e1ef3049b..dbc84e732 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -123,19 +123,6 @@ module.exports = class User extends CocoModel application.tracker.identify gemPromptGroup: @gemPromptGroup unless me.isAdmin() @gemPromptGroup - getSubscribeCopyGroup: -> - # A/B Testing alternate subscribe modal copy - return @subscribeCopyGroup if @subscribeCopyGroup - group = me.get('testGroupNumber') % 6 - @subscribeCopyGroup = switch group - when 0, 1, 2 then 'original' - when 3, 4, 5 then 'new' - if (not @get('preferredLanguage') or /^en/.test(@get('preferredLanguage'))) and not me.isAdmin() - application.tracker.identify subscribeCopyGroup: @subscribeCopyGroup - else - @subscribeCopyGroup = 'original' - @subscribeCopyGroup - getVideoTutorialStylesIndex: (numVideos=0)-> # A/B Testing video tutorial styles # Not a constant number of videos available (e.g. could be 0, 1, 3, or 4 currently) diff --git a/app/styles/modal/subscribe-modal.sass b/app/styles/modal/subscribe-modal.sass index 8b3b24dbd..96a89f967 100644 --- a/app/styles/modal/subscribe-modal.sass +++ b/app/styles/modal/subscribe-modal.sass @@ -18,12 +18,6 @@ top: -61px left: 0px - #subscribe-gems - position: absolute - top: 155px - right: 65px - - //- Header h1 position: absolute @@ -37,7 +31,7 @@ text-shadow: black 4px 4px 0, black -4px -4px 0, black 4px -4px 0, black -4px 4px 0, black 4px 0px 0, black 0px -4px 0, black -4px 0px 0, black 0px 4px 0, black 6px 6px 6px font-variant: normal text-transform: uppercase - + //- Close modal button @@ -57,7 +51,7 @@ &:hover color: yellow - + //- Selling points #selling-points @@ -70,7 +64,7 @@ color: black font-family: $headings-font-family font-size: 18px - + .point width: 150px overflow: none @@ -85,22 +79,6 @@ text-decoration: underline cursor: pointer - #selling-points-BTest - position: absolute - left: 65px - top: 150px - width: 500px - font-weight: normal - line-height: 18px - color: black - font-family: $headings-font-family - font-size: 18px - - .point - overflow: none - text-align: left - margin: 20px - .popover z-index: 1050 @@ -138,7 +116,7 @@ padding: 2px 0 0 2px color: white - + //- Errors .alert @@ -155,7 +133,7 @@ html.no-borderimage #subscribe-modal background-image: url(/images/level/code_toolbar_submit_button_active.png) background-size: 100% 100% padding: 7px 10px 10px 10px - + &:hover background-image: url(/images/level/code_toolbar_submit_button_zazz.png) border: 0 @@ -164,4 +142,3 @@ html.no-borderimage #subscribe-modal background-image: url(/images/level/code_toolbar_submit_button_zazz_pressed.png) padding: 9px 8px 8px 12px border: 0 - diff --git a/app/templates/core/subscribe-modal.jade b/app/templates/core/subscribe-modal.jade index ad308192c..ecf13ba2d 100644 --- a/app/templates/core/subscribe-modal.jade +++ b/app/templates/core/subscribe-modal.jade @@ -7,39 +7,24 @@ #retrying-alert.alert.alert-danger(data-i18n="buy_gems.retrying") else - if BTest - img(src="/images/pages/play/modal/subscribe-background-blank.png")#subscribe-background - img(src="/images/pages/play/modal/subscribe-gems.png")#subscribe-gems - else - img(src="/images/pages/play/modal/subscribe-background.png")#subscribe-background - + img(src="/images/pages/play/modal/subscribe-background.png")#subscribe-background + h1(data-i18n="subscribe.subscribe_title") Subscribe div#close-modal span.glyphicon.glyphicon-remove - if BTest - #selling-points-BTest - #point-levels.point - .blurb(style="font-style:italic") "Great product ... I have been looking for a good tool to teach my kids programming." - #point-heroes.point - .blurb Join the CodeCombat subscription and get even more learn-to-code goodness! - #point-gems.point - .blurb For $#{price}/mo, you'll get access to bonus levels and 3500 extra gems per month! Players who complete bonus levels learn more programming and advance further in the game. - #point-items.point - .blurb There's no risk: 100% money back guarantee. - else - #selling-points - #point-levels.point - .blurb(data-i18n="subscribe.levels") - #point-heroes.point - .blurb(data-i18n="subscribe.heroes") - #point-gems.point - .blurb(data-i18n="subscribe.gems") - #point-items.point - .blurb(data-i18n="subscribe.items") + #selling-points + #point-levels.point + .blurb(data-i18n="subscribe.levels") + #point-heroes.point + .blurb(data-i18n="subscribe.heroes") + #point-gems.point + .blurb(data-i18n="subscribe.gems") + #point-items.point + .blurb(data-i18n="subscribe.items") - #parents-info(data-i18n="subscribe.parents") + #parents-info(data-i18n="subscribe.parents") button.btn.btn-lg.btn-illustrated.purchase-button(data-i18n="subscribe.subscribe_button") diff --git a/app/views/core/SubscribeModal.coffee b/app/views/core/SubscribeModal.coffee index 1567eb194..f6b1e673b 100644 --- a/app/views/core/SubscribeModal.coffee +++ b/app/views/core/SubscribeModal.coffee @@ -30,10 +30,6 @@ module.exports = class SubscribeModal extends ModalView c.stateMessage = @stateMessage c.price = @product.amount / 100 #c.price = 3.99 # Sale - - # A/B Testing alternate subscription copy - c.BTest = me.getSubscribeCopyGroup() is 'new' - return c afterRender: -> diff --git a/app/views/play/menu/GuideView.coffee b/app/views/play/menu/GuideView.coffee index dabbc2abd..335d06628 100644 --- a/app/views/play/menu/GuideView.coffee +++ b/app/views/play/menu/GuideView.coffee @@ -94,9 +94,17 @@ module.exports = class LevelGuideView extends CocoView window.tracker?.trackEvent 'Finish help video', level: @levelID, ls: @sessionID, style: @helpVideos[@helpVideosIndex].style @trackedHelpVideoFinish = true + # we wan't to always use the same scheme (HTTP/HTTPS) as the page was loaded with, but don't want to require Artisans to have to remember + # not to include a scheme in help video url + fixupUri = (uri) -> + n = uri.indexOf('/') + if n < 1 + return uri + return uri.slice(n) + setupVideoPlayer: () -> return unless @helpVideos.length > 0 - helpVideoURL = @helpVideos[@helpVideosIndex].url + helpVideoURL = fixupUri(@helpVideos[@helpVideosIndex].url) @setupVimeoVideoPlayer helpVideoURL setupVimeoVideoPlayer: (helpVideoURL) -> diff --git a/config.coffee b/config.coffee index 7b9945fd8..3f520ee87 100644 --- a/config.coffee +++ b/config.coffee @@ -8,7 +8,7 @@ TRAVIS = process.env.COCO_TRAVIS_TEST #- regJoin replace a single '/' with '[\/\\]' so it can handle either forward or backslash -regJoin = (s) -> new RegExp(s.replace(/\//, '[\\\/\\\\]')) +regJoin = (s) -> new RegExp(s.replace(/\//g, '[\\\/\\\\]')) #- Build the config @@ -197,12 +197,8 @@ exports.config = modules: definition: (path, data) -> - needHeaders = [ - 'public/javascripts/app.js' - 'public/javascripts/world.js' - 'public/javascripts/whole-app.js' - ] - defn = if path in needHeaders then commonjsHeader else '' + needHeaderExpr = regJoin('^public/javascripts/?(app.js|world.js|whole-app.js)') + defn = if path.match(needHeaderExpr) then commonjsHeader else '' return defn #- Find all .coffee and .jade files in /app diff --git a/scripts/analytics/mixpanelGetEvent.py b/scripts/analytics/mixpanelGetEvent.py new file mode 100644 index 000000000..5a4fd53c5 --- /dev/null +++ b/scripts/analytics/mixpanelGetEvent.py @@ -0,0 +1,184 @@ +# Get mixpanel event data via export API +# Useful for debugging Mixpanel data weirdness + +targetLevels = ['dungeons-of-kithgard', 'the-raised-sword', 'endangered-burl'] +targetLevels = ['dungeons-of-kithgard'] +eventFunnel = ['Started Level', 'Saw Victory'] +# eventFunnel = ['Saw Victory'] +# eventFunnel = ['Started Level'] + +import sys +from pprint import pprint +from datetime import datetime, timedelta +from mixpanel import Mixpanel + +try: + import json +except ImportError: + import simplejson as json + +# NOTE: mixpanel dates are by day and inclusive +# E.g. '2014-12-08' is any date that day, up to 2014-12-09 12am + +if __name__ == '__main__': + if not len(sys.argv) is 3: + print "Script format: