Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    May 2011
    Posts
    20
    Plugin Contributions
    0

    Default Adding tracking script to main page

    I am using the latest version of Zen Cart.

    I want to add a hitsniffer tracking script on the main page.

    I am not sure where or how to do this as the info says place this (script) before end of the [/body] tag.

    Can anyone translate this for me into something simple I can understand ?

    Thanks in advance.

    Oh I am using darktemplate design .

  2. #2
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Adding tracking script to main page

    You will find the </body> tag in tpl_main_page.php:

    includes/templates/your_template/common/tpl_main_page.php

    Put it in there :-)

  3. #3
    Join Date
    May 2011
    Posts
    20
    Plugin Contributions
    0

    Default Re: Adding tracking script to main page

    Quote Originally Posted by niccol View Post
    You will find the </body> tag in tpl_main_page.php:

    includes/templates/your_template/common/tpl_main_page.php

    Put it in there :-)
    I went to that directory and the only two files in there were the

    tpl_footer/php & tpl_header.php ??

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,908
    Plugin Contributions
    96

    Default Re: Adding tracking script to main page

    Quote Originally Posted by 3d4me2 View Post
    I went to that directory and the only two files in there were the

    tpl_footer/php & tpl_header.php ??
    Copy tpl_main_page.php from /includes/templates/template_default/common and make your changes.

  5. #5
    Join Date
    May 2011
    Posts
    20
    Plugin Contributions
    0

    Default Re: Adding tracking script to main page

    Quote Originally Posted by lat9 View Post
    Copy tpl_main_page.php from /includes/templates/template_default/common and make your changes.
    I did that... main page is now all black - nothing on it.

    I deleted the file and site is back to normal. ?

    Here is the Url of my site if that helps

    http://majikimaje.com/Zhop/

  6. #6
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Adding tracking script to main page

    What lat9 says is correct.

    You need to make a override version of that file. ( Or it is better to anyway )

    To do that copy the file:

    includes/templates/template_default/common/tpl_main_page.php

    to

    includes/templates/your_template/common/tpl_main_page.php

    If this is causing the site to crash then you are doing something wrong. I know that sounds unhelpful but it is true, unfortunately. Or you are altering the file when you are copying it in some way.

  7. #7
    Join Date
    May 2011
    Posts
    20
    Plugin Contributions
    0

    Default Re: Adding tracking script to main page

    Quote Originally Posted by niccol View Post
    What lat9 says is correct.

    You need to make a override version of that file. ( Or it is better to anyway )

    To do that copy the file:

    includes/templates/template_default/common/tpl_main_page.php

    to

    includes/templates/your_template/common/tpl_main_page.php

    If this is causing the site to crash then you are doing something wrong. I know that sounds unhelpful but it is true, unfortunately. Or you are altering the file when you are copying it in some way.
    I will follow your instructions. I merely downloaded the file - made the changes and uploaded it. BUT I renamed the old file so that if I got into trouble I could delete the new file and make the old file name to its normal state.

    I will study how to make an over-ride system and I will get back to you when I have more info.

    Thanks for having the paitience to help me deal with this issue.

    I thought I could do this easily by using the define pages option for the main page; but I see that isn't the case.

  8. #8
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Adding tracking script to main page

    Well, you should be able to do that too. It is better to make an override because you don't mess up the original but editing the origianla should also work.

    Which kind of suggests that there is a problem with the code that you are adding. If there is a problem with that code then that will mess up the page too. Because tpl-main_page is one of the first files that actually loads if that file has an error in it you have big problems :-)

    I do not know hitsniffer so can't advise there but maybe someone else can.

    A lot of people use google analytics for that kind of thing. That does not provide live monitoring but slightly delayed data. But the advantage might be that there are a couple of GA add-on modules for Zen Cart.

    I think that the yahoo version of analytics does provide live data.

  9. #9
    Join Date
    May 2011
    Posts
    20
    Plugin Contributions
    0

    Default Re: Adding tracking script to main page

    Well I have determined I have major errors with my template.

    So therein lies the main problem.

    Right now my best bet is to install a different template; create the override system and then go from there.

    thanks for taking the time to respond. At least now thanks to all of your advice; I am heading in the right direction.

  10. #10
    Join Date
    May 2011
    Posts
    20
    Plugin Contributions
    0

    Default Re: Adding tracking script to main page

    this whole simple process required the pasting of the script in the main page under define main pages. It worked first time !! FLAWLESSLY.

    Thanks for all the expert help !!

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Getting Jave-Script to work on Main Page
    By brandonturpin in forum General Questions
    Replies: 1
    Last Post: 9 May 2010, 08:22 AM
  2. Tracking Script
    By jnellie in forum General Questions
    Replies: 2
    Last Post: 30 Dec 2008, 06:52 PM
  3. Adding a custom page & script
    By emilfalcon in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Oct 2007, 07:38 PM
  4. [HELP] making login script / logout on main page
    By buba in forum General Questions
    Replies: 1
    Last Post: 14 Jun 2007, 09:31 AM
  5. Script error on main page only
    By spydercanopus in forum General Questions
    Replies: 1
    Last Post: 5 Aug 2006, 10:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg