Verified Commit 161ac679 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

add matomo parts to deploy script

parent 269f3391
...@@ -49,23 +49,12 @@ do ...@@ -49,23 +49,12 @@ do
# add matomo # add matomo
if [[ -v matomoID ]]; then if [[ -v matomoID ]]; then
matomoTagOrig='<!-- Matomo -->' matomoTagOrig='<!-- matomohead -->'
matomoTag="<script type='text/javascript'>" sed -i '' "/${matomoTagOrig}/r./.ci/analytics/head.html" theme/templates/_index.html
matomoTag="${matomoTag} var _paq = window._paq || [];" matomoTagOrig='<!-- matomopolicy -->'
matomoTag="${matomoTag} /* tracker methods like 'setCustomDimension' should be called before 'trackPageView' */" sed -i '' "/${matomoTagOrig}/r./.ci/analytics/policy.html" theme/templates/_index.html
matomoTag="${matomoTag} _paq.push(['trackPageView']);" matomoTagOrig='<!-- matomobanner -->'
matomoTag="${matomoTag} _paq.push(['enableLinkTracking']);" sed -i '' "/${matomoTagOrig}/r./.ci/analytics/gdpr-banner.html" theme/templates/_index.html
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 fi
# install npm # install npm
......
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