Page 1 of 2
[1.4.0] [FIX] Google Analytics
Posted: Tue Jan 12, 2010 2:19 pm
by imaginetech
Line 33:-
Code: Select all
if ($this->config->get('google_analytics_status')) {
$this->data['google_analytics'] = $this->config->get('google_analytics_code');
} else {
$this->data['google_analytics'] = '';
}
Should be:-
Code: Select all
if ($this->config->get('google_analytics_status')) {
$this->data['google_analytics'] = html_entity_decode($this->config->get('google_analytics_code'), ENT_QUOTES);
} else {
$this->data['google_analytics'] = '';
}
Re: [BUG] Opencart v1.4 - Google Analytics
Posted: Thu Jan 14, 2010 3:53 am
by Daniel
Thanks!
Re: [BUG] Opencart v1.4 - Google Analytics
Posted: Thu Jan 14, 2010 7:33 am
by max007
can you tell me the file name to fix my google analytic
i see lot bug version 1.40
Google checkout Blanc Page
Re: [BUG] Opencart v1.4 - Google Analytics
Posted: Thu Jan 14, 2010 10:55 am
by dangkhoaweb
max007 wrote:can you tell me the file name to fix my google analytic
i see lot bug version 1.40
Google checkout Blanc Page
change in this file catalog/controler/common/footer.php
hope it helps
Re: [BUG] Opencart v1.4 - Google Analytics
Posted: Thu Jan 14, 2010 6:25 pm
by OSWorX
Attached the fixed file - just unzip and copy to server by FTP to:
../catalog/controler/common/footer.php
Re: [1.4.0] [FIX] Google Analytics
Posted: Sun Jan 17, 2010 9:04 am
by daysgonebyantiques
Did that, thanks for the fix! But I'm looking at my modules and I noticed that since I upgraded to 1.4 GA is listed twice in my list of modules. I've installed one and made sure the other is uninstalled and disabled, I just thought seeing it listed twice was weird.
Re: [1.4.0] [FIX] Google Analytics
Posted: Thu Feb 04, 2010 12:55 am
by tommyla
big thanks, now can i see how many visitors my fathers store has!

Re: [1.4.0] [FIX] Google Analytics
Posted: Thu Feb 04, 2010 9:19 pm
by MrSkins
I know I'm a bit of a noob to this, I have tried to copy the new file and with no luck, also the above fix is a .php file and the footer files are .tpl anyone help, I'm must be missing something here really obvious!
I have been running the new Dark theme but found a few bugs so swapped back to the default theme, would this have any impact?
OC 1.4
crystalcornucopia.co.uk
Re: [1.4.0] [FIX] Google Analytics
Posted: Thu Feb 04, 2010 9:31 pm
by OSWorX
Just download the file, unzip it locally and transfer the file (it is only one .php) to the same folder as you can see after unzipping catalog/controller/common.
Be shure that you overwrite the original file!
Thats it.
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:28 am
by MrSkins
Many thanks, yes I missed that folder, done it and for some reason its showing raw data on my home page?
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:42 am
by Miguelito
MrSkins, post your code in file catalog/controler/common/footer.php so we can see what causes that.
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:46 am
by MrSkins
Code: Select all
<?php
/**
* @version $Id: footer.php 368 2010-01-14 10:19:57Z michael $
* @package Common Footer - Controller
* @copyright (C) 2010 hhttp://www.opencart.com. All Rights Reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL v.3
*/
class ControllerCommonFooter extends Controller {
protected function index() {
$this->language->load('common/footer');
$this->data['text_powered_by'] = sprintf($this->language->get('text_powered_by'), $this->config->get('config_store'), date('Y', time()));
$this->id = 'footer';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/footer.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/footer.tpl';
} else {
$this->template = 'default/template/common/footer.tpl';
}
if ($this->config->get('google_analytics_status')) {
$this->data['google_analytics'] = html_entity_decode( $this->config->get( 'google_analytics_code' ), ENT_QUOTES );
} else {
$this->data['google_analytics'] = '';
}
$this->render();
}
}
Hope this helps
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:48 am
by Miguelito
I compared your site source code and in the end there's:
Code: Select all
</div>
</div>
if ($this->config->get('google_analytics_status')) {
$this->data['google_analytics'] = html_entity_decode($this->config->get('google_analytics_code'), ENT_QUOTES);
} else {
$this->data['google_analytics'] = '';
}
</body></html>
When it should be something like this:
Code: Select all
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12492232-1");
pageTracker._trackPageview();
} catch(err) {}</script></body></html>
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:51 am
by Miguelito
Hope you have the php code closing tag (?>) in that file?
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 11:28 am
by imaginetech
Make the edit to the footer.php controller file as per the first post in this thread and your fixed.
It's literally one line to change.
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:04 pm
by OSWorX
Miguelito wrote:Hope you have the php code closing tag (?>) in that file?
No need to have this.
Just for reference (good coding practice) e.g.:
#1
http://framework.zend.com/manual/en/cod ... tting.html
#2
http://blog.isnoop.net/2008/10/24/php-c ... r-cookies/
More results with your preferred search engine.
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:07 pm
by OSWorX
MrSkins wrote:Many thanks, yes I missed that folder, done it and for some reason its showing raw data on my home page?
When i read this ' .. missed that folder .. ', I am asking myself if you
1. have OC 1.4.0.0
2. copied all files from the OC package to your server (did you ever made a comparison?)
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 2:49 pm
by spartanic
I downloaded the attachment by Joomx and overwrote the old footer file and now I get this error:
Error: Could not load template /home/jdmex2/public_html/driven2race/admin/view/template/default/template/common/footer.tpl!
Looks like the software is look for a tpl file and not the php version. Any ideas?
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 3:00 pm
by spartanic
Nevermind, problem fixed. Turns out there's a very similar directory also located within the admin with the same footer file that screwed up when I overwrote it.
Re: [1.4.0] [FIX] Google Analytics
Posted: Fri Feb 05, 2010 3:29 pm
by OSWorX
spartanic wrote:Nevermind, problem fixed. Turns out there's a very similar directory also located within the admin with the same footer file that screwed up when I overwrote it.
That's why i wrote the folder where to place
(
this is the frontend NOT the backend (admin)):
../catalog/controler/common/footer.php
see:
http://forum.opencart.com/viewtopic.php ... 376#p45455