1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Best way to add google analytics code in a wordpress site.

Discussion in 'White Hat SEO' started by Pete.Blackangel, Jun 17, 2013.

  1. Pete.Blackangel

    Pete.Blackangel Newbie

    Joined:
    Mar 20, 2013
    Messages:
    12
    Likes Received:
    0
    I have been trying my level best to add analytics code and i was able to succeed after i used a plugin (All In One Webmaster) and i was able to check the details on real time basis.. it shows the no of visitors on the site but it doesn't reflect total number of visits under audience...
    can anyone out there help me... its important i have to do this by today EOD...
     
  2. adusin

    adusin Registered Member

    Joined:
    Oct 10, 2012
    Messages:
    62
    Likes Received:
    6
    Occupation:
    Graphic Designer
    Location:
    India
    Home Page:
    try to add the code after the end of </head> and the start of <body> tag in the header.php or u can fins that in index.php


    example

    </head>
    ;
    ;code here
    ;
    <body>
     
  3. scorpion king

    scorpion king Senior Member

    Joined:
    May 2, 2010
    Messages:
    1,157
    Likes Received:
    2,393
    Occupation:
    Entrepreneur
    Location:
    irc.blackhatworld.com
    You need to add analytics code just after header tag on your site.
    If you added your analytics now, then it will take some time to calculate total audience count. Atleast you should wait for 24hrs.
     
  4. BENNY8877

    BENNY8877 Supreme Member

    Joined:
    Jan 4, 2010
    Messages:
    1,277
    Likes Received:
    1,087
    Occupation:
    Wallet Inspector
    Location:
    In my mom's basement
    I use the Google Analyticator plugin. Works for me.
     
  5. Lazlo1967

    Lazlo1967 Junior Member

    Joined:
    Aug 15, 2012
    Messages:
    198
    Likes Received:
    54
    Yup Google Analyticator works great.
     
  6. hango

    hango Regular Member

    Joined:
    May 22, 2013
    Messages:
    375
    Likes Received:
    61
    Location:
    San Francisco
    Agreed, there are a lot of good Wordpress plugins out there. Analyicator is good. That is the one is use.
     
  7. Pete.Blackangel

    Pete.Blackangel Newbie

    Joined:
    Mar 20, 2013
    Messages:
    12
    Likes Received:
    0
    i used the Plugin day before yesterday... for yesterday it shows the data i dont know what happened today since morning its not pulling data for the site...
     
  8. scorpion king

    scorpion king Senior Member

    Joined:
    May 2, 2010
    Messages:
    1,157
    Likes Received:
    2,393
    Occupation:
    Entrepreneur
    Location:
    irc.blackhatworld.com
    Hearing this for the first time. You can better delete your analytics account and add it again. You can delete it by going to "My Analytics Account" in the drop down menu select "Analytics settings" and click "Edit Account". There you can find an option to deleteyour account.
    Hope it helps.
     
    • Thanks Thanks x 1
  9. Pete.Blackangel

    Pete.Blackangel Newbie

    Joined:
    Mar 20, 2013
    Messages:
    12
    Likes Received:
    0
    well dude i deleted the account...
    what should i do next... shall i wait for some time before adding it again... and whats the best way to do it with a plugin or direct paste... Any Recommendation
     
  10. echizen

    echizen Newbie

    Joined:
    May 26, 2012
    Messages:
    45
    Likes Received:
    13
    Home Page:
    paste your analytic code into your footer.php theme file, place it before the end of body tag </body>
     
  11. ZestMedia

    ZestMedia Regular Member

    Joined:
    Mar 29, 2013
    Messages:
    464
    Likes Received:
    28
    Occupation:
    SEO Specialists
    Placing the code directly in your theme file would be better, like between <head> and end of </body> tags.
     
  12. ID Internet Marketer

    ID Internet Marketer Senior Member

    Joined:
    Jan 22, 2013
    Messages:
    938
    Likes Received:
    1,442
    Occupation:
    Blackhatworld Member
    Location:
    My Private ***
    just use plugin for it, so simple.
     
  13. vrak05

    vrak05 Newbie

    Joined:
    Jun 11, 2013
    Messages:
    13
    Likes Received:
    1
    yes there are extensions for that
     
  14. Scripteen

    Scripteen Elite Member

    Joined:
    Sep 19, 2009
    Messages:
    1,811
    Likes Received:
    1,918
    Home Page:
    Putting it directly in the theme saves you one MySQL query per page load so just open theme editor in wordpress and look for footer.php file in the theme you are using and put analytics code right above </body> tag.
     
    • Thanks Thanks x 1
  15. SEOWhat

    SEOWhat Regular Member

    Joined:
    Feb 7, 2013
    Messages:
    245
    Likes Received:
    73
    Occupation:
    Web designer, We Developer, SEO
    Location:
    EU
    if you are using Windows, use Notepad and open this file wp-content/themes/your-theme-name/footer.php and place your GA code inbetween below two tags

    </body>
    YOUR CODE HERE
    </html>
     
    • Thanks Thanks x 1
  16. venins

    venins BANNED BANNED

    Joined:
    Aug 24, 2012
    Messages:
    141
    Likes Received:
    44
    add code to the footer page footer.php
     
  17. Pete.Blackangel

    Pete.Blackangel Newbie

    Joined:
    Mar 20, 2013
    Messages:
    12
    Likes Received:
    0
    code has to be placed between <head> code </body>tag or
    between </body> code </html> tag
     
  18. blackhatdamo

    blackhatdamo Registered Member

    Joined:
    Apr 6, 2012
    Messages:
    86
    Likes Received:
    27
    Location:
    A dark place
    I put mine in header.php and it works like a charm :) i used a plugin but had no success
     
  19. loudINMedia

    loudINMedia Junior Member

    Joined:
    Jun 10, 2013
    Messages:
    142
    Likes Received:
    14
    Location:
    London, UK
    putting in header will be a good option that will allow you to track all activities & get the results ready in real time.