Forums | Mahara Community
Open Discussion
/
Using Matomo / Piwik Codes
10 December 2019, 15:04
Greetings All,
I'm testing a new installation of Mahara for some associates of mine and wanted to know if anyone is using Matomo / Piwik Analytics Code on any of their projects?
My question is where would one place the code so it collects user activity on most pages?
I presume that it would be somewhere in the Theme that is active, but of course I'm not sure, hence the reason for my question ... Any advisement would be greatly appreciated.
10 December 2019, 16:49
I add my piwik code to the footer.tpl file of the raw theme. Since all themes use the raw as the code base it will use the embedded code for most pages.
11 December 2019, 10:02
Hi Marcus,
I'd recommend placing it into the config.php file with the help of the config value $cfg->additionalhtmlhead or $cfg->additionalhtmlfooter
You can see an example of what that would look like in /htdocs/lib/config-defaults.php.
By using that method, you don't need to touch a core file and don't have to watch out for a customisation during an upgrade.
Cheers
Kristina
11 December 2019, 13:41
I got it all figured out @Kristina, thank you ...
But, I would never add any foreign code to my config file anyway.
Thanks allot for your input ...