Where in HTML to add the analyics code

Discussion in 'Google Analytics' started by dinrock, Nov 16, 2010.

  1. #1
    After rebuilding my index page, I relaunched & realized I lost my analytics tracking. My code starts with letters UA- etc. Do I put that in between the <head></head> part? Or exactly where? Need help. I am not a big analytics aficionado but used it to see # of visitos and see what states. Help needed.
     
    dinrock, Nov 16, 2010 IP
  2. chainas

    chainas Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your analytics code must go between <head> and </head> tags

    it means:

    <head>
    YOUR ANALYTICS CODE
    </head>
     
    chainas, Nov 16, 2010 IP
  3. dinrock

    dinrock Well-Known Member

    Messages:
    1,150
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Is it OK to post our code on this forum (so I can ask a further question?)
     
    dinrock, Nov 16, 2010 IP
  4. chainas

    chainas Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's not good idea, because somebody can distort Your analytics reports...
     
    chainas, Nov 16, 2010 IP
  5. dinrock

    dinrock Well-Known Member

    Messages:
    1,150
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    128
    #5
    very understandable chainas. Thank you. The actual line of code ....where do I get it again, for the account? Is there are part of the page I click to copy it? Thanks again
     
    dinrock, Nov 16, 2010 IP
  6. chainas

    chainas Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You should go on Your google analytics homepage, then choose Your account (in Name tab), then click "Edit" (in right side), then click "Check status" (in right top) and now You will get Your google analytics code. Hope it helps :)
     
    chainas, Nov 17, 2010 IP
  7. epicninja

    epicninja Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I have found putting my Google Analytics code in the footer of my page is most effective simply because it allows the important things like content, images, etc to load first on my site. Tracking is the same either way.
     
    epicninja, Nov 18, 2010 IP
  8. Atco_Maart

    Atco_Maart Peon

    Messages:
    338
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <head>
    gogle analytics code
    </head>
     
    Atco_Maart, Nov 18, 2010 IP
  9. bloggertemplatesblog

    bloggertemplatesblog Peon

    Messages:
    85
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You should add the HTML code at the end of each page, right before the </body> tag. Reason; only those visitors will be counted who have completed loading your page. This would give more accurate results.

    If you prefer you can add the code, between head tags as well...
     
    bloggertemplatesblog, Nov 19, 2010 IP
  10. teamaguilar

    teamaguilar Peon

    Messages:
    197
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Can we not keep the analytics code at both head and after body tag?will this be a good idea?
     
    teamaguilar, Nov 19, 2010 IP
  11. dinrock

    dinrock Well-Known Member

    Messages:
    1,150
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    128
    #11
    I sincerely appreciated all your help. I kept searching big G and found the ultimate info / instructions. How to find your tracking code and reinsert it into your page instructions! OH, and important where you place it....look at your code and try to find that "ga.js" snippet....if it's in there, add it JUST BEFORE your </head> tag!
     
    dinrock, Nov 19, 2010 IP
  12. workpress

    workpress Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I always added Google Analytics code in the footer before the tag </body>
     
    workpress, Nov 21, 2010 IP
  13. mahesh2010

    mahesh2010 Guest

    Messages:
    133
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hi,
    Nice post Iwas looking for this to add in my html site thanks keep it up
     
    mahesh2010, Nov 21, 2010 IP
  14. magupta26@gmail.com

    magupta26@gmail.com Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    you can add any where between <body></body>.
     
    magupta26@gmail.com, Nov 24, 2010 IP
  15. rlerza

    rlerza Peon

    Messages:
    137
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I put my code between <meta name=...> tags in the header, that is in wordpress though
     
    rlerza, Nov 24, 2010 IP
  16. akashseo

    akashseo Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    You can add the Google Analytics Tracking code in your website root page. Just copy & paste the analytics tracking code in your website's root code before </body> tag & save the settings. After few minutes your analytics account will get activated.
     
    akashseo, Nov 24, 2010 IP
  17. brijeshtiwari1984

    brijeshtiwari1984 Member

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #17
    You can add Google analytic track code in you site root directory at master page .At where you place your code above body tag has been closed and update it ..this code will show all page of your website.. at analytic click at save and finish code has been update
     
    brijeshtiwari1984, Nov 24, 2010 IP
  18. rahulbatra

    rahulbatra Peon

    Messages:
    174
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Analytics code is pasted above the /head and if you lost your code you can have it again from their.
     
    rahulbatra, Nov 24, 2010 IP
  19. animebuzz.tv

    animebuzz.tv Peon

    Messages:
    317
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #19
    for performance based, add the analytic code at the lower part of your page before </body>
     
    animebuzz.tv, Dec 15, 2010 IP
  20. sherone

    sherone Well-Known Member

    Messages:
    1,539
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    130
    #20
    I prfer anayltics place in the footer.

    before this tag.

    </body>
    </html>

    If you use analytics in the header, it may take some more time to download scripts and your site.
     
    sherone, Dec 16, 2010 IP