How do i put analytics on my php websites?

Discussion in 'Google Analytics' started by eduoku, May 13, 2010.

  1. #1
    Hi, i just launched an ipad video site at www.ipadvideoseries.com
    For reasons i don't know, awstats woun't report any stats, so i decided to use google analytics.
    After adding the codes to my site as instructed, images on the site will not show until i took the codes off.
    The instruction was to paste the code just after the opening <body> tag, and how i understand that is immediately below the tag.
    Anyway i have taken the code off and the site is okay now, but i know the importance of google analytics, and would really like to use it for this site.
    Can someone offer help pease, thanks
     
    eduoku, May 13, 2010 IP
  2. Hotter_DV

    Hotter_DV Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As per my exp. in GA we paste the tracking code before closing of the body tag like </body> because it will track your page when whole webpage open on the browser. If attaching template within your page then add tracking code within template before closing body tag.
     
    Hotter_DV, May 14, 2010 IP
  3. eduoku

    eduoku Peon

    Messages:
    530
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the suggestion, i will try that.
     
    eduoku, May 14, 2010 IP
  4. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well, I checked your website.

    And you have put Google ads in your site right?

    Keep the analytics code in the same way you kept the ads.. it will work..

    Yes, It will simply Work.
     
    extremephp, May 14, 2010 IP
  5. magic99

    magic99 Peon

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I check your website and there is not present Google Analytics code so please insert them then it will work
     
    magic99, Jun 2, 2010 IP
  6. aeroz1

    aeroz1 Active Member

    Messages:
    492
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Awesome, just downloaded and setup on the server and it looks ok so far. Waiting for google analytics to update.
     
    aeroz1, Jun 2, 2010 IP
  7. denverice

    denverice Peon

    Messages:
    539
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    you just use analytics code in index file or just use it in footer part so it will attached on each and every page
     
    denverice, Jun 2, 2010 IP
  8. whitespparow

    whitespparow Peon

    Messages:
    464
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Create account in Google Analytics and you will get one tracking code. Copy paste that tracking code in your site before </body> tags. After that it will take 24 hours to display all the data.
     
    whitespparow, Jun 2, 2010 IP
  9. it-aroma

    it-aroma Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    yes get trakicng code from ur a/c and put before end of </body> tag.
     
    it-aroma, Jun 2, 2010 IP
  10. bridge476

    bridge476 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I am using smarty template system. on which file would be best to put analytics code? maybe footer because it is called every time?
     
    bridge476, Jun 7, 2010 IP
  11. neiljhonson

    neiljhonson Peon

    Messages:
    315
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    All dynamic websites includes footer file to manage footer. You can include google analytics code before closing the body tag</body> in footer file. This will update tracking code at complete website.
     
    neiljhonson, Jun 9, 2010 IP
  12. nemo14

    nemo14 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Use WASP from iPerception to check whether ur code is working properly or not. Also, the new code Google is providing should be put just opening body tag, not the closed body tag. Check whether ur present code & any other javascript is conflicting or not
     
    nemo14, Jun 9, 2010 IP
  13. eduoku

    eduoku Peon

    Messages:
    530
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hi, thanks for your contribution. the footer file you talk about is not there in my site. i have checked all the files that came with the site, but it is not there. what else do i do?
     
    eduoku, Jun 10, 2010 IP
  14. andrew jhon

    andrew jhon Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Hi There,
    I don't know about the authenticity of the source from where you have read the instructions for setting up GA codes. Everywhere it has been described that always put the codes at the end, i.e.just before closing body tag</body>. The reason behind putting the code at the end of the page is it confirms the complete loading of the page and actual visit of the web page.

    Try to use your GA code again.
     
    andrew jhon, Jun 15, 2010 IP
  15. jb1567us

    jb1567us Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #15
    stick the code in right after the body tag in your header file.
     
    jb1567us, Jun 30, 2010 IP
  16. seoshel

    seoshel Peon

    Messages:
    366
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    paste your GA code before </body> tag or paste in footer so you can track each and every page of your website
     
    seoshel, Jul 1, 2010 IP
  17. alexnikle

    alexnikle Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    paste GA code in footer is a better choise. And you should wait some time for Google get your site infors
     
    alexnikle, Jul 5, 2010 IP
  18. jb1567us

    jb1567us Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #18
    stupid questiopn, but why is it better in the footer than after the <body> tag in the header?
     
    jb1567us, Jul 5, 2010 IP
  19. jamiesbeck

    jamiesbeck Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    i put mind in the footer too since its last. so it loads proper first. google still finds it (takes them an hour or so for analystics to start to read no matter where you put it).
     
    jamiesbeck, Jul 6, 2010 IP
  20. Alexandros1

    Alexandros1 Peon

    Messages:
    332
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Analytics .. it's the urchin code if I recall it well.

    Go to the ...yoursite/templates/yourtheme/overall_footer.tpl and put the code in the end of the page. That will make it appear in all pages and it's gonna work
     
    Alexandros1, Jul 26, 2010 IP