Use Google Analytics snippet compatible with Trusted Types.
PiperOrigin-RevId: 347342173
Change-Id: I542abf80db92e039c4996ae54518617a393cb4ec
diff --git a/resources/com/google/gitiles/templates/Doc.soy b/resources/com/google/gitiles/templates/Doc.soy
index db1bfc6..28dad26 100644
--- a/resources/com/google/gitiles/templates/Doc.soy
+++ b/resources/com/google/gitiles/templates/Doc.soy
@@ -85,14 +85,12 @@
{if $analyticsId}
/* From https://developers.google.com/analytics/devguides/collection/analyticsjs/ */
<script>
- (function(i,s,o,g,r,a,m){lb}i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){lb}
- (i[r].q=i[r].q||[]).push(arguments){rb},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)
- {rb})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ window.ga=window.ga||function(){lb}(ga.q=ga.q||[]).push(arguments){rb};ga.l=+new Date;
ga('create', '{$analyticsId}', 'auto');
ga('send', 'pageview', {lb}title: '{$pageTitle}'{rb});
</script>
+ <script async src="https://www.google-analytics.com/analytics.js"></script>
{/if}
</body>
</html>