feat: add optional matomo tracking for pageviews and download
This commit is contained in:
@@ -159,6 +159,22 @@
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
{% if matomo_url and matomo_site_id %}
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u = '{{ matomo_url }}/';
|
||||
_paq.push(['setTrackerUrl', u + 'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{ matomo_site_id }}']);
|
||||
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>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
@@ -230,6 +246,12 @@
|
||||
</main>
|
||||
|
||||
<script>
|
||||
function trackMatomoEvent(category, action, name) {
|
||||
if (window._paq && Array.isArray(window._paq)) {
|
||||
window._paq.push(['trackEvent', category, action, name]);
|
||||
}
|
||||
}
|
||||
|
||||
let currentFile = null;
|
||||
let currentFilename = null;
|
||||
|
||||
@@ -334,6 +356,8 @@
|
||||
window.URL.revokeObjectURL(url);
|
||||
a.remove();
|
||||
|
||||
trackMatomoEvent("pdf_to_ics", "download", "ics_export");
|
||||
|
||||
resetForm();
|
||||
} catch (error) {
|
||||
showError(`Fehler: ${error.message}`);
|
||||
|
||||
@@ -87,6 +87,22 @@
|
||||
color: #4b5563;
|
||||
}
|
||||
</style>
|
||||
{% if matomo_url and matomo_site_id %}
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u = '{{ matomo_url }}/';
|
||||
_paq.push(['setTrackerUrl', u + 'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{ matomo_site_id }}']);
|
||||
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>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<main class="wrap">
|
||||
|
||||
Reference in New Issue
Block a user