mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-05 22:11:09 +00:00
Add new event segmentations for upgrade button in dashboard to help analytics (#11345)
* Add new event segmentations for the upgrade button in dashboard to help analysis * Also add an extra check for the upgrade button in the navbar since it's only appeared in the project dashboard react version GitOrigin-RevId: fca14e3adfbafd0fd143b045ba43588913f7297b
This commit is contained in:
parent
ea02de3e28
commit
435be3073f
5 changed files with 12 additions and 4 deletions
|
@ -355,6 +355,7 @@ async function projectListReactPage(req, res, next) {
|
|||
showGroupsAndEnterpriseBanner,
|
||||
groupsAndEnterpriseBannerVariant:
|
||||
groupsAndEnterpriseBannerAssignment?.variant ?? 'default',
|
||||
projectDashboardReact: true, // used in navbar
|
||||
showNewUsersMicroSurvey,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -9,14 +9,15 @@ nav.navbar.navbar-default.navbar-main
|
|||
aria-label="Toggle " + translate('navigation')
|
||||
)
|
||||
i.fa.fa-bars(aria-hidden="true")
|
||||
if (usersBestSubscription && usersBestSubscription.type === 'free')
|
||||
- var enableUpgradeButton = projectDashboardReact && usersBestSubscription && usersBestSubscription.type === 'free'
|
||||
if (enableUpgradeButton)
|
||||
a.btn.btn-primary.pull-right.me-2.visible-xs(
|
||||
href="/user/subscription/plans"
|
||||
event-tracking="upgrade-button-click"
|
||||
event-tracking-mb="true"
|
||||
event-tracking-label="upgrade"
|
||||
event-tracking-trigger="click"
|
||||
event-segmentation='{"source": "dashboard-top"}'
|
||||
event-segmentation='{"source": "dashboard-top", "project-dashboard-react": "enabled", "is-dashboard-sidebar-hidden": "true"}'
|
||||
) #{translate("upgrade")}
|
||||
if settings.nav.custom_logo
|
||||
a(href='/', aria-label=settings.appName, style='background-image:url("'+settings.nav.custom_logo+'")').navbar-brand
|
||||
|
|
|
@ -112,5 +112,5 @@ mixin free_plan()
|
|||
event-tracking-mb="true"
|
||||
event-tracking-label="upgrade"
|
||||
event-tracking-trigger="click"
|
||||
event-segmentation='{"source": "dashboard-top"}'
|
||||
event-segmentation='{"source": "dashboard-top", "project-dashboard-react": "default", "is-dashboard-sidebar-hidden": "false"}'
|
||||
) Upgrade
|
||||
|
|
|
@ -14,7 +14,11 @@ function FreePlan({ featuresPageURL }: FreePlanProps) {
|
|||
)
|
||||
|
||||
const handleClick = () => {
|
||||
eventTracking.sendMB('upgrade-button-click', { source: 'dashboard-top' })
|
||||
eventTracking.sendMB('upgrade-button-click', {
|
||||
source: 'dashboard-top',
|
||||
'project-dashboard-react': 'enabled',
|
||||
'is-dashboard-sidebar-hidden': false,
|
||||
})
|
||||
}
|
||||
|
||||
const featuresPageVariant = getMeta('ol-splitTestVariants')?.['features-page']
|
||||
|
|
|
@ -53,6 +53,8 @@ describe('<CurrentPlanWidget />', function () {
|
|||
expect(sendMBSpy).calledWith('upgrade-button-click', {
|
||||
source: 'dashboard-top',
|
||||
page: '/',
|
||||
'project-dashboard-react': 'enabled',
|
||||
'is-dashboard-sidebar-hidden': false,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue