Unified Navigation Bar + Split Test (#5972)

GitOrigin-RevId: 9fbde79aba1395956d591989b6161290777cc28f
This commit is contained in:
Miguel Serrano 2021-12-02 11:14:44 +01:00 committed by Copybot
parent d48dbed536
commit 2667e9a11c
4 changed files with 44 additions and 9 deletions

View file

@ -75,7 +75,9 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
webRouter.get('*', AnalyticsUTMTrackingMiddleware.recordUTMTags()) webRouter.get('*', AnalyticsUTMTrackingMiddleware.recordUTMTags())
webRouter.get( webRouter.get(
'*', '*',
expressify(SplitTestMiddleware.loadAssignmentsInLocals([])) expressify(
SplitTestMiddleware.loadAssignmentsInLocals(['unified-navigation'])
)
) )
webRouter.get('/login', UserPagesController.loginPage) webRouter.get('/login', UserPagesController.loginPage)

View file

@ -36,7 +36,7 @@ nav.navbar.navbar-default.navbar-main
// loop over header_extras // loop over header_extras
each item in nav.header_extras each item in ((splitTestVariants && (splitTestVariants['unified-navigation'] === 'show-unified-navigation')) ? nav.header_extras_unified : nav.header_extras)
- -
if ((item.only_when_logged_in && getSessionUser()) if ((item.only_when_logged_in && getSessionUser())
|| (item.only_when_logged_out && (!getSessionUser())) || (item.only_when_logged_out && (!getSessionUser()))
@ -67,13 +67,25 @@ nav.navbar.navbar-default.navbar-main
else else
li li
if child.url if child.url
a(href=child.url, class=child.class) !{translate(child.text)} a(
href=child.url,
class=child.class,
event-tracking=child.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(child.text)}
else else
| !{translate(child.text)} | !{translate(child.text)}
else else
li(class=item.class) li(class=item.class)
if item.url if item.url
a(href=item.url, class=item.class) !{translate(item.text)} a(
href=item.url,
class=item.class,
event-tracking=item.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(item.text)}
else else
| !{translate(item.text)} | !{translate(item.text)}

View file

@ -26,7 +26,7 @@ nav.navbar.navbar-default.navbar-main
// loop over header_extras // loop over header_extras
each item in nav.header_extras each item in ((splitTestVariants && (splitTestVariants['unified-navigation'] === 'show-unified-navigation')) ? nav.header_extras_unified : nav.header_extras)
- -
if ((item.only_when_logged_in && getSessionUser()) if ((item.only_when_logged_in && getSessionUser())
|| (item.only_when_logged_out && (!getSessionUser())) || (item.only_when_logged_out && (!getSessionUser()))
@ -51,13 +51,25 @@ nav.navbar.navbar-default.navbar-main
else else
li li
if child.url if child.url
a(href=child.url, class=child.class) !{translate(child.text)} a(
href=child.url,
class=child.class,
event-tracking=child.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(child.text)}
else else
| !{translate(child.text)} | !{translate(child.text)}
else else
li(class=item.class) li(class=item.class)
if item.url if item.url
a(href=item.url, class=item.class) !{translate(item.text)} a(
href=item.url,
class=item.class,
event-tracking=item.event
event-tracking-mb="true"
event-tracking-trigger="click"
) !{translate(item.text)}
else else
| !{translate(item.text)} | !{translate(item.text)}

View file

@ -1,6 +1,10 @@
div.modal.fade(tabindex="-1" role="dialog" data-ol-group-plan-modal) div.modal.fade(tabindex="-1" role="dialog" data-ol-group-plan-modal)
.modal-dialog(role="document") .modal-dialog(role="document")
.modal-content .modal-content(
event-tracking="form-submitted-groups-modal-open"
event-tracking-mb="true"
event-tracking-trigger="load"
)
.modal-header .modal-header
h2 Customise your group subscription h2 Customise your group subscription
h3 Save 30% or more h3 Save 30% or more
@ -71,7 +75,12 @@ div.modal.fade(tabindex="-1" role="dialog" data-ol-group-plan-modal)
| The educational discount is available for groups of 10 or more | The educational discount is available for groups of 10 or more
.modal-footer .modal-footer
.text-center .text-center
button.btn.btn-primary.btn-lg(data-ol-purchase-group-plan) Purchase Now button.btn.btn-primary.btn-lg(
data-ol-purchase-group-plan
event-tracking="form-submitted-groups-modal-purchase-click"
event-tracking-mb="true"
event-tracking-trigger="click"
) Purchase Now
hr.thin hr.thin
a( a(
href href