Add Fathom script to master view
This commit is contained in:
parent
1996d6906c
commit
546f952466
4 changed files with 26 additions and 4 deletions
|
@ -56,6 +56,8 @@ PIWIK=false
|
|||
PIWIK_ID=1
|
||||
PIWIK_URL=https://analytics.jmb.lv/piwik.php
|
||||
|
||||
FATHOM_ID=
|
||||
|
||||
APP_TIMEZONE=UTC
|
||||
APP_LANG=en
|
||||
APP_LOG=daily
|
||||
|
|
|
@ -25,6 +25,7 @@ class CSPHeader
|
|||
script-src 'self' 'unsafe-inline' 'unsafe-eval' \
|
||||
https://api.mapbox.com \
|
||||
https://analytics.jmb.lv \
|
||||
https://fathom.jonnybarnes.uk \
|
||||
blob:; \
|
||||
style-src 'self' 'unsafe-inline' \
|
||||
https://api.mapbox.com \
|
||||
|
|
7
config/fathom.php
Normal file
7
config/fathom.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'id' => env('FATHOM_ID', null),
|
||||
|
||||
];
|
|
@ -61,10 +61,22 @@
|
|||
<p>Built with love: <a href="/colophon">Colophon</a></p>
|
||||
<p><a href="https://indieweb.org"><img src="/assets/img/iwc.svg" alt="Indie Web Camp logo"></a></p>
|
||||
</footer>
|
||||
@if (config('app.piwik') === true)
|
||||
<!-- Piwik -->
|
||||
<script src="https://analytics.jmb.lv/piwik.js" async defer></script>
|
||||
<script src="/assets/js/piwik.js"></script>
|
||||
@if(config('fathom.id'))
|
||||
<!-- 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, '//fathom.jonnybarnes.uk/tracker.js', 'fathom');
|
||||
fathom('set', 'siteId', '{{ config('fathom.id') }}');
|
||||
fathom('trackPageview');
|
||||
</script>
|
||||
<!-- / Fathom -->
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue