Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides


  1. Sally says:

    Very helpful, thanks!

  2. Beth says:

    Thank you! This was so helpful!

  3. Kate says:

    This was very helpful. Thank you!

  4. Gabrielle Tyler says:

    Thank you for the easy, quick and useful info!

  5. Sundar says:

    Useful info. Presented well.

  6. Amanda says:

    When I searched for your plugin, it said it was untested with the current version of WP. Not sure if you knew that because you are so big.

    Thanks for all this information.

  7. Barry Richardson says:

    Your Search box does not seem to be working – I tried in Firefox and Chrome!

  8. Michele says:

    Great and informative. However, I am not using Business but the premium version. I am still not able to add in the code as under setting, I dont see the install headers and footers option. How do I go about it?

  9. Meg says:


    the plugin instructions say “Paste the Google Analytics code in the plugin’s setting page.” Does this mean the plugin editor? I can’t work in where to drop the code in..

    Thanks in advance,


    • WPBeginner Support says:

      If you are using Insert Headers and Footers plugin, then simply go to Settings » Insert Headers and Footers in your WordPress admin area. There you will see two boxes. Paste your Google Analytics code in the first box and save your changes.

  10. Rob Stephens says:

    I’ve installed your Insert ‘Header and Footer’ plugin – I was just wondering if the analytics gets put on every page on my website or just the homepage?

  11. Kaugip says:

    Helpful as always!
    I do prefer plugins, but in this case I’m using google analytics on ocimpress – it’s built using WordPress but is not compatible with it’s plugins.

  12. Nirmal says:

    Thanks for your excellent article. I managed to add Google Analytics to my site following your article.

  13. Frank says:

    thanks for the clear and easy to follow steps provided on activating the code into my wordpress site it was just like A B C…….
    Keep it up i will continue subscribing to more of your products.

  14. Lebo says:

    wpbeginner has helped me configure my site to be one of the most high ranked website on google organic search results for my keywords

  15. Dora says:

    Thank you for this article! I wasn’t sure how to implement the code to my website, after reading your article it took me 5 minuets to download and set the plugin and now my new website is all set with Analytics!

  16. Safwan says:

    I pasted the code as suggested using the plugin mentioned in the article….

    I still cannot see any stats in the reporting tab.
    Please help

  17. Nicole says:

    Thank you for the instructions – hopefully I did everything properly!

  18. Paul says:

    Worked well and very easy to do with “Insert Headers and Footers” Plugin. I added ours to the footer and it worked straightaway when I checked in the real time feature of GA. Thanks for your post.

  19. Steven Taitinger says:

    I think free sites can use Google Analytics if they have purchased their own domain name. Google has a Domain name provider method of verifying you own your site.

  20. Candice says:

    Thank you so much… you guys make everything so easy!! you rock!! xx

  21. nasri says:

    Video was very helpful, thank you

  22. Thessauron says:

    Thanks! If only everyone can explain in the concise, clear way you do.

  23. McKenzie says:

    Wow, you’re a lifesaver!!!!

  24. Shruti says:

    I have pasted the google analytics code by insert header and footer plugin in header and footer. But how can I change it to before as my webpage is not crawling by search engines so for time being I have removed the code.

    Can you tell me some other way which can be work out to paste it before .
    My current theme doesn’t support in editor section. And I don’t know developer techniques.

  25. Wander Bite says:


    I have installed the Google Analytics by Yoast and it is not working! The first step in the plugin is to ‘authenticate with your google account’. When I click on that to copy and paste the code, it doesn’t seem to take it for me to continue! I have tried it many times and still nothing. Please help!

  26. Liz Packwood says:

    Hi, I’ve entered a Google Analytics authentication code into my Yoast SEO plugin. But can you please tell me how do I access my GA dashboard for my website. And once my site is authenticated, do I still need to insert the tracking code onto all my pages. If I am using the free Yoast SEO plugin, I thought it might handle all this for me but I see no evidence of this…Do i still need to activate the ‘ insert headers and footers’ plugin? Any advice? Thanks so much for your great helpful site

  27. sazia kazia says:

    First time I visited on this website. Its looking so helpful and found knowledgeable content. Great post and useful to all bloggers. On my hostgator hosting traffic shows different and in analytic its very less comparing to hostgator. i logged in in analytic with different google id it is showing different result for each id. I think need to set up analytic..Please have a look on my website and feed back how to improve it. I am using genesis work frame + pro theme..Thanks for sharing

    • WPBeginner Support says:

      It is possible and completely normal for different analytics solutions to show different statistics. There are a variety of reasons for that, you can find more information on the topic on analytics support forum.

  28. Jake says:

    great tutorial! two thumbs up

  29. vahid mohammadi says:

    thanks great article
    but can i use my Gmail to manage unlimited sites
    or its 1 gmail per site

  30. James says:

    Thank you for nice tutorial.

  31. mohammad koleiny says:

    i want to say thanks for your useful article!
    i use the method one and it’s work for me fine
    thanks again

  32. Jennifer Modisette says:

    Thank you for this article. I have installed my google analytics code in the plug-in you suggested. I did this about 12 hours ago. So far I can not see any activity on google analytics. Is this normal or have I not installed it correctly?

    • WPBeginner Support says:

      It is normal. You can visit the Real Time section under reporting and then visit your website from some other device. You will be able to see it detected in the real time results.

  33. Cephas says:

    Will try it out. Hope it works

  34. Jenny says:

    Thanks for the article, I’ve installed Google Analytics on my personal blog and now I can finally check my statistics. However it displays so many data that I’m not sure if I understand everything correctly – is there any way to simplify statistics reports? Maybe some stats displayed as infographic or so?

  35. Deelip says:


    Amazing article, learnt a lot from your blog. Thank you.
    I have a website and a wordpress blog, is it possible to link both so that i can see the same in one analytics account?


    • WPBeginner Support says:

      If they are on the same domain then you can use the same analytics code on both sites.

  36. Malin Johansson says:


    I´ve tried to seek information about plugins and Google analytics.
    If I understand correctly you must have ? Or is it enough to upgrade to premium to be able to use plugins?


  37. Sacha H says:

    This was a really helpful article. But, I think there is a flaw with your plugin. It includes no way to exclude admin traffic. So Google Analytics will still show internal traffic! Yoast’s Google Analytics plugins include a way to exclude internal traffic.

  38. Iris Dorreboom says:

    Thanks for the plug-in, really a great help for someone who doesn’t know her way around the code stuff. One question: is just pasting the code once in the header section enough to get all your pages and posts followed?
    By the way, I also follow your blog, and that’s very helpful, too! Thanks!

  39. mark p says:

    Hello, thanks for the write-up. Helpful indeed! I have the analytics code in and working, been so for about a month or two now. I just noticed however that my analytics code is showing up at bottom of my pages .. i have inserted in my header.php.

    I followed syntax rules I cant understand why it is showing itself .. any recommendation?

  40. Mark Assing says:

    Does it matter if the script is in both the header and the footer? And now that I’ve added Google Analytics to my website, where do I go to get the data? Do you have a tutorial about Analytics itself. Thanks for your help.

  41. Katie says:

    Video was very helpful, thank you!

  42. Amin says:

    Hi there,

    unfortunately I can’t install the above mentioned Plugin “install headers and footers” to my site. Error: The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

    Note: wpbeginners transfered my old site to the new!


    • WPBeginner Support says:

      This error may occur when you do not have enough disk space on your web server. Please contact your web host’s support for assistance.

  43. Jarret Ruminski says:

    Great article. Just one comment: you guys really fly through the videos. For those of us with no web/tech background, you should slow down the pace a bit so we can follow without constantly having to go back. Other than that, great job.

    • WPBeginner Support says:

      Thanks for the feedback, we are aware of it already trying to improve on that in newer videos. Please take a look at some our new videos in our YouTube Channel.

  44. Hengh Cheyyo says:

    Great Article..everything is clear. I have read all and I was able to install header and footer then I copy tracking code from google Analytics and then paste in myself… Save and then done

  45. Simon Engström says:


    I noticed in your video that you pasted the tracking code into the “Scripts in footer” area. This confuses me since Google’s instruction is to paste the tracking code “immediately before the closing tag” i.e, in the Header.

    Shouldn’t the tracking code be pasted into the “Scripts In Header” area then? Or perhaps it doesn’t make a difference?


    • Simon Engström says:

      Hm.. My quote from Google included a piece of html code, but it was apparently removed. I tried to write “immediately before the closing tag”.

    • WPBeginner Support says:

      You can paste it in either. However, pasting it in the header is often recommended.

  46. Kat says:

    Thanks for your help!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.