mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-23 22:24:18 +02:00
Added Matomo analytics configuration options
This commit is contained in:
@@ -8,6 +8,9 @@ ZIP_DOWNLOADS=true
|
||||
|
||||
GOOGLE_ANALYTICS_ID=false
|
||||
|
||||
MATOMO_ANALYTICS_URL=false
|
||||
MATOMO_ANALYTICS_ID=false
|
||||
|
||||
SORT_ORDER=type
|
||||
REVERSE_SORT=false
|
||||
|
||||
|
@@ -60,6 +60,20 @@ return [
|
||||
*/
|
||||
'google_analytics_id' => Helpers::env('GOOGLE_ANALYTICS_ID', false),
|
||||
|
||||
/**
|
||||
* Your Matomo analytics URL.
|
||||
*
|
||||
* Default value: false
|
||||
*/
|
||||
'matomo_analytics_url' => Helpers::env('MATOMO_ANALYTICS_URL', false),
|
||||
|
||||
/**
|
||||
* Your Matomo analytics site ID.
|
||||
*
|
||||
* Default value: false
|
||||
*/
|
||||
'matomo_analytics_site_id' => Helpers::env('MATOMO_ANALYTICS_SITE_ID', false),
|
||||
|
||||
/**
|
||||
* Sorting order of files and folders.
|
||||
*
|
||||
|
15
app/views/components/analytics/matomo.twig
Normal file
15
app/views/components/analytics/matomo.twig
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- Matomo -->
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="{{ config('matomo_analytics_url') }}";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{ config("matomo_analytics_site_id") }}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src='//cdn.matomo.cloud/directorylister.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Matomo Code -->
|
@@ -7,7 +7,11 @@
|
||||
<link rel="stylesheet" href="{{ asset('app.css') }}">
|
||||
|
||||
{% if config('google_analytics_id', false) %}
|
||||
{% include 'components/google-analytics.twig' %}
|
||||
{% include 'components/analytics/google.twig' %}
|
||||
{% endif %}
|
||||
|
||||
{% if config('matomo_analytics_url', false) and config('matomo_analytics_site_id', false) %}
|
||||
{% include 'components/analytics/matomo.twig' %}
|
||||
{% endif %}
|
||||
|
||||
<title>{{ title }} • Directory Lister</title>
|
||||
|
Reference in New Issue
Block a user