Add Google Optimize

GitOrigin-RevId: 4c485be83456bf632d1b5f6790f2757d2b3aad54
This commit is contained in:
Jessica Lawshe 2019-11-27 14:44:49 -06:00 committed by sharelatex
parent 2cf76ba39a
commit cbe22f5cc7
4 changed files with 8 additions and 1 deletions

View file

@ -52,6 +52,7 @@ module.exports = SubscriptionController = {
title: 'plans_and_pricing',
plans,
gaExperiments: Settings.gaExperiments.plansPage,
gaOptimize: true,
recomendedCurrency,
planFeatures,
groupPlans: GroupPlansData

View file

@ -266,6 +266,7 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) {
webRouter.use(function(req, res, next) {
res.locals.gaToken = Settings.analytics && Settings.analytics.ga.token
res.locals.gaOptimizeId = _.get(Settings, ['analytics', 'gaOptimize', 'id'])
next()
})

View file

@ -35,6 +35,10 @@ html(
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
if gaOptimize === true && typeof(gaOptimizeId) != "undefined"
script(type='text/javascript').
ga('require', '#{gaOptimizeId}')
script(type='text/javascript').
ga('create', '#{gaToken}', '#{settings.cookieDomain.replace(/^\./, "")}');
ga('send', 'pageview');
- else

View file

@ -358,7 +358,8 @@ module.exports = settings =
# analytics:
# ga:
# token: ""
#
# gaOptimize:
# id: ""
# ShareLaTeX's help desk is provided by tenderapp.com
# tenderUrl: ""
#