added matomo
This commit is contained in:
parent
0d91b61bd0
commit
81c239f043
@ -10,6 +10,7 @@ $config = [
|
||||
'base_url' => 'http://localhost:8000',
|
||||
'secure_key' => '', //64 alphanumeric characters
|
||||
'logfile' => '/logs/novaconium.log',
|
||||
'loglevel' => 'ERROR', // 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'NONE'
|
||||
'loglevel' => 'ERROR', // 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'NONE',
|
||||
'matomo' => '1',
|
||||
'fonts' => 'https://fonts.googleapis.com/css2?family=VT323:wght@400&family=Fira+Code:wght@400;500&display=swap&family=Material+Icons:wght@400;500&display=swap'
|
||||
];
|
||||
|
||||
@ -17,6 +17,7 @@ $log = new Logger(\BASEPATH . $config['logfile'], $config['loglevel']);
|
||||
// --- Twig Data Array ---
|
||||
$data = [];
|
||||
$data['fonts'] = $config['fonts'] ?? [];
|
||||
$data['matomo'] = $config['matomo'] ?? 0;
|
||||
|
||||
// --- Session ---
|
||||
use Novaconium\Session;
|
||||
|
||||
@ -9,3 +9,20 @@
|
||||
{% if editor == 'ace' %}
|
||||
{% include '@novaconium/javascript/ace.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
{% if matomo > 0 %}
|
||||
<!-- Matomo -->
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u = "//matomo.4lt.ca/";
|
||||
_paq.push(['setTrackerUrl', u + 'matomo.php']);
|
||||
_paq.push(['setSiteId', {{ matomo }}]);
|
||||
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
||||
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Matomo Code -->
|
||||
{% endif %}
|
||||
Loading…
x
Reference in New Issue
Block a user