Google Analytics Code

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Mon Feb 06, 2012 3:39 pm
Hi.

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. :cry:
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. :idea:

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. B)

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. B)

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
User avatar
Fresh Boarder

GK User
Mon Feb 06, 2012 11:20 pm
We've tested this feature many many times and notice any problems with Google Analytics code, please make sure that you set code in proper format - not full code but only identifier like GA-XXXX and remember that google needs some time to track first visitors on your site.
User avatar
Platinum Boarder


cron