feat: add google analytics support (#70)

* feat: support google analytics

* docs: add instruction for setting up ga
This commit is contained in:
Xin
2023-09-21 08:03:35 +01:00
committed by GitHub
parent b51bfa3177
commit 4e63aa4f14
4 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,13 @@
{{ with .Site.GoogleAnalytics }}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "{{ . }}");
</script>
{{ end }}