WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Beginners Guide» How to Install Google Analytics in WordPress for Beginners

How to Install Google Analytics in WordPress for Beginners

Last updated on July 7th, 2020 by Editorial Staff
3.4k Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Install Google Analytics in WordPress for Beginners

Do you want to install Google Analytics in WordPress? Knowing how your audience interacts with your website is crucial for your success.

The best way to know your audience is through your traffic stats, and this is what Google Analytics provides for FREE.

In this article, we will share why Google Analytics is important, and how you can easily install Google Analytics in your WordPress website (step by step).

How to Install Google Analytics in WordPress

First, we will explain why Google Analytics is important and how it can help you grow your website.

After that, we will show you how to sign up for a Google Analytics account and different methods to install it on your WordPress site.

Finally, we will explain how to view your traffic reports in Google Analytics.

Here is a quick overview of what you’ll learn in this article.

  • Why is Google Analytics Important
  • How to Sign up with Google Analytics
  • How to Install Google Analytics Using MonsterInsights (Recommended)
  • How to Install Google Analytics Using Insert Headers & Footers Plugin
  • How to Install Google Analytics in WordPress Theme (Advanced)
  • Viewing Reports in Google Analytics
  • Making the Most out of Google Analytics
    • Ready let’s get started.

      Video Tutorial

      Subscribe to WPBeginner

      If you don’t want to watch the video tutorial, then you can continue reading the text version below:

      Why is Google Analytics Important for Bloggers?

      Once you start a blog, your #1 goal is to get more traffic and subscribers. Google Analytics help you make data-driven decisions by showing you the stats that matter. You can see:

      Who visits your website?

      This part of analytics answers what is the geographical location of your audience, which browser did the user use to visit your site and other important information such as screen resolution, JavaScript support, Flash support, language and more.

      This data is extremely useful, and it can help in numerous ways. When getting a custom design, you can use the user data to make sure that your site will be compatible with your audience.

      If most of your users don’t have Flash support, then you should avoid adding the flash element in your site. If most of your users are on 1280 screen resolutions, then make sure that your design is compatible with that resolution or smaller.

      What do people do when they are on your website?

      You can track where the users are going on your website, how long do they stay on your website, and what is the bounce rate (the percent of users exit your site on the first visit).

      By using this information, you can decrease the bounce rate and increase your pageviews.

      You can also find your most popular articles, articles that are not doing so well, and what kind of content your users are looking for.

      When do people visit your website?

      By looking at the hottest hours in the day for your site, you can pick the time when you publish your post. If that time zone is not compatible with yours, then you can schedule your post to meet that hour.

      How do people find your website?

      This section of the analytics shows you where did the users come from (for example: Search Engines, Direct Links, Referral links from another site).

      It also shows you what percentage of your visitors came from each of these sources. Google analytics gives you the breakdown of each of these categories. If it is the search engine category, then it shows you which search engine got you the most traffic, Google, Yahoo, Bing etc.

      The breakdown of referral sources shows you which sites you need to work with the most. If your top referral source is Facebook, then you need to have exclusive Facebook content to make your Facebook audience feel special.

      If your top referral source is an external website, then you might want to consider having a partnership with that website (guest post exchange or something else).

      How do people interact with your content?

      Google analytics shows how your users interact with your site’s content. It shows you what percent of the user clicked on which link on your site and much more.

      You can run A/B split tests by creating content experiments in Google Analytics to understand what works best to meet your goals.

      By seeing the user interactivity, you can work your content around your users. By seeing the answers to the questions above, you can focus on the strategies that work for your site and avoid strategies that don’t work.

      Simply put, eliminate the guesswork and focus on stats that matter, so you can make data driven-decisions.

      How to Signup with Google Analytics

      Google Analytics is available for free and all you need is a Google or Gmail account to sign up. The sign up process is quite simple, follow the step by step instructions below to create your Google Analytics account.

      Step 1: First you need to visit Google Analytics sign up.

      You will be asked to login with your Google account. If you already have a Google or Gmail account, then you can use that to sign-in. Otherwise, you can go ahead and create a Google account for yourself.

      Sign in with your Google account

      Step 2: Once you sign-in with your Gmail account, you will be prompted to a screen like the one below. This is where you will signup for Google analytics with your Gmail account.

      Sign up for Google Analytics

      After that, you will be asked to provide an account name. This name will be used internally so you can use anything like your business name.

      Enter account name

      Step 3: On the next screen, you will be given choice to choose between a web, apps, or apps and web. Make sure you select ‘Web’.

      Select web

      After that, you need to enter website name, website’s URL, country, and time zone.

      Provide website details

      Once you have entered this information, click on the Next button. You will be presented with Google Analytics terms and service which you must agree to, so click on ‘I Agree’ button.

      Step 4: Now you will be presented with your Google Analytics tracking code. You can copy this tracking code because you will need to enter it in your WordPress site depending on the method you use below.

      You cann also simply leave this browser tab open and switch back to copy the code when needed.

      Google Analytics tracking code

      We suggest leaving the analytics browser tab open as you may need to revisit it, once you have installed the code on your WordPress site.

      Now that you have setup a Google Analytics account, let’s take a look at how to install Google Analytics in WordPress.

      How to Install Google Analytics in WordPress

      There are a few different ways to setup Google Analytics in WordPress. We will show you three methods where the first option is the easiest and the last being the hardest.

      You can choose the one that best suits your needs.

      Note: You need to use only one of these methods on your website to avoid double tracking of page views in your Google Analytics account.

      Method 1. Google Analytics for WordPress by MonsterInsights

      MonsterInsights is the most popular Google Analytics plugin for WordPress. Over 1 million websites use it including the likes of Bloomberg, PlayStation, Zillow, and more.

      It is the easiest and by far the best way to add Google Analytics to WordPress (for all users beginners and experts alike).

      MonsterInsights is available as both, a paid premium plugin, and a free version. In this tutorial, we will be using the MonsterInsights free version.

      You can use the MonsterInsights Pro version if you want more advanced features like E-commerce tracking, Ads tracking, Author tracking, etc. The process of setting them up is the same.

      Let’s get started.

      The first thing you need to do is install and activate the MonsterInsights plugin. For more details, see our step by step guide on how to install a WordPress plugin.

      Upon activation, the plugin will add a new menu item labeled ‘Insights’ to your WordPress admin menu. Clicking on it will bring the MonsterInsights setup wizard.

      MonsterInsights setup wizard

      First, you will be asked to choose a category for your website (a business website, blog, or online store). Select one and then click on ‘Save and Continue’ button.

      Next, you need to click on the ‘Connect MonsterInsights’ button.

      Connect MonsterInsights

      This will bring up a popup that will take you Google accounts where you will be asked to sign in or select a Google account if you are already signed in.

      Sign in or select a Google account to continue

      Next, you will be asked to allow MonsterInsights to access your Google Analytics account.

      Allow MonsterInsights to access your Google Analytics account

      Click on the ‘Allow’ button to continue.

      The final step is to select the profile you want to track. You need to select your website here and then click on the ‘Complete Connection’ button to continue.

      Select your website profile to compete setup

      MonsterInsights will now install Google Analytics on your website. After that, you will be asked to select the recommended settings for your website.

      Recommended settings for Google Analytics

      The default settings would work for most websites. If you use an affiliate link plugin, then you need to add the path you use to cloak affiliate links. This will allow you to track your affiliate links in Google Analytics.

      Click on the Save and Continue button to save your settings.

      Next, MonsterInsights will show you paid add-ons that you can access if you upgrade to PRO. You can simply click on the ‘Save and Continue’ button to skip this step.

      Upgrade to pro

      After that, you will be asked to install WPForms plugin, which is the best WordPress contact form plugin. You can install it or simply click on ‘Skip this Step’

      Recommended plugin

      That’s all you have successfully installed and setup Google Analytics on your WordPress site. Remember, it will take Google Analytics sometime before showing your stats.

      Google Analytics successfully installed using MonsterInsights

      The best part about MonsterInsights is that you can view your Google Analytics reports inside your WordPress dashboard. Simply visit Insights » Reports page to check out a quick overview of your analytics data.

      Your Google Analytics reports in WordPress dashboard

      Note: MonsterInsights was formerly known as Google Analytics for WordPress by Yoast. WPBeginner’s founder, Syed Balkhi, acquired the plugin in 2016 and rebranded it to MonsterInsights. Now it is part of our family of premium WordPress plugins.

      Method 2. Insert Headers and Footers Plugin

      This method is not as good as MonsterInsights because you will not be able to do advanced tracking configuration, and you will not be able to view Google Analytics data in your WordPress dashboard.

      First, you will need to copy your Google Analytics tracking code that you copied earlier in Step 4 when signing up for Google Analytics account.

      Google Analytics tracking code

      Next, you need to install and activate the Insert Headers and Footers plugin. For more details, see our step by step guide on how to install a WordPress plugin.

      Upon activation, you need to visit Settings » Insert Headers and Footers page. Here you need to paste the Google Analytics tracking code that you copied earlier into the ‘Scripts in headers’ section.

      Adding Google Analytics tracking code using Insert Headers and Footers plugin

      Don’t forget to click on the save changes button to store your settings.

      That’s all, you have successfully installed Google Analytics on your site.

      3. Install Google Analytics in WordPress Theme

      This method is for advanced users who are familiar with the code. It is somewhat unreliable because your code will disappear if you switch or update the theme. We almost never recommend using this method.

      If this is your first time adding code to your WordPress files, then you should check out our guide on how to copy paste code snippets in WordPress.

      First, you will need to copy your Google Analytics tracking code that you copied earlier in Step 4 when signing up for Google Analytics account.

      Google Analytics tracking code

      Now there are two common ways to add this code in your WordPress theme files. You can choose either one of them (not both).

      1. Add code in header.php file

      Simply edit the header.php file in your WordPress theme and paste the Google Analytics tracking that code you copied earlier right after the <body> tag.

      Don’t forget to save your changes and upload the file back to your server.

      Add via Functions File

      You can also add Google Analytics tracking code to WordPress functions file. It will then automatically add the tracking code to every page on your WordPress site.

      You will need to add this code to your theme’s functions.php file.

      <?php
      add_action('wp_head', 'wpb_add_googleanalytics');
      function wpb_add_googleanalytics() { ?>
      
      // Paste your Google Analytics tracking code from Step 4 here
      
      <?php } ?>
      

      Viewing Reports on Google Analytics Website

      Google Analytics is capable of showing you a treasure of data collected from your stats. You can view this data by visiting your Google Analytics dashboard.

      Google Analytics reporting

      You will see the built-in Google Analytics reports in the left column. Each section is divided into different tabs and clicking on a tab will expand it to show more options.

      • Real-time This report will show you a real time view of your traffic.
      • Audience tab will show reports to help you understand your users.
      • Acquisition reports explore where your users came from.
      • Behavior reports summarize what your users do after they arrive on your site.
      • Conversion reports show how well you’re doing against your goals.

      Making the Most out of Google Analytics

      Google Analytics is an incredibly powerful tool with tons of awesome features. Some of them are quite obvious and easy to use, others require some additional setup.

      Here are some of the resources that will help you make the most out of Google Analytics reports.

      • Track user engagement in WordPress with Google Analytics
      • Track WooCommerce customers in Google Analytics
      • Track outbound links in WordPress

      Google Analytics works best with Google Search Console (formerly Google Webmaster Tools). It allows you to see how your website is doing in search results. See our complete Google Search Console guide to learn how to use it to grow your website.

      We hope this article helped you learn how to install Google Analytics in WordPress. You may also want to see our ultimate WordPress SEO guide for beginners.

      If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

