I had a problem when including Google Analytics Code. It doesn't work.
I searched the forum but have not found a really good answer.
Most of the answers tell to update head.php or footer.php and put manually the Analytics Code there.
I was thinking... We have a greate tool to manage the template and we have to only put the code there.
Then let update "where" the template manager includes the code.
Then I am posting bellow the updates to continue using the template.
Lets explain ( I am using Penguim Template, but I think this is same to all ).
1) In template gk_penguinmail the Analytics Code is included in "templates/gk_penguinmail/layouts/blocks/social.php".
Look to see if in YOUR template is the same.
At the end of this file there is the following lines.
- Code: Select all
<?php
// put Google Analytics code
echo $this->googleAnalyticsParser();
?>
Copy the line "
- Code: Select all
echo $this->googleAnalyticsParser();
Comment this line to don't show it again here.
The code will be like this:
- Code: Select all
<?php
// put Google Analytics code
//echo $this->googleAnalyticsParser();
?>
2) We have to put it at the end of the file
"templates/gk_penguinmail/layouts/blocks/head.php".
Look to see if in YOUR template is the same.
Now just include the line that you copy at the end of the file.
The code will be like this:
- Code: Select all
echo $this->googleAnalyticsParser();
Without "<?php" or "?>".
Well, thats it.
Refresh your browser. And it is working!
Now only update your Analytics Code in Template Managar and it will work.
Bye.
Hamilton