Skip to content

Commit

Permalink
adds matomo analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Geert van Geest committed Aug 28, 2024
1 parent cc43004 commit 8941c34
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ theme:
name: material
logo: assets/images/SIB_logo.svg
favicon: assets/images/SIB_logo.svg
custom_dir: overrides

# Repository
repo_name: sib-swiss/NGS-longreads-training
Expand All @@ -41,8 +42,8 @@ markdown_extensions:
- pymdownx.tabbed
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
options:
custom_icons:
- overrides/.icons
Expand All @@ -55,6 +56,10 @@ extra_css:
extra:
version:
provider: mike
analytics:
provider: matomo
base_url: https://matomo.sib.swiss/
site_id: 220

extra_javascript:
- javascripts/config.js
Expand Down
15 changes: 15 additions & 0 deletions overrides/partials/integrations/analytics/matomo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- 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="{{ config.extra.analytics.base_url }}";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ config.extra.analytics.site_id }}']);
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 -->

0 comments on commit 8941c34

Please sign in to comment.