mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Add virtual page views for subscribe paths
This commit is contained in:
parent
d0ee8cb7c7
commit
4616df6c23
4 changed files with 9 additions and 0 deletions
app/views
account
play
|
@ -30,6 +30,7 @@ module.exports = class PaymentsView extends RootView
|
|||
onClickStartSubscription: (e) ->
|
||||
@openModalView new SubscribeModal()
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'payments view'
|
||||
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||
|
||||
onSubscribed: ->
|
||||
document.location.reload()
|
||||
|
|
|
@ -124,6 +124,7 @@ module.exports = class WorldMapView extends RootView
|
|||
@openModalView? new modal() unless window.currentModal
|
||||
if modal is SubscribeModal
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'world map loadded'
|
||||
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||
, 2000
|
||||
|
||||
onSubscribed: ->
|
||||
|
@ -214,6 +215,7 @@ module.exports = class WorldMapView extends RootView
|
|||
@openModalView new modal()
|
||||
if modal is SubscribeModal
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'map level clicked'
|
||||
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||
else if $(e.target).attr('disabled')
|
||||
Backbone.Mediator.publish 'router:navigate', route: '/contribute/adventurer'
|
||||
return
|
||||
|
@ -222,11 +224,13 @@ module.exports = class WorldMapView extends RootView
|
|||
else
|
||||
@startLevel levelElement
|
||||
window.tracker?.trackEvent 'Clicked Level', category: 'World Map', levelID: levelID, ['Google Analytics']
|
||||
window.tracker?.trackPageView "world-map/clicked-level/#{levelID}", ['Google Analytics']
|
||||
|
||||
onClickStartLevel: (e) ->
|
||||
levelElement = $(e.target).parents('.level-info-container')
|
||||
@startLevel levelElement
|
||||
window.tracker?.trackEvent 'Clicked Start Level', category: 'World Map', levelID: levelElement.data('level-id'), ['Google Analytics']
|
||||
window.tracker?.trackPageView "world-map/clicked-start-level/#{levelElement.data('level-id')}", ['Google Analytics']
|
||||
|
||||
startLevel: (levelElement) ->
|
||||
@setupManager?.destroy()
|
||||
|
|
|
@ -114,6 +114,7 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
@openModalView new modal()
|
||||
if modal is SubscribeModal
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'level loading'
|
||||
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||
|
||||
onSubscribed: ->
|
||||
document.location.reload()
|
||||
|
|
|
@ -45,10 +45,12 @@ module.exports = class SubscribeModal extends ModalView
|
|||
container: @$el
|
||||
).on 'shown.bs.popover', =>
|
||||
application.tracker?.trackEvent 'Subscription parent hover', {}
|
||||
application.tracker?.trackPageView "subscription/parent-hover", ['Google Analytics']
|
||||
|
||||
onClickPurchaseButton: (e) ->
|
||||
@playSound 'menu-button-click'
|
||||
application.tracker?.trackEvent 'Started subscription purchase', {}
|
||||
application.tracker?.trackPageView "subscription/start-purchase", ['Google Analytics']
|
||||
stripeHandler.open({
|
||||
description: $.i18n.t('subscribe.stripe_description')
|
||||
amount: @product.amount
|
||||
|
@ -69,6 +71,7 @@ module.exports = class SubscribeModal extends ModalView
|
|||
|
||||
onSubscriptionSuccess: ->
|
||||
application.tracker?.trackEvent 'Finished subscription purchase', {}
|
||||
application.tracker?.trackPageView "subscription/finish-purchase", ['Google Analytics']
|
||||
Backbone.Mediator.publish 'subscribe-modal:subscribed', {}
|
||||
@playSound 'victory'
|
||||
@hide()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue