*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 3a2da54a authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Add JS snippet for Matomo analysis in the base page template

parent 579c4dd7
Branches
Tags
No related merge requests found
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
THEME_TUW_LOCAL_LOGIN_ENABLED = True THEME_TUW_LOCAL_LOGIN_ENABLED = True
"""Controls whether or not to display the form fields for login via email/password.""" """Controls whether or not to display the form fields for login via email/password."""
THEME_TUW_MATOMO_ENABLED = True
"""Controls whether or not to include the JS snippet for Matomo in the base template."""
THEME_TUW_MATOMO_URL = "http://s191.dl.hpc.tuwien.ac.at/"
"""The URL under which Matomo is reachable."""
APP_THEME = ["semantic-ui"] APP_THEME = ["semantic-ui"]
......
...@@ -54,7 +54,26 @@ ...@@ -54,7 +54,26 @@
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
{%- endblock css %} {%- endblock css %}
{%- block tuw_metadata %}{%- endblock tuw_metadata %} {%- block tuw_metadata %}{%- endblock tuw_metadata -%}
{%- block tracking %}
{%- if config.get("THEME_TUW_MATOMO_ENABLED", False) %}
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="{{ config.get('THEME_TUW_MATOMO_URL') }}";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
{% endif -%}
{% endblock tracking -%}
{%- endblock head %} {%- endblock head %}
</head> </head>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment