1
0
Fork 0

feat: add matomo tracking
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Lucien Cartier-Tilet 2023-04-02 14:31:08 +02:00
parent 9328c598f5
commit 0215373c0b
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,17 @@ interface SimplifiedHeader {
content: [any];
}
const matomoTrackingCode = `var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.phundrak.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '4']);
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);
})();`;
const simplifiedHead = [
{
tag: 'meta',
@ -128,6 +139,7 @@ simplifiedHead.map((tag: SimplifiedHeader) => {
{ rel: 'me', href: 'https://emacs.ch/@phundrak' },
'Mastodon',
]);
head.push(['script', {}, matomoTrackingCode]);
});
export default head;