Adding Statcounter to zencart

Discussion in 'Help' started by swefil2005, Apr 27, 2008.

Thread Status:
Not open for further replies.
  1. swefil2005

    swefil2005 New Member

    Joined:
    Apr 27, 2008
    Messages:
    5
    Likes Received:
    0
    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. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,159
    Likes Received:
    1
    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:

    Add the following just before that line:

    Then modify the line after this that currently reads this way:


    to read this way:



    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:

    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.
     
  3. Blake81

    Blake81 New Member

    Joined:
    Dec 4, 2007
    Messages:
    35
    Likes Received:
    0
    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. swefil2005

    swefil2005 New Member

    Joined:
    Apr 27, 2008
    Messages:
    5
    Likes Received:
    0
    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. malhyp

    malhyp New Member

    Joined:
    Feb 24, 2006
    Messages:
    7
    Likes Received:
    0
    Hi webado, thanks for the post, it worked perfectly for me.

    Cheers n thanks.
     
  6. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,159
    Likes Received:
    1
    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.
     
Thread Status:
Not open for further replies.

Share This Page