[% '<style>'; custom_css ; '</style>' %]
[% END %]
+ [% matomo_id = ctx.get_org_setting(ctx.search_ou, 'opac.analytics.matomo_id'); %]
+ [% matomo_url = ctx.get_org_setting(ctx.search_ou, 'opac.analytics.matomo_url'); %]
+ [% IF matomo_id && matomo_url %]
+ [% matomo_enabled = 1; %]
+ [% END %]
+
[%- libname = ctx.get_aou(ctx.search_ou).name;
libname = libname | html;
libsname = ctx.get_aou(ctx.search_ou).shortname; %]
[% IF !ctx.is_staff %]
[% INCLUDE 'opac/parts/goog_analytics.tt2' %]
+ [% INCLUDE 'opac/parts/matomo_analytics.tt2' %]
[% END %]
[% PROCESS 'opac/parts/stripe.tt2' %]
<script src="[% ctx.media_prefix %]/opac/deps/node_modules/jquery/dist/jquery.min.js"></script>
--- /dev/null
+[%- PROCESS "opac/parts/header.tt2";
+ IF matomo_enabled == 1 %]
+
+ <!-- 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="[% matomo_url %]";
+ _paq.push(['setTrackerUrl', u+'matomo.php']);
+ _paq.push(['setSiteId', '[% matomo_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=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+ })();
+ </script>
+ <!-- End Matomo Code -->
+[%- END %]