diff options
author | Matei-Marius Micu <micumatei@gmail.com> | 2021-03-04 22:52:01 +0300 |
---|---|---|
committer | Matei-Marius Micu <micumatei@gmail.com> | 2021-03-05 12:17:50 +0300 |
commit | 29caab09da12a461c41f400a702679a8d516697a (patch) | |
tree | f7cd11ccb6597b7c98b46918ecdf3430a98d957d | |
parent | f061118086d776771c6a36d007a1c016966a1c46 (diff) |
Add Hotjar support
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/analytics/hotjar.html | 10 | ||||
-rw-r--r-- | layouts/partials/footer.html | 4 |
4 files changed, 19 insertions, 2 deletions
@@ -87,6 +87,9 @@ rootURL = "//matomo.example.com/" [params.fathomAnalytics] rootURL = "//fathom.example.com/" +[params.hotjarAnalytics] +hjid = 1 + [taxonomies] tag ="tags" @@ -171,7 +174,7 @@ on demand loading: ```toml [params.features] -disqusOnDemand = true +disqusOnDemand = true ``` ## Single Page Configuration diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 178b63e..cfbe5e6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -61,4 +61,4 @@ rootURL = "//fathom.example.com/" tag ="tags" [blackfriday] -hrefTargetBlank = true
\ No newline at end of file +hrefTargetBlank = true diff --git a/layouts/partials/analytics/hotjar.html b/layouts/partials/analytics/hotjar.html new file mode 100644 index 0000000..61e103c --- /dev/null +++ b/layouts/partials/analytics/hotjar.html @@ -0,0 +1,10 @@ +<script> + (function(h,o,t,j,a,r){ + h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; + h._hjSettings={hjid:'{{ .Site.Params.hotjarAnalytics.hjid }}',hjsv:6}; + a=o.getElementsByTagName('head')[0]; + r=o.createElement('script');r.async=1; + r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; + a.appendChild(r); + })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); +</script> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 707adf1..9772654 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -15,5 +15,9 @@ {{ if .Site.Params.fathomAnalytics }} {{- partial "analytics/fathom" . -}} {{ end }} + +{{ if .Site.Params.hotjarAnalytics}} +{{- partial "analytics/hotjar" . -}} +{{ end }} </body> </html> |