mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 09:41:25 -04:00
feat: add google analytics support (#70)
* feat: support google analytics * docs: add instruction for setting up ga
This commit is contained in:
13
layouts/partials/google-analytics.html
Normal file
13
layouts/partials/google-analytics.html
Normal 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 }}
|
Reference in New Issue
Block a user