Merge pull request #2958 from overleaf/jel-optimize-zotero

Add Optimize variant on Zotero paywall prompt

GitOrigin-RevId: 005cf27d40a367e4617c399023204dacb80af8de
This commit is contained in:
Miguel Serrano 2020-07-09 15:48:28 +02:00 committed by Copybot
parent d8d3ac82e9
commit 1cac5227d6
3 changed files with 16 additions and 9 deletions

View file

@ -766,6 +766,9 @@ const ProjectController = {
} }
metrics.inc(metricName) metrics.inc(metricName)
const enableOptimize =
!!Settings.experimentId && !user.features.zotero
res.render('project/editor', { res.render('project/editor', {
title: project.name, title: project.name,
priority_title: true, priority_title: true,
@ -822,7 +825,8 @@ const ProjectController = {
allowedImageNames, allowedImageNames,
gitBridgePublicBaseUrl: Settings.gitBridgePublicBaseUrl, gitBridgePublicBaseUrl: Settings.gitBridgePublicBaseUrl,
wsUrl, wsUrl,
showSupport: Features.hasFeature('support') showSupport: Features.hasFeature('support'),
gaOptimize: enableOptimize
}) })
timer.done() timer.done()
} }

View file

@ -354,6 +354,7 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) {
webRouter.use(function(req, res, next) { webRouter.use(function(req, res, next) {
res.locals.ExposedSettings = { res.locals.ExposedSettings = {
experimentId: Settings.experimentId,
isOverleaf: Settings.overleaf != null, isOverleaf: Settings.overleaf != null,
appName: Settings.appName, appName: Settings.appName,
hasSamlBeta: req.session.samlBeta, hasSamlBeta: req.session.samlBeta,

View file

@ -43,7 +43,9 @@ html(
script(type='text/javascript'). script(type='text/javascript').
ga('require', '#{gaOptimizeId}') ga('require', '#{gaOptimizeId}')
ga('send', 'event', 'pageview', document.title.substring(0, 499), window.location.href.substring(0, 499)) ga('send', 'event', 'pageview', document.title.substring(0, 499), window.location.href.substring(0, 499))
if !experimentId
//- Anti-flicker snippet //- Anti-flicker snippet
//- Only run for tests controlled by Optimize editor
style(type='text/css') .async-hide { opacity: 0 !important} style(type='text/css') .async-hide { opacity: 0 !important}
script(type='text/javascript'). script(type='text/javascript').
(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; (function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;