mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-22 06:07:59 +00:00
Merge pull request #22119 from overleaf/kh-hotjar-on-plans-and-checkout
[web] add hotjar to plans pages GitOrigin-RevId: eb582a85200747754923f28e7d710a9072577d75
This commit is contained in:
parent
9357f51fcf
commit
da411733b6
10 changed files with 28 additions and 2 deletions
|
@ -807,6 +807,7 @@ const _ProjectController = {
|
|||
? usedLatex
|
||||
: null,
|
||||
isSaas: Features.hasFeature('saas'),
|
||||
shouldLoadHotjar: splitTestAssignments.hotjar?.variant === 'enabled',
|
||||
})
|
||||
timer.done()
|
||||
} catch (err) {
|
||||
|
|
|
@ -130,6 +130,8 @@ async function plansPage(req, res) {
|
|||
? formatCurrencyLocalized
|
||||
: SubscriptionHelper.formatCurrencyDefault
|
||||
|
||||
const shouldLoadHotjar = await getShouldLoadHotjar(req, res)
|
||||
|
||||
res.render('subscriptions/plans', {
|
||||
title: 'plans_and_pricing',
|
||||
currentView,
|
||||
|
@ -156,6 +158,7 @@ async function plansPage(req, res) {
|
|||
latamCountryBannerDetails,
|
||||
countryCode,
|
||||
websiteRedesignPlansVariant: 'default',
|
||||
shouldLoadHotjar,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -194,6 +197,8 @@ async function plansPageLightDesign(req, res) {
|
|||
|
||||
const latamCountryBannerDetails = await getLatamCountryBannerDetails(req, res)
|
||||
|
||||
const shouldLoadHotjar = await getShouldLoadHotjar(req, res)
|
||||
|
||||
res.render('subscriptions/plans-light-design', {
|
||||
title: 'plans_and_pricing',
|
||||
currentView,
|
||||
|
@ -220,6 +225,7 @@ async function plansPageLightDesign(req, res) {
|
|||
latamCountryBannerDetails,
|
||||
countryCode,
|
||||
websiteRedesignPlansVariant: 'light-design',
|
||||
shouldLoadHotjar,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -383,6 +389,8 @@ async function interstitialPaymentPage(req, res) {
|
|||
'local-ccy-format-v2'
|
||||
)
|
||||
|
||||
const shouldLoadHotjar = await getShouldLoadHotjar(req, res)
|
||||
|
||||
res.render(template, {
|
||||
title: 'subscribe',
|
||||
itm_content: req.query?.itm_content,
|
||||
|
@ -403,6 +411,7 @@ async function interstitialPaymentPage(req, res) {
|
|||
skipLinkTarget: req.session?.postCheckoutRedirect || '/project',
|
||||
websiteRedesignPlansVariant: websiteRedesignPlansAssignment.variant,
|
||||
countryCode,
|
||||
shouldLoadHotjar,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -899,6 +908,15 @@ async function getLatamCountryBannerDetails(req, res) {
|
|||
return latamCountryBannerDetails
|
||||
}
|
||||
|
||||
async function getShouldLoadHotjar(req, res) {
|
||||
const assignment = await SplitTestHandler.promises.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'hotjar-plans'
|
||||
)
|
||||
return assignment?.variant === 'enabled'
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a subscription change preview for display purposes
|
||||
*
|
||||
|
|
|
@ -39,6 +39,7 @@ meta(name="ol-linkSharingEnforcement" data-type="boolean" content=linkSharingEnf
|
|||
meta(name="ol-usedLatex" data-type="string" content=usedLatex)
|
||||
meta(name="ol-ro-mirror-on-client-no-local-storage" data-type="boolean" content=roMirrorOnClientNoLocalStorage)
|
||||
meta(name="ol-isSaas" data-type="boolean" content=isSaas)
|
||||
meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar)
|
||||
|
||||
// translations for the loading page, before i18n has loaded in the client
|
||||
meta(name="ol-loadingText", data-type="string" content=translate("loading"))
|
||||
|
|
|
@ -17,6 +17,7 @@ block append meta
|
|||
meta(name="ol-itm_content" content=itm_content)
|
||||
meta(name="ol-countryCode" content=countryCode)
|
||||
meta(name="ol-websiteRedesignPlansVariant" content=websiteRedesignPlansVariant)
|
||||
meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar)
|
||||
|
||||
block content
|
||||
main.website-redesign#main-content
|
||||
|
|
|
@ -15,6 +15,7 @@ block append meta
|
|||
meta(name="ol-itm_content" content=itm_content)
|
||||
meta(name="ol-countryCode" content=countryCode)
|
||||
meta(name="ol-websiteRedesignPlansVariant" content=websiteRedesignPlansVariant)
|
||||
meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar)
|
||||
|
||||
block content
|
||||
main.content.content-alt#main-content
|
||||
|
|
|
@ -15,6 +15,7 @@ block append meta
|
|||
meta(name="ol-currentView" content=currentView)
|
||||
meta(name="ol-countryCode" content=countryCode)
|
||||
meta(name="ol-websiteRedesignPlansVariant" content=websiteRedesignPlansVariant)
|
||||
meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar)
|
||||
|
||||
block content
|
||||
main.website-redesign#main-content
|
||||
|
|
|
@ -11,6 +11,7 @@ block append meta
|
|||
meta(name="ol-currentView" content=currentView)
|
||||
meta(name="ol-countryCode" content=countryCode)
|
||||
meta(name="ol-websiteRedesignPlansVariant" content=websiteRedesignPlansVariant)
|
||||
meta(name="ol-shouldLoadHotjar" data-type="boolean" content=shouldLoadHotjar)
|
||||
|
||||
block content
|
||||
main.content.content-alt#main-content
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import getMeta from '@/utils/meta'
|
||||
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
||||
import { debugConsole } from '@/utils/debugging'
|
||||
import { initializeHotjar } from '@/infrastructure/hotjar-snippet'
|
||||
|
||||
const { hotjarId, hotjarVersion } = getMeta('ol-ExposedSettings')
|
||||
const shouldLoadHotjar = getMeta('ol-shouldLoadHotjar')
|
||||
|
||||
let hotjarInitialized = false
|
||||
|
||||
if (hotjarId && hotjarVersion && isSplitTestEnabled('hotjar')) {
|
||||
if (hotjarId && hotjarVersion && shouldLoadHotjar) {
|
||||
const loadHotjar = () => {
|
||||
// consent needed
|
||||
if (!document.cookie.split('; ').some(item => item === 'oa=1')) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import '../../../../marketing'
|
||||
import '../../../../infrastructure/hotjar'
|
||||
|
||||
import * as eventTracking from '../../../../infrastructure/event-tracking'
|
||||
import { setUpStickyHeaderObserver } from './plans-v2-sticky-header'
|
||||
|
|
|
@ -175,6 +175,7 @@ export interface Meta {
|
|||
'ol-settingsGroupSSO': { enabled: boolean } | undefined
|
||||
'ol-settingsPlans': Plan[]
|
||||
'ol-shouldAllowEditingDetails': boolean
|
||||
'ol-shouldLoadHotjar': boolean
|
||||
'ol-showAiErrorAssistant': boolean
|
||||
'ol-showBrlGeoBanner': boolean
|
||||
'ol-showCouponField': boolean
|
||||
|
|
Loading…
Add table
Reference in a new issue