Add Fathom analytics support
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
f340dbd03c
commit
c44010deff
|
@ -15,7 +15,8 @@ theme = "hello-friend-ng"
|
|||
keywords = "homepage, blog, android, kotlin, programming"
|
||||
contentTypeName = "posts"
|
||||
defaultTheme = "dark"
|
||||
customJS = ["https://stats.msfjarvis.website/kis3.js"]
|
||||
FathomAnalyticsDomain = "stats.msfjarvis.website"
|
||||
FathomAnalyticsSiteId = "BXNEC"
|
||||
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
|
|
|
@ -16,6 +16,24 @@
|
|||
</script>
|
||||
{{- end}}
|
||||
|
||||
{{- if .Site.Params.FathomAnalyticsDomain }}
|
||||
<!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
|
||||
<script>
|
||||
(function(f, a, t, h, o, m){
|
||||
a[h]=a[h]||function(){
|
||||
(a[h].q=a[h].q||[]).push(arguments)
|
||||
};
|
||||
o=f.createElement('script'),
|
||||
m=f.getElementsByTagName('script')[0];
|
||||
o.async=1; o.src=t; o.id='fathom-script';
|
||||
m.parentNode.insertBefore(o,m)
|
||||
})(document, window, '//{{.Site.Params.FathomAnalyticsDomain}}/tracker.js', 'fathom');
|
||||
fathom('set', 'siteId', '{{.Site.Params.FathomAnalyticsSiteId}}');
|
||||
fathom('trackPageview');
|
||||
</script>
|
||||
<!-- / Fathom -->
|
||||
{{- end }}
|
||||
|
||||
{{ range $val := $.Site.Params.customJS }}
|
||||
{{ if gt (len $val) 0 }}
|
||||
<script src="{{ $val }}"></script>
|
||||
|
|
Loading…
Reference in New Issue