Skip to content

Commit 2886822

Browse files
authored
Restore accidentally-removed Google Analytics JS (go-gitea#247)
* Restore accidentally-removed Google Analytics JS * Empty commit to rerun CI
1 parent 7426e5e commit 2886822

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

templates/base/footer.tmpl

+11
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,16 @@
6767
<!-- JavaScript -->
6868
<script src="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js"></script>
6969
<script src="{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}"></script>
70+
71+
{{if GATrackingID}}
72+
<script>
73+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
74+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
75+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
76+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
77+
ga('create', '{{GATrackingID}}', 'auto');
78+
ga('send', 'pageview');
79+
</script>
80+
{{end}}
7081
</body>
7182
</html>

0 commit comments

Comments
 (0)