Add Hotjar script to the home page (#20758)

GitOrigin-RevId: b7fdb904702d84058c2e3519b17376083ee9cad7
This commit is contained in:
Alf Eaton
2024-10-14 11:09:26 +00:00
committed by Copybot
parent b81472329e
commit 7a26d46d7c
6 changed files with 59 additions and 0 deletions
@@ -9,6 +9,7 @@ const SessionManager = require('../Authentication/SessionManager')
const { expressify } = require('@overleaf/promise-utils')
const logger = require('@overleaf/logger')
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
const homepageExists = fs.existsSync(
Path.join(
@@ -35,6 +36,12 @@ async function home(req, res) {
page: req.path,
})
try {
await SplitTestHandler.promises.getAssignment(req, res, 'hotjar')
} catch {
// do nothing
}
res.render('external/home/website-redesign/index')
} else {
res.redirect('/login')