Merge pull request #26901 from overleaf/rh-hotjar-marketing

Add hotjar tracking to marketing pages

GitOrigin-RevId: 5490392b44a287e4853778416323b3aa5fbfc1ef
This commit is contained in:
roo hutton
2025-07-11 08:05:25 +00:00
committed by Copybot
parent 14afc82acf
commit 6bdcd1f803
5 changed files with 17 additions and 2 deletions
@@ -6,6 +6,7 @@ import ErrorController from '../Errors/ErrorController.js'
import SessionManager from '../Authentication/SessionManager.js'
import { expressify } from '@overleaf/promise-utils'
import logger from '@overleaf/logger'
import SplitTestHandler from '../SplitTests/SplitTestHandler.js'
const __dirname = new URL('.', import.meta.url).pathname
@@ -31,7 +32,15 @@ async function home(req, res) {
page: req.path,
})
res.render('external/home/index')
const hotjarAssignment = await SplitTestHandler.promises.getAssignment(
req,
res,
'hotjar-marketing'
)
res.render('external/home/index', {
shouldLoadHotjar: hotjarAssignment?.variant === 'enabled',
})
} else {
res.redirect('/login')
}
@@ -6,6 +6,9 @@ include ./_mixins/bootstrap_js
block entrypointVar
- entrypoint = 'marketing'
block append meta
meta(name='ol-shouldLoadHotjar' data-type='boolean' content=shouldLoadHotjar)
block body
if typeof suppressNavbar == 'undefined'
if bootstrapVersion === 5