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_ID=1
|
||||||
PIWIK_URL=https://analytics.jmb.lv/piwik.php
|
PIWIK_URL=https://analytics.jmb.lv/piwik.php
|
||||||
|
|
||||||
|
FATHOM_ID=
|
||||||
|
|
||||||
APP_TIMEZONE=UTC
|
APP_TIMEZONE=UTC
|
||||||
APP_LANG=en
|
APP_LANG=en
|
||||||
APP_LOG=daily
|
APP_LOG=daily
|
||||||
|
|
|
@ -25,6 +25,7 @@ class CSPHeader
|
||||||
script-src 'self' 'unsafe-inline' 'unsafe-eval' \
|
script-src 'self' 'unsafe-inline' 'unsafe-eval' \
|
||||||
https://api.mapbox.com \
|
https://api.mapbox.com \
|
||||||
https://analytics.jmb.lv \
|
https://analytics.jmb.lv \
|
||||||
|
https://fathom.jonnybarnes.uk \
|
||||||
blob:; \
|
blob:; \
|
||||||
style-src 'self' 'unsafe-inline' \
|
style-src 'self' 'unsafe-inline' \
|
||||||
https://api.mapbox.com \
|
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>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>
|
<p><a href="https://indieweb.org"><img src="/assets/img/iwc.svg" alt="Indie Web Camp logo"></a></p>
|
||||||
</footer>
|
</footer>
|
||||||
@if (config('app.piwik') === true)
|
@if(config('fathom.id'))
|
||||||
<!-- Piwik -->
|
<!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
|
||||||
<script src="https://analytics.jmb.lv/piwik.js" async defer></script>
|
<script>
|
||||||
<script src="/assets/js/piwik.js"></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
|
@endif
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue