Verified Commit ecdd2142 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

add matomo to courses

parent 410d11cb
......@@ -47,6 +47,27 @@ do
ln -s ../../theme/package.json package.json
ln -s ../../theme theme
# add matomo
if [[ -v matomoID ]]; then
matomoTagOrig='<!-- Matomo -->'
matomoTag="<script type='text/javascript'>"
matomoTag="${matomoTag} var _paq = window._paq || [];"
matomoTag="${matomoTag} /* tracker methods like 'setCustomDimension' should be called before 'trackPageView' */"
matomoTag="${matomoTag} _paq.push(['trackPageView']);"
matomoTag="${matomoTag} _paq.push(['enableLinkTracking']);"
matomoTag="${matomoTag} (function() {"
matomoTag="${matomoTag} var u='https://analytics.lcsb.uni.lu/hub/';"
matomoTag="${matomoTag} _paq.push(['setTrackerUrl', u+'matomo.php']);"
matomoTag="${matomoTag} _paq.push(['setSiteId', '${matomoID}']);"
matomoTag="${matomoTag} var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];"
matomoTag="${matomoTag} g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);"
matomoTag="${matomoTag} })();"
matomoTag="${matomoTag} </script>"
# replace the tag
sed -i '' 's#'"$matomoTagOrig"'#'"$matomoTag"'#g' theme/templates/_index.html
fi
# install npm
yarn global add grunt-cli generator-reveal
yarn install
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment