mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-07 18:42:42 +00:00
Add Google Optimize
GitOrigin-RevId: 4c485be83456bf632d1b5f6790f2757d2b3aad54
This commit is contained in:
parent
2cf76ba39a
commit
cbe22f5cc7
4 changed files with 8 additions and 1 deletions
|
@ -52,6 +52,7 @@ module.exports = SubscriptionController = {
|
|||
title: 'plans_and_pricing',
|
||||
plans,
|
||||
gaExperiments: Settings.gaExperiments.plansPage,
|
||||
gaOptimize: true,
|
||||
recomendedCurrency,
|
||||
planFeatures,
|
||||
groupPlans: GroupPlansData
|
||||
|
|
|
@ -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()
|
||||
})
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -358,7 +358,8 @@ module.exports = settings =
|
|||
# analytics:
|
||||
# ga:
|
||||
# token: ""
|
||||
#
|
||||
# gaOptimize:
|
||||
# id: ""
|
||||
# ShareLaTeX's help desk is provided by tenderapp.com
|
||||
# tenderUrl: ""
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue