Add fathom support

Add fathom support if you have a `fathomurl` specified in your config

Signed-off-by: Eli Uriegas <seemethere101@gmail.com>
This commit is contained in:
Eli Uriegas
2018-07-10 18:28:16 -07:00
committed by Michael Noronha
parent 62b802dc78
commit c5608bd5eb

View File

@@ -24,6 +24,23 @@
<script src="{{ .Site.BaseURL }}js/social-share-kit.min.js" defer></script>
{{ end }}
{{ if .Site.Params.fathomurl }}
<!-- 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.fathomurl }}/tracker.js', 'fathom');
fathom('trackPageview');
</script>
<!-- / Fathom -->
{{ end }}
{{ template "_internal/google_analytics_async.html" . }}
<script>