From b28ffb722f0d3dd8d9ab8ea5954fa18ca005bfe3 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 3 Jul 2019 14:19:42 -0400 Subject: [PATCH] Basic Matomo Analytics support After you have set up a Matomo Analytics server, you can track web analytics by customizing templates/opac/parts/config.tt2 to identify your Matomo server URL and the ID of the site you are tracking. Signed-off-by: Dan Scott --- Open-ILS/src/templates/opac/parts/base.tt2 | 1 + Open-ILS/src/templates/opac/parts/config.tt2 | 11 ++++++++++ .../templates/opac/parts/matomo_analytics.tt2 | 18 ++++++++++++++++ .../designing_your_catalog.adoc | 21 +++++++++++++++++++ docs/opac/new_skin_customizations.adoc | 2 +- 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/templates/opac/parts/matomo_analytics.tt2 diff --git a/Open-ILS/src/templates/opac/parts/base.tt2 b/Open-ILS/src/templates/opac/parts/base.tt2 index aa12e39ebe..c18a981cb0 100644 --- a/Open-ILS/src/templates/opac/parts/base.tt2 +++ b/Open-ILS/src/templates/opac/parts/base.tt2 @@ -39,6 +39,7 @@ [% IF !ctx.is_staff %] [% INCLUDE 'opac/parts/goog_analytics.tt2' %] + [% INCLUDE 'opac/parts/matomo_analytics.tt2' %] [% END %] [% PROCESS 'opac/parts/stripe.tt2' %] diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index 48b4f0fee5..f9d3edd2a8 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -50,6 +50,17 @@ openurl.baseurl = 'http://sfx.example.com/instance'; google_analytics.enabled = 'false'; google_analytics.code = 'UA-9999999-99'; +############################################################################## +# Matomo Analytics support +############################################################################## +# You can enable Matomo Analytics support in Evergreen by specifying your +# Matomo Analytics URL, the ID of the site you are tracking, and changing +# 'false' to 'true' +############################################################################## +matomo_analytics.enabled = 'false'; +matomo_analytics.url = 'https://example.com/matomo/'; +matomo_analytics.site = '1'; + ############################################################################## # Ebook API integration ############################################################################## diff --git a/Open-ILS/src/templates/opac/parts/matomo_analytics.tt2 b/Open-ILS/src/templates/opac/parts/matomo_analytics.tt2 new file mode 100644 index 0000000000..5f2ffd84d1 --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/matomo_analytics.tt2 @@ -0,0 +1,18 @@ +[%- PROCESS "opac/parts/header.tt2"; + IF matomo_analytics.enabled == 'true' -%] + + + +[%- END -%] diff --git a/docs/admin_initial_setup/designing_your_catalog.adoc b/docs/admin_initial_setup/designing_your_catalog.adoc index 566082140b..59acb6b72d 100644 --- a/docs/admin_initial_setup/designing_your_catalog.adoc +++ b/docs/admin_initial_setup/designing_your_catalog.adoc @@ -563,6 +563,27 @@ will need to edit _config.tt2_ in your template. To enable the service set the value of google_analytics.enabled to true and change the value of _google_analytics.code_ to be the code in your Google Analytics account. +Matomo Analytics +~~~~~~~~~~~~~~~~ + +Matomo Analytics (https://matomo.org/) is free software that you can host +yourself, so that you can collect web site statistics without sharing your +users' data with third parties. Statistic tracking is disabled by default +through the Evergreen client software when library staff use your site within +the client, but active when anyone uses the site without the client. This was +a preventive measure to reduce the potential risks for leaking patron +information. To use Matomo Analytics you need to: + +. Set up a hosted instance of Matomo +. Add your Evergreen catalogue as a site +. Edit _config.tt2_ in your templates as follows: +.. Set the value of _matomo_analytics.enabled_ to _'true'_ +.. Set the value of _matomo_analytics.url_ to the location of your Matomo + Analytics site (for example, "https://opac.example.org/matomo/") +.. Set the value of _matomo_analytics.site_ to the site ID for your Evergreen + catalogue + + NoveList ~~~~~~~~ diff --git a/docs/opac/new_skin_customizations.adoc b/docs/opac/new_skin_customizations.adoc index 88ffee835c..7576959176 100644 --- a/docs/opac/new_skin_customizations.adoc +++ b/docs/opac/new_skin_customizations.adoc @@ -50,7 +50,7 @@ NOTE: All paths are relative to `/openils/var/templates/opac` ** hiding the *Place Hold* button for available items ** enabling RefWorks support for citation management ** adding OpenURL resolution for electronic resources - ** enabling Google Analytics tracking for your TPAC + ** enabling Google Analytics or Matomo Analytics tracking for your TPAC ** displaying the "Forgot your password?" prompt ** controlling the size of cover art on the record details page ** defining which facets to display, and in which order -- 2.43.2