Forums | Mahara Community

Support /
Installing Google Analytics


Robin Leung's profile picture
Posts: 12

05 November 2015, 13:25

I've looked at older forums on how to install Google Analytics but they seem to be obsolete for more recent versions (e.g.15.04 and up).

Are there proper instructions on how to setup Google Analytics with Mahara?

Thanks.

 

Aaron Wells's profile picture
Posts: 896

05 November 2015, 17:04

Hi Robin,

You should be able to do it using the optional $cfg->additionalhtmlhead setting (documented in htdocs/lib/config-defaults.php).

Just paste your Google Analytics tracking snippet into the param, in your config.php file. It should look something like this:

$cfg->additionalhtmlhead = <<<'HTML'
<script type="application/javascript">
// Your snippet goes here
</script>
HTML;

Cheers,

Aaron

Robin Leung's profile picture
Posts: 12

06 November 2015, 6:53

Thanks Aaron. Found it! Will give that a try.

 

Robin Leung's profile picture
Posts: 12

06 November 2015, 8:19

And it works! Thanks. :)

4 results