3.4k Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

797 Comments

Leave a Reply
  1. rehman says:
    Nov 29, 2011 at 11:33 pm

    I am new to google analytics. Today I got the code and just wanted to paste in correct place. I was wondering whether to keep in end of head section or body section. because as per google analytics instruction it was mentioned to keep in the end of head section. I am now able to successfully install google analytics. Thanks for your help.

    Reply
  2. michaelcselva says:
    Oct 17, 2011 at 12:28 pm

    Seems like the easiest way is to insert the script into the footer. Just did that, now I’ll wait 12-24 hours. Hope it works!

    Reply
  3. NonFictionAddict says:
    Oct 11, 2011 at 7:46 pm

    Can you set this up if WordPress hosts your blog? Do you have specific directions for that scenario?

    Reply
  4. green-van says:
    Sep 24, 2011 at 11:58 am

    I Am having a problem with Google Analytics, the first time i installed it i was getting correct updates, then i changed my address from http://www.green-van.com/test

    to http://www.green-van.com and made a new step 6. but since then the same statistics, 3 visits and never any new ones. i am using google analitycs wp plug in now, and in my footer.php i have this

    Cufon.now();

    i don’t know if that is interfering with anything.

    maybe i should not use the wp-plugin and do the code directly inside the footer?

    can i send the footer.php or the functions.php to see if things are in the correct order?

    kind regards,

    Giannis

    Reply
  5. ardegas says:
    Aug 19, 2011 at 1:01 pm

    @wpbeginner That did the trick. It works now. Thank you.

    Reply
  6. wpbeginner says:
    Aug 19, 2011 at 11:22 am

    @ardegas Try removing the line space in line 2.

    Reply
  7. ardegas says:
    Aug 19, 2011 at 10:44 am

    Ok. Here is the code: http://pastebin.com/Ht1LSCr6

    Remember it’s a child theme file.

    Reply
  8. wpbeginner says:
    Aug 19, 2011 at 12:44 am

    @ardegas The code above works perfectly fine because all it is doing is adding an action in wp_footer to add google analytics…. the only reason why it would not work is if you paste the code in a manner which is not semantically right. Shoot over an email with your functions.php file code using pastebin or similar service… will evaluate and let you know what is wrong.

    Reply
  9. ardegas says:
    Aug 19, 2011 at 12:02 am

    @wpbeginner I’m using a child theme, and functions.php is almost blank. The only function I have now is an empty function: <code><?php function twentyten_posted_on() { } ?></code>. I use this function to remove some metadata from my theme. Without the php tags this function won’t work. So it looks I’m using the right semantics. I’m pulling my hairs right now.

    Reply
  10. wpbeginner says:
    Aug 18, 2011 at 9:37 pm

    @ardegas You need to make sure that you are using the write semantics… For example you probably do not need the first <?php code because often functions.php files are already in php… So make sure that you are not opening the php tag if it is already open or closing it when it should be opened….

    Reply
  11. ardegas says:
    Aug 18, 2011 at 9:34 pm

    I tried to insert the Analytics code using functions.php, but it gave me this error:

    <i>Warning: Cannot modify header information – headers already sent…</i>. I couldn’t even log in after. I ended removing this offending code from the file manager. It was bad. It’s a pity, because this snippet of code looks beautiful. I tried to remove any offending white space, but it was of no use, and now I’m afraid to even touch the functions.php file again.

    Reply
  12. lindsayihart says:
    Aug 15, 2011 at 11:45 am

    The dashboard will not save the snippet. I have tried placing it just about </body> and also above the wp_footer tag (the note says you shouldn’tt seperate this from the close body tag) Still NOT saving the code.

    Reply
  13. wpbeginner says:
    Aug 7, 2011 at 4:38 pm

    @martinfarr1 The footer.php is located in your theme’s folder which can be found /wp-content/themes/your-theme-name/

    If you really don’t have a clue, then try one of the Google Analytics plugin for WordPress.

    Reply
  14. martinfarr1 says:
    Aug 7, 2011 at 4:10 pm

    where do i find footer.php? Have been trying to do this for days but am a total beginner I’m afraid!

    Reply
  15. wpbeginner says:
    Jun 24, 2011 at 12:44 am

    @BrianBraker That is because you pasted the other PHP codes without opening the php tag.<?php add_action(‘wp_footer’, ‘add_googleanalytics’); function add_googleanalytics() { ?> <script type=”text/javascript”> var _gaq = _gaq || []; _gaq.push([‘_setAccount’, ‘UA-24076071-1’]); _gaq.push([‘_trackPageview’]); (function() { var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true; ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’; var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s); })(); </script> <?php }

    //Here you can paste all the other codes

    ?>

    Reply
  16. BrianBraker says:
    Jun 23, 2011 at 7:17 pm

    Did not work. Completely screwed up the function.php file so site did not load. Uploaded back up file.There is a bunch of other code in function.php file

    Here it is:

    <?php add_action(‘wp_footer’, ‘add_googleanalytics’); function add_googleanalytics() { ?> <script type=”text/javascript”> var _gaq = _gaq || []; _gaq.push([‘_setAccount’, ‘UA-24076071-1’]); _gaq.push([‘_trackPageview’]); (function() { var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true; ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’; var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s); })(); </script> require_once(TEMPLATEPATH . ‘/epanel/custom_functions.php’); require_once(TEMPLATEPATH . ‘/includes/functions/comments.php’); require_once(TEMPLATEPATH . ‘/includes/functions/sidebars.php’); load_theme_textdomain(‘StudioBlue’,get_template_directory().’/lang’); require_once(TEMPLATEPATH . ‘/epanel/options_studioblue.php’); require_once(TEMPLATEPATH . ‘/epanel/core_functions.php’); require_once(TEMPLATEPATH . ‘/epanel/post_thumbnails_studioblue.php’); $wp_ver = substr($GLOBALS[‘wp_version’],0,3); if ($wp_ver >= 2.8) include(TEMPLATEPATH . ‘/includes/widgets.php’); global $shortname; if (get_option($shortname.’_enable_dropdowns’) <> ‘false’) { update_option($shortname.’_enable_dropdowns’,’false’); }; ?>

    Reply
  17. wpbeginner says:
    Jun 16, 2011 at 6:38 am

    @luxdesign28 Yes, Google Analyticator plugin does the job.http://wordpress.org/extend/plugins/google-analyticator/

    Reply
  18. luxdesign28 says:
    Jun 15, 2011 at 11:28 pm

    Hi there,

    Is a method or a plugin how to show the data delivered by Google Anlalytic directly on wordpress, without going to Google Analytics webpage ?

    Reply
  19. Tarun says:
    Apr 30, 2011 at 4:50 am

    How to install the same in a subdomain take for example i have a website http://www.xyz.com and i want to track my subdomain http://www.123.xyz.com what should be done in-order to do so ?

    Reply
    • Editorial Staff says:
      May 3, 2011 at 6:32 pm

      Add a separate tracker.

      Reply
  20. Avenir says:
    Apr 28, 2011 at 5:56 am

    It Allows usage of custom variables in Google Analytics to track meta data on pages. Thanks for your support will try soon.

    Reply
  21. Karl Anthony Borg says:
    Apr 21, 2011 at 7:27 am

    Was trying to figure out how to install Analytics on WordPress but didn’t manage on my own.

    Thanks to your info – I now managed and GA is up and running.

    Reply
  22. Nicholas Massey says:
    Apr 19, 2011 at 11:33 am

    Just what i was after. I just placed it in the footer. Seems like the easiest option to me. :)

    Reply
  23. Sven cooke says:
    Apr 19, 2011 at 8:00 am

    Thanks for the information. This is good advice for the beginner and seasoned blogger.

    Many thanks

    Reply
  24. wanie says:
    Apr 6, 2011 at 9:52 pm

    hello,

    I am using the free wordpress version. Where do I find this part – “theme’s footer.php right above the tag”, so that I can simply copy and paste?

    Thank you!

    Reply
    • Editorial Staff says:
      Apr 7, 2011 at 8:10 am

      You can’t add this in your WordPress.com account. That is why they offer you with their own statistics.

      Reply
  25. Fask says:
    Mar 25, 2011 at 3:37 pm

    You can use the same code for the meta robots? in this way:

    add_action(‘wp_head’, ‘insert_meta_robots’);
    function insert_meta_robots() {
    ?>

    <?php
    }

    Reply
  26. kevin says:
    Mar 22, 2011 at 3:16 pm

    Analytics doesn’t work past the first page of my WP blog unless I add the code in my footer AND the sidebar.

    Reply
  27. Tayler says:
    Mar 20, 2011 at 3:12 am

    This is somewhat of a disaster! I added the code and now I can’t access my blog, it’s completely whited out

    Parse error: syntax error, unexpected $end in /home3/sulukuc1/public_html/wp-content/themes/constructor/functions.php on line 344

    I saw this error message after I pasted the code in my funtions.php:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home3/sulukuc1/public_html/wp-content/themes/constructor/functions.php:21) in /home3/sulukuc1/public_html/wp-content/themes/constructor/libs/Constructor/Admin.php on line 31

    Warning: Cannot modify header information – headers already sent by (output started at /home3/sulukuc1/public_html/wp-content/themes/constructor/functions.php:21) in /home3/sulukuc1/public_html/wp-admin/theme-editor.php on line 89

    Please help!!!!!!!

    Reply
    • Editorial Staff says:
      Mar 22, 2011 at 7:45 am

      You need to make sure that the code is semantically right … meaning that opening PHP tag may or may not need to be there if the PHP is already open.

      Reply
  28. Wes Hopper says:
    Mar 12, 2011 at 11:40 am

    I’ve read in the Thesis forums that the new GA code is asynchronous and needs to go in the header to work properly. It also doesn’t affect page load like the old code.

    Reply
  29. WIP says:
    Mar 11, 2011 at 4:12 am

    Hello again, sorry my bad. I fixed it! :)

    Reply
  30. WIP says:
    Mar 11, 2011 at 4:01 am

    Hello,

    When I put the Google Analtyics code in the footer.php and in the functions.php my whole blog dissapeared! Total white-out! What happened? What can I do to get it back?

    Reply
  31. Angela says:
    Mar 7, 2011 at 10:53 pm

    so if I use a free wordpress blog I can NOT use this plug-in?

    Reply
    • Editorial Staff says:
      Mar 8, 2011 at 6:22 am

      Thats correct. If you are on free WordPress.com then you don’t get this. You however get to use WordPress.com Stats.

      Reply
  32. Dan says:
    Feb 23, 2011 at 7:00 am

    Thanks for this, I’d just pasted it into the head.
    A function is so much neater though!

    Dan

    Reply
  33. m says:
    Feb 10, 2011 at 9:56 am

    Hello,
    Almost, but not quite there, I would like the first option of copy and pasting the code- but, I cannot find the “theme’s footer.php right above the tag” – not in tools, settings, themes, general, etc etc. Sorry to ask its probably simple! I added it to the normal ‘text’ widget works for all else but this.

    Reply
    • Editorial Staff says:
      Feb 12, 2011 at 8:23 am

      That is because you are using WordPress.com <<

      Reply
  34. Lewis Bassett says:
    Feb 8, 2011 at 4:48 am

    Thanks. I am just beginning to understand all of the great features that Analytics can offer.

    Reply
  35. Marc says:
    Feb 1, 2011 at 7:23 pm

    Great compilation of what a beginner needs to know about Google Analytics and WordPress! I scheduled 1 hour to find out how to setup Analytics for my new site, I was done in 5 minutes… – Thank you!

    Reply
  36. Ailora says:
    Jan 26, 2011 at 3:17 pm

    Magnificent tutorial, thanks. I’m in the 12 – 24 waiting period to see if it works but I already appreciate you instructions and your willingness to reply to comments. I actually found what I was looking for in one of your responses to a poster.

    Reply
  37. Natalie says:
    Jan 17, 2011 at 11:51 am

    I really can not make sense of Google analytic. I prefer to use Piwik instead.

    Reply
  38. Ana Pacquiao says:
    Jan 13, 2011 at 5:34 pm

    this was very usefull, i had a little trouble because i’m not familiar with the html edition this worked great for me

    THNX A LOT!

    Reply
  39. Brett says:
    Dec 4, 2010 at 9:55 pm

    Thanks for the tip, I did the copy and paste and it worked great.

    Reply
  40. iankramer says:
    Nov 8, 2010 at 12:37 pm

    Thanks for the good info.

    Any differences/advantages between the direct paste and functions.php methods? Thanks!

    Reply
    • Editorial Staff says:
      Nov 9, 2010 at 8:20 am

      There is no advantage or disadvantage… it’s a matter of personal preference.

      Reply
  41. Shelley says:
    Oct 4, 2010 at 12:14 pm

    Great, clear description – even for someone is a codaphobe. Thanks. I am wondering tho, if when google activates this if the stats will appear in the wordpress dashboard like my other stats package did (the wordpress.com stats) which seems to be broken as of today. Thanks!

    Reply
    • Editorial Staff says:
      Oct 4, 2010 at 2:00 pm

      There are some advanced Google Analytics plugin that does that, but we recommend that you check on Google Analytics site, to get the full report. Because no plugin gives full integration.

      Reply
  42. Rose says:
    Sep 24, 2010 at 4:56 am

    This is indeed an informative site.It was really helpfull.

    Reply
  43. Ameya Waghmare says:
    Sep 21, 2010 at 1:01 pm

    I am not able to figure out still, how do you edit the footer (or header for that matter) of the theme of the webpage?
    can you please give instructions where can I find way to edit my footer?

    I have tried ‘Edit CSS’, ‘Extras’, and also some other options in the ‘Theme’ menu. Couldn’t get it done. :(

    Please help.

    Reply
    • Editorial Staff says:
      Sep 21, 2010 at 3:25 pm

      You will need to click on appearance and then editor. Find header.php or footer.php to edit those files.

      Reply
  44. Jeremy says:
    Jul 13, 2010 at 5:38 pm

    I’m thinking about going the plugin route – do I need to use both plugins or one or the other?

    I know that the “Google Analytics for WordPress” asks me where I want to embed it but then then “Google Analyticar” doesn’t ask anything about embedding so I’m wondering if it does it or if I have to do something manually…

    Thanks for this walk through!!!

    Reply
    • Editorial Staff says:
      Jul 20, 2010 at 12:40 pm

      You need the manual code or the plugin… not both. Google Analyticar just adds the code in your site.. It does not give you an option of where to embed.

      Reply
      • chris says:
        Nov 17, 2010 at 2:35 pm

        I am attempting to use the Google Analytics for WordPress plugin to add the code to my wordpress site. It gives an option for installing the code in the header. When I look at my header file after activating and authenticating the plugin, I see no added code in my header file. Is there somewhere else the code is installed besides the header for my theme?

        Reply
        • Editorial Staff says:
          Nov 17, 2010 at 2:45 pm

          It should add it in the area, but it will not modify your theme. If the code is not showing in your theme, then it can mean that your theme does not have a wp_head(); hook in the header.php.

  45. Jan Kasal says:
    Jul 2, 2010 at 11:25 pm

    Step 5 states to paste the code above the body end tag. Google has changed it since. It goes above the head. Just to let you know.
    Jan

    Reply
    • Editorial Staff says:
      Jul 3, 2010 at 11:06 am

      Google has not changed anything… All companies would like to have their scripts added in the header << But it is not wise for the webmaster. Any smart webmaster / developer would keep scripts like analytics in the footer to speed up the load time…

      WPBeginner has the codes in the footer. Twitter.com has the code in the footer and many other sites as well.

      Reply
      • physio says:
        Aug 4, 2010 at 10:49 pm

        Ok… apparently the commenting system doesn’t like angle brackets. That second paragraph should have said:

        If you want more accurate analytics you will use the new snippet version and you will put it in the head. If you are paranoid about page load times you will put it just before the close body tag.

        Reply
        • Editorial Staff says:
          Aug 5, 2010 at 12:11 am

          How does the placement reflect accuracy? Whether you put the script in the head, or at the end…. upon the full page load, it will still count one user…

  46. Brandon C. says:
    Jun 9, 2010 at 3:42 pm

    i wish i had seen this tutorial before i spent three hours trying to figure it out on my own.

    Reply
  47. Drew Michaels says:
    May 2, 2010 at 1:33 pm

    Would love to know your thoughts on which method you recommend for installation. Such as are there advantages to placing the code by hand vs. using a plugin?

    Reply
    • Editorial Staff says:
      May 2, 2010 at 7:12 pm

      Using a plugin is adding multiple database queries that you don’t need. By hand is probably the easiest method and it is efficient for the site :)

      Reply
  48. Omer Greenwald says:
    May 1, 2010 at 11:28 am

    This is one of the few features I did use a plugin for, even though it can definitely be achieved manually be pasting the code as you explained, thanks for sharing.

    Reply
  49. Eden-Avalon says:
    Apr 30, 2010 at 1:59 pm

    I just switched over from an entirely hand-compiled website to one using wordpress. This will be most helpful. Thank you!

    Reply
  50. Saikou marong says:
    Apr 30, 2010 at 12:36 pm

    Great tips for a newbie like me i will certainly try it now. The beauty of WPress is that it has a very little limitation.

    Reply
1 2 3 … 11 »

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WP Mail SMTP logo
WP Mail SMTP
Fix WordPress email delivery issues. #1 SMTP plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
LiveChat logo
LiveChat Inc Coupon
Get a 30 day free trial and 30% OFF LiveChat, one of the best live chat service providers for WordPress users.
ConvertKit Coupon Code
ConvertKit Coupon
Get a 14-day no risk FREE trial with this powerful email marketing software.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.