Installing Google Analytics on Joomla
From WBITT's Cooker!
(Difference between revisions)
Kamran (Talk | contribs)
(Created page with '<pre> [root@www layouts]# pwd /var/www/vhosts/wbitt.com/httpdocs/templates/ja_purity_ii/layouts [root@www layouts]# [root@www layouts]# vi default-joomla.php [root@www layout…')
Newer edit →
(Created page with '<pre> [root@www layouts]# pwd /var/www/vhosts/wbitt.com/httpdocs/templates/ja_purity_ii/layouts [root@www layouts]# [root@www layouts]# vi default-joomla.php [root@www layout…')
Newer edit →
Revision as of 16:27, 5 March 2011
[root@www layouts]# pwd /var/www/vhosts/wbitt.com/httpdocs/templates/ja_purity_ii/layouts [root@www layouts]# [root@www layouts]# vi default-joomla.php [root@www layouts]# vi default.php
Add the code: from the google analytics page of your website's profile page:
Before editing:
<head> <?php $this->loadBlock('head') ?> </head>
After editing:
<head> <?php $this->loadBlock('head') ?> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-838bzay-x']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head>