StatCounter User Forum  
StatCounter Free web tracker and counter

Go Back   StatCounter User Forum > StatCounter.com > Help

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-27-2008, 11:14 AM
swefil2005 swefil2005 is offline
Junior Member
 
Join Date: Apr 2008
Posts: 5
Default Adding Statcounter to zencart

Hi I would like to know if it is possible to add a statcounter to my shopingcart, there are no Body tags in the php pages, I have read on another post, to create a text file and call it my_counter.html and place the code there, inside the body tags.

Question, where would this file be placed.

Thanks
Swefil2005
  #2  
Old 04-27-2008, 02:40 PM
webado's Avatar
webado webado is offline
Moderator
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada
Posts: 27,708
Default

This could be done in different place and in different ways. But here's one way.

In the shopping cart folder you will find the following subfolder:

/includes/languages/

Locate the file english.php and download it by FTP. Make a backup copy of it under some other name you will remember.

Edit english.php in a plain text editor like Notepad.

Around line 30 you will find this:

Quote:
define('FOOTER_TEXT_BODY', 'Copyright &copy; ' . date('Y') . ' <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');
Add the following just before that line:

Quote:
$sc_counter = '
all your statcounter code as generated by the wizard
';
Then modify the line after this that currently reads this way:

Quote:
define('FOOTER_TEXT_BODY', 'Copyright &copy; ' . date('Y') . ' <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');

to read this way:


Quote:
define('FOOTER_TEXT_BODY', 'Copyright &copy; ' . date('Y') . ' <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>' . $sc_counter);

Zen is very complex. I know there are umpteen places in the admin interface where you can specify customization features, maybe you could have also done it there. But this is an obvious place I found without tinkering much further.


Another way which may be better and easier in fact is to navigate by FTP to the folder:

includes/templates/template_default/templates/

and download (as text or ASCII) the file named: tpl_ezpages_bar_footer.php

Edit this file in Notepad and go right to the bottom where the last line is:

Quote:
<?php } ?>
Insert the Statcounter code generated by the wizard as is right there, after that last line.

Save and upload the file back by FTP (as text or ASCII) to replace the original one.
__________________
Christina
>>Forum Moderator<<

Please do not PM me for support. The forum is here for that.
  #3  
Old 04-27-2008, 04:23 PM
Blake81 Blake81 is offline
Member
 
Join Date: Dec 2007
Posts: 35
Default

I use it on my Zen Cart site, and I put the code in as a banner. That seems to work out pretty well.
  #4  
Old 04-27-2008, 11:59 PM
swefil2005 swefil2005 is offline
Junior Member
 
Join Date: Apr 2008
Posts: 5
Thumbs up

Hi, Thanks a lot, I tried all 3 methods including the one by Blake, all work fine.

I have settled for altering the "english.php that places the counter on all pages.

The tpl doubled the size of the footer bar, like 2 bars, and the shading was not good, but will work well if standard colors.

Placing the code in the html area, meant losing my banner at the bottom of my pages, the code was there instead, works well, if you don't mind losing the banner, of course you can place banners in other areas also with the html coding

Thanks you have been a great help.
  #5  
Old 12-03-2008, 09:31 PM
malhyp malhyp is offline
Junior Member
 
Join Date: Feb 2006
Posts: 7
Default

Hi webado, thanks for the post, it worked perfectly for me.

Cheers n thanks.
  #6  
Old 12-04-2008, 12:48 AM
webado's Avatar
webado webado is offline
Moderator
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada
Posts: 27,708
Default

Swefil2005, you need to fix the surrounding code, the styling, to make it work.

If you use the invisible code you should have no problem.

It's really best to add the tracking code somewhere where it will get inserted right before the </body> tag, this way you can take advantage of the new features like tracking external links, downloads, Adsense clicks.
__________________
Christina
>>Forum Moderator<<

Please do not PM me for support. The forum is here for that.
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.