Skip to content
Snippets Groups Projects
Verified Commit 161ac679 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

add matomo parts to deploy script

parent 269f3391
No related branches found
No related tags found
No related merge requests found
......@@ -49,23 +49,12 @@ do
# 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
matomoTagOrig='<!-- matomohead -->'
sed -i '' "/${matomoTagOrig}/r./.ci/analytics/head.html" theme/templates/_index.html
matomoTagOrig='<!-- matomopolicy -->'
sed -i '' "/${matomoTagOrig}/r./.ci/analytics/policy.html" theme/templates/_index.html
matomoTagOrig='<!-- matomobanner -->'
sed -i '' "/${matomoTagOrig}/r./.ci/analytics/gdpr-banner.html" theme/templates/_index.html
fi
# install npm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment