diff --git a/services/web/app/views/layout/navbar-marketing.pug b/services/web/app/views/layout/navbar-marketing.pug index 29e7b998f8..6dff85c2c8 100644 --- a/services/web/app/views/layout/navbar-marketing.pug +++ b/services/web/app/views/layout/navbar-marketing.pug @@ -17,7 +17,7 @@ nav.navbar.navbar-default.navbar-main event-tracking-mb="true" event-tracking-label="upgrade" event-tracking-trigger="click" - event-segmentation='{"source": "dashboard-top", "project-dashboard-react": "enabled", "is-dashboard-sidebar-hidden": "true"}' + event-segmentation='{"source": "dashboard-top", "project-dashboard-react": "enabled", "is-dashboard-sidebar-hidden": "true", "is-screen-width-less-than-768px": "true"}' ) #{translate("upgrade")} if settings.nav.custom_logo a(href='/', aria-label=settings.appName, style='background-image:url("'+settings.nav.custom_logo+'")').navbar-brand diff --git a/services/web/app/views/project/list/_current_plan_mixins.pug b/services/web/app/views/project/list/_current_plan_mixins.pug index f9b54cafe3..3eef98fc90 100644 --- a/services/web/app/views/project/list/_current_plan_mixins.pug +++ b/services/web/app/views/project/list/_current_plan_mixins.pug @@ -108,9 +108,5 @@ mixin free_plan() | a.btn.btn-primary( href="/user/subscription/plans?itm_referrer=project-dashboard-upgrade-prompt" - event-tracking="upgrade-button-click" - event-tracking-mb="true" - event-tracking-label="upgrade" - event-tracking-trigger="click" - event-segmentation='{"source": "dashboard-top", "project-dashboard-react": "default", "is-dashboard-sidebar-hidden": "false"}' + ng-click="sendUpgradeButtonClickEvent()" ) Upgrade diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx index ed5827ebfa..4eeee9b5d6 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx @@ -18,6 +18,7 @@ function FreePlan({ featuresPageURL }: FreePlanProps) { source: 'dashboard-top', 'project-dashboard-react': 'enabled', 'is-dashboard-sidebar-hidden': false, + 'is-screen-width-less-than-768px': false, }) } diff --git a/services/web/frontend/js/main/project-list/project-list.js b/services/web/frontend/js/main/project-list/project-list.js index a152652800..d50f71d552 100644 --- a/services/web/frontend/js/main/project-list/project-list.js +++ b/services/web/frontend/js/main/project-list/project-list.js @@ -821,6 +821,16 @@ App.controller( $scope.downloadSelectedProjects = () => $scope.downloadProjectsById($scope.getSelectedProjectIds()) + $scope.sendUpgradeButtonClickEvent = () => { + eventTracking.sendMB('upgrade-button-click', { + source: 'dashboard-top', + 'project-dashboard-react': 'default', + 'is-dashboard-sidebar-hidden': false, + 'is-screen-width-less-than-768px': + window.matchMedia('(max-width: 767px)').matches, + }) + } + $scope.downloadProjectsById = function (projectIds) { let path eventTracking.send( diff --git a/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx b/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx index 89d6a900b0..ec4cf65414 100644 --- a/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx +++ b/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx @@ -55,6 +55,7 @@ describe('', function () { page: '/', 'project-dashboard-react': 'enabled', 'is-dashboard-sidebar-hidden': false, + 'is-screen-width-less-than-768px': false, }) }) })