Merge pull request #2451 from overleaf/jel-fix-google-optimize

Move Google Optimize snippet to after analytics create snippet

GitOrigin-RevId: 5a7e8dea738c44d30def7d8cd1ee0e4577db80ec
This commit is contained in:
Timothée Alby 2019-12-16 16:25:25 +05:30 committed by Copybot
parent 30b9ba4ac7
commit 0125a1f384

View file

@ -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) };