From 0125a1f384a5900c2f731f3c9cbebfb0987e8c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Mon, 16 Dec 2019 16:25:25 +0530 Subject: [PATCH] Merge pull request #2451 from overleaf/jel-fix-google-optimize Move Google Optimize snippet to after analytics create snippet GitOrigin-RevId: 5a7e8dea738c44d30def7d8cd1ee0e4577db80ec --- services/web/app/views/layout.pug | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index 924276ea11..ead12cdc15 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -35,12 +35,12 @@ 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'); + if gaOptimize === true && typeof(gaOptimizeId) != "undefined" + script(type='text/javascript'). + ga('require', '#{gaOptimizeId}') - else script(type='text/javascript'). window.ga = function() { console.log("would send to GA", arguments) };