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) ->
|
onClickStartSubscription: (e) ->
|
||||||
@openModalView new SubscribeModal()
|
@openModalView new SubscribeModal()
|
||||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'payments view'
|
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'payments view'
|
||||||
|
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||||
|
|
||||||
onSubscribed: ->
|
onSubscribed: ->
|
||||||
document.location.reload()
|
document.location.reload()
|
||||||
|
|
|
@ -124,6 +124,7 @@ module.exports = class WorldMapView extends RootView
|
||||||
@openModalView? new modal() unless window.currentModal
|
@openModalView? new modal() unless window.currentModal
|
||||||
if modal is SubscribeModal
|
if modal is SubscribeModal
|
||||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'world map loadded'
|
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'world map loadded'
|
||||||
|
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||||
, 2000
|
, 2000
|
||||||
|
|
||||||
onSubscribed: ->
|
onSubscribed: ->
|
||||||
|
@ -214,6 +215,7 @@ module.exports = class WorldMapView extends RootView
|
||||||
@openModalView new modal()
|
@openModalView new modal()
|
||||||
if modal is SubscribeModal
|
if modal is SubscribeModal
|
||||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'map level clicked'
|
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')
|
else if $(e.target).attr('disabled')
|
||||||
Backbone.Mediator.publish 'router:navigate', route: '/contribute/adventurer'
|
Backbone.Mediator.publish 'router:navigate', route: '/contribute/adventurer'
|
||||||
return
|
return
|
||||||
|
@ -222,11 +224,13 @@ module.exports = class WorldMapView extends RootView
|
||||||
else
|
else
|
||||||
@startLevel levelElement
|
@startLevel levelElement
|
||||||
window.tracker?.trackEvent 'Clicked Level', category: 'World Map', levelID: levelID, ['Google Analytics']
|
window.tracker?.trackEvent 'Clicked Level', category: 'World Map', levelID: levelID, ['Google Analytics']
|
||||||
|
window.tracker?.trackPageView "world-map/clicked-level/#{levelID}", ['Google Analytics']
|
||||||
|
|
||||||
onClickStartLevel: (e) ->
|
onClickStartLevel: (e) ->
|
||||||
levelElement = $(e.target).parents('.level-info-container')
|
levelElement = $(e.target).parents('.level-info-container')
|
||||||
@startLevel levelElement
|
@startLevel levelElement
|
||||||
window.tracker?.trackEvent 'Clicked Start Level', category: 'World Map', levelID: levelElement.data('level-id'), ['Google Analytics']
|
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) ->
|
startLevel: (levelElement) ->
|
||||||
@setupManager?.destroy()
|
@setupManager?.destroy()
|
||||||
|
|
|
@ -114,6 +114,7 @@ module.exports = class LevelLoadingView extends CocoView
|
||||||
@openModalView new modal()
|
@openModalView new modal()
|
||||||
if modal is SubscribeModal
|
if modal is SubscribeModal
|
||||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'level loading'
|
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'level loading'
|
||||||
|
window.tracker?.trackPageView "subscription/show-modal", ['Google Analytics']
|
||||||
|
|
||||||
onSubscribed: ->
|
onSubscribed: ->
|
||||||
document.location.reload()
|
document.location.reload()
|
||||||
|
|
|
@ -45,10 +45,12 @@ module.exports = class SubscribeModal extends ModalView
|
||||||
container: @$el
|
container: @$el
|
||||||
).on 'shown.bs.popover', =>
|
).on 'shown.bs.popover', =>
|
||||||
application.tracker?.trackEvent 'Subscription parent hover', {}
|
application.tracker?.trackEvent 'Subscription parent hover', {}
|
||||||
|
application.tracker?.trackPageView "subscription/parent-hover", ['Google Analytics']
|
||||||
|
|
||||||
onClickPurchaseButton: (e) ->
|
onClickPurchaseButton: (e) ->
|
||||||
@playSound 'menu-button-click'
|
@playSound 'menu-button-click'
|
||||||
application.tracker?.trackEvent 'Started subscription purchase', {}
|
application.tracker?.trackEvent 'Started subscription purchase', {}
|
||||||
|
application.tracker?.trackPageView "subscription/start-purchase", ['Google Analytics']
|
||||||
stripeHandler.open({
|
stripeHandler.open({
|
||||||
description: $.i18n.t('subscribe.stripe_description')
|
description: $.i18n.t('subscribe.stripe_description')
|
||||||
amount: @product.amount
|
amount: @product.amount
|
||||||
|
@ -69,6 +71,7 @@ module.exports = class SubscribeModal extends ModalView
|
||||||
|
|
||||||
onSubscriptionSuccess: ->
|
onSubscriptionSuccess: ->
|
||||||
application.tracker?.trackEvent 'Finished subscription purchase', {}
|
application.tracker?.trackEvent 'Finished subscription purchase', {}
|
||||||
|
application.tracker?.trackPageView "subscription/finish-purchase", ['Google Analytics']
|
||||||
Backbone.Mediator.publish 'subscribe-modal:subscribed', {}
|
Backbone.Mediator.publish 'subscribe-modal:subscribed', {}
|
||||||
@playSound 'victory'
|
@playSound 'victory'
|
||||||
@hide()
|
@hide()
|
||||||
|
|
Reference in a new issue