Support Cloudflare Web Analytics (#763)

* Support Cloudflare Web Analytics

* Support Cloudflare Web Analytics

---------

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
This commit is contained in:
ZeYanLin 2023-07-30 15:48:13 +08:00 committed by GitHub
parent 08017d5977
commit 8f2d583ab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -153,6 +153,9 @@ params:
analytics:
enabled: false
services:
# cloudflare web analytics
# cloudflare:
# token: "<token>"
# Google Analytics
google:
id: G-H4LBG7NDFZ

View file

@ -43,6 +43,14 @@
})();
</script>
{{ end }}
{{ with .cloudflare }}
<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "{{ .token }}"}'
></script>
<!-- End Cloudflare Web Analytics -->
{{ end }}
{{ end }}
{{ end }}
{{ end }}