diff --git a/app/views/account/PaymentsView.coffee b/app/views/account/PaymentsView.coffee index 8ec4d888e..931b825a9 100644 --- a/app/views/account/PaymentsView.coffee +++ b/app/views/account/PaymentsView.coffee @@ -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() diff --git a/app/views/play/WorldMapView.coffee b/app/views/play/WorldMapView.coffee index 7afe43cad..90e8b05e2 100644 --- a/app/views/play/WorldMapView.coffee +++ b/app/views/play/WorldMapView.coffee @@ -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() diff --git a/app/views/play/level/LevelLoadingView.coffee b/app/views/play/level/LevelLoadingView.coffee index 04955721f..99d8150ca 100644 --- a/app/views/play/level/LevelLoadingView.coffee +++ b/app/views/play/level/LevelLoadingView.coffee @@ -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() diff --git a/app/views/play/modal/SubscribeModal.coffee b/app/views/play/modal/SubscribeModal.coffee index 59b34338b..cc8af4bb7 100644 --- a/app/views/play/modal/SubscribeModal.coffee +++ b/app/views/play/modal/SubscribeModal.coffee @@ -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()