Is it enough to place the GA tracking code in the index?

Discussion in 'Google Analytics' started by allinone1, Mar 5, 2010.

  1. #1
    I would like to know if it is enough to place the GA tracking code in the index file or I have to put it in all the pages? How accurate is it if I put it just in the index?
     
    allinone1, Mar 5, 2010 IP
  2. HarryJackson

    HarryJackson Peon

    Messages:
    181
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I used to include it before end of of body code on index page footer, its automatically includes in all other pages.
     
    HarryJackson, Mar 5, 2010 IP
  3. allinone1

    allinone1 Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for your answer, I know what you are talking about, but I don't have a page footer that includes automatically in all pages. :(
     
    allinone1, Mar 5, 2010 IP
  4. HarryJackson

    HarryJackson Peon

    Messages:
    181
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I read on Google help "Database driven sites - Insert the tracking code on your index.php page or equivalent (eg. default.php, index.cfm)." may this help you.
     
    HarryJackson, Mar 5, 2010 IP
  5. allinone1

    allinone1 Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The index is "index.html". Thank you for doing the search!
     
    allinone1, Mar 5, 2010 IP
  6. tata_capl

    tata_capl Peon

    Messages:
    461
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You need to paste code in all the pages.
     
    tata_capl, Mar 5, 2010 IP
  7. allinone1

    allinone1 Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks! I will try to do that.
     
    allinone1, Mar 9, 2010 IP
  8. Grafton7

    Grafton7 Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #8
    If your site is PHP enabled you may want to consider creating a PHP include for the footer. It is going to be just as much work to go into every page and past the code why not do an include once then you can update effortlessly in the future. Also with PHP you can do cool things like have the copyright echo the current year. For example at the bottom of each page you say Copyright - mysite.com 2010 In this could setup PHP to simply insert the current year where 2010 is so you don't have to update that each year. Good luck!
     
    Grafton7, Mar 9, 2010 IP
  9. plethera25

    plethera25 Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    If you only post the code within your index page, you will only be able to track people that visit that page only. If you had other pages (ie contactus.php), you wouldn't have record they visited that page.
     
    plethera25, Mar 9, 2010 IP
  10. Michael-DK

    Michael-DK Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    the code needs to be on every page. How it gets there is another question. I use SSI (Server Side Include). It sounds a little like a PHP script inserting the code at the end of the file, just before </body>
    the line in my .shtml files look like this <!--#include virtual="/analytics-domain.inc"--> and this .inc file contains the code. Your webhost must support Server Side Include !
     
    Michael-DK, Mar 17, 2010 IP