Skip to content

Commit

Permalink
templates: add matomo
Browse files Browse the repository at this point in the history
  • Loading branch information
lnielsen committed Sep 6, 2023
1 parent fe5365a commit 6c5098a
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
17 changes: 17 additions & 0 deletions templates/base-about.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,20 @@
{% endblock %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}{{ this.body }}{% endblock %}
{% block trackingcode %}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://webanalytics.web.cern.ch/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '361']);
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>
<!-- End Matomo Code -->
{% endblock %}
17 changes: 17 additions & 0 deletions templates/base-blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,20 @@
{% block subnavbar %}{% endblock %}
{% block title %}Zenodo Blog{% endblock %}
{% block body %}{{ this.body }}{% endblock %}
{% block trackingcode %}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://webanalytics.web.cern.ch/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '362']);
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>
<!-- End Matomo Code -->
{% endblock %}
17 changes: 17 additions & 0 deletions templates/base-help.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,20 @@
{% endblock %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}{{ this.body }}{% endblock %}
{% block trackingcode %}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://webanalytics.web.cern.ch/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '363']);
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>
<!-- End Matomo Code -->
{% endblock %}
18 changes: 18 additions & 0 deletions templates/base-projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@ <h3><a href="{{child.path|url}}">{{child.title}}</a></h3>
</div>
{%- endfor %}
{%- endblock %}

{% block trackingcode %}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://webanalytics.web.cern.ch/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '363']);
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>
<!-- End Matomo Code -->
{% endblock %}
6 changes: 6 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# submit itself to any jurisdiction.
-#}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
{% block og_image %}
<meta property="og:image" content="https://blog.zenodo.org/static/img/logos/zenodo-gradient-1000.png" />
Expand Down Expand Up @@ -51,6 +53,7 @@
<title>{% if title %}{% block title %}{% endblock %} | {% endif %}Zenodo</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
<header>
<nav class="navbar navbar-default navbar-static-top">
Expand Down Expand Up @@ -172,4 +175,7 @@ <h5>Funded by</h5>
</div>
</div>
</footer>
{% block trackingcode %}
{% endblock %}
</body>
</html>

0 comments on commit 6c5098a

Please sign in to comment.