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 WordPress (step by step).
![How to Install Google Analytics in WordPress How to Install Google Analytics in WordPress](https://www.wpbeginner.com/wp-content/uploads/2019/02/installgoogleanalyticswp.png)
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 for Bloggers?
- How to Sign Up With Google Analytics
- Method 1: Google Analytics for WordPress by MonsterInsights
- Method 2: Install Google Analytics in WordPress With WPCode
- Method 3: Install Google Analytics in WordPress Theme
- Viewing Reports in Google Analytics
- Making the Most Out Of Google Analytics
Ready? Let’s get started!
Why Is Google Analytics Important for Bloggers?
Once you start a blog, your #1 goal is to get more traffic and subscribers. Google Analytics helps you make data-driven decisions by showing you the stats that matter. You can see:
Who visits your website?
This part of analytics shows the geographical location of your audience, which browser the user used 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 creating a custom website 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 to 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 they stay on your website, and the bounce rate (the percentage of users who exit your site on the first visit).
Using this information 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 the 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 best time to publish your post. If that time zone is not compatible with yours, then you can schedule your post for that hour.
How do people find your website?
This section of the analytics shows you where the users come from. For example, do they use search engines, enter direct links, or click on referral links from another site?
It also shows you what percentage of your visitors came from each of these sources. Google Analytics gives you a 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, like Google, Yahoo, Bing, and so on.
The breakdown of referral sources shows you which sites you need to work with the most. If your top referral source is Facebook, you need exclusive Facebook content to make your 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 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 methods that don’t work.
Simply put, eliminate the guesswork and focus on stats that matter, so you can make data-driven decisions.
Video Tutorial
If you’d prefer written instructions, keep reading.
How to Sign Up With Google Analytics
Google Analytics is available for free, and all you need is a Google or Gmail account to sign up. The signup process is quite simple. Just follow the step-by-step instructions below to create your Google Analytics account.
Step 1: First, you need to visit the Google Analytics website to sign up. When you are on the website, simply click the ‘Get started today’ button.
![Click get started today Click get started today](https://www.wpbeginner.com/wp-content/uploads/2019/02/click-get-started-today.png)
Next, you will be asked to log in 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 Sign in using your Google account](https://www.wpbeginner.com/wp-content/uploads/2019/02/sign-in-using-your-google-account.png)
Step 2: Once you have signed in with your Gmail account, you will see a welcome screen like the one below.
This is where you will sign up for Google Analytics with your Gmail account. Go ahead and click the ‘Start measuring’ button.
![Sign up for Google Analytics Click start measuring button](https://www.wpbeginner.com/wp-content/uploads/2019/02/click-start-measuring-button-1.png)
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 Enter your Google account name](https://www.wpbeginner.com/wp-content/uploads/2019/02/enter-your-google-account-name.png)
Google Analytics will also show multiple account data-sharing settings.
These settings give you control over sharing your Google Analytics data. You can keep the default settings and move on to the next step.
![Account data sharing settings Account data sharing settings](https://www.wpbeginner.com/wp-content/uploads/2019/02/account-data-sharing-settings.png)
Step 3: On the next screen, you will need to create a Google Analytics property.
Google introduced a new version of Analytics called Google Analytics 4 or GA4. It’s the latest version that tracks your website and mobile apps in the same account. Plus, you get new features, metrics, and a different interface for your reports.
Go ahead and enter a property name, and select your reporting time zone and currency. Then click the ‘Next’ button.
![Enter property name Enter property name](https://www.wpbeginner.com/wp-content/uploads/2019/02/enter-property-name-1.png)
On the next screen, you’ll need to select an ‘Industry category’ from the dropdown menu for your website and choose a ‘Business size’ from the given options.
When you are done, just click the ‘Next’ button.
![Enter business details Enter business details](https://www.wpbeginner.com/wp-content/uploads/2019/02/enter-business-details.png)
Next, you’ll need to choose business objectives and select how you intend to use Google Analytics with your business. This will help get personalized reports for your business.
For instance, there are options like generating leads, driving online sales, raising brand awareness, examining user behavior, and more.
You can choose multiple options or all of the given options that meet your needs. We recommend selecting the ‘Get baseline reports’ option so that you get all the Google Analytics reports populated in your account.
![choose your business objectives Choose your business objectives](https://www.wpbeginner.com/wp-content/uploads/2019/02/choose-your-business-objectives-2.png)
When you are done, simply click the ‘Create’ button.
Step 4: Now you will be presented with your Google Analytics Webs stream options.
Since we are setting up Google Analytics for a WordPress site, go ahead and select the ‘Web’ as the platform.
![Select data collection option Select data collection option](https://www.wpbeginner.com/wp-content/uploads/2019/02/select-data-collection-option.png)
After that, you’ll need to enter your website URL and Stream name.
By default, Google Analytics will have an ‘Enhanced measurement’ option enabled. This allows you to track pageviews, scrolls, outbound clicks, file downloads, and more in Google Analytics.
Note: If you plan to use the MonsterInsights plugin, then you should turn off the ‘Enhanced measurement’ option. Otherwise, the plugin will collect and display double the amount of data.
Next, you can click the ‘Create stream’ button.
![Enter website URL and stream name Enter website URL and stream name](https://www.wpbeginner.com/wp-content/uploads/2019/02/enter-website-url-and-stream-name.png)
You can now see your Stream name, URL, ID, and Measurement ID.
It will also show different enhanced measurements that it will record.
![View stream ID and measurement ID View stream ID and measurement ID](https://www.wpbeginner.com/wp-content/uploads/2019/02/view-stream-id-and-measurement-id-1.png)
At the top, you will also see an alert bar that will show you how to add Google Analytics to your WordPress site.
Go ahead and click the ‘View tag instructions’ button. You should now see different ways to add the Google Analytics tracking code to your WordPress website.
![View Analytics installation instructions View Analytics installation instructions](https://www.wpbeginner.com/wp-content/uploads/2019/02/view-analytics-installation-instructions.png)
Next, you can switch to the ‘Install manually’ tab.
You’ll then see the Google Analytics tracking code.
![Install GA code manually Install GA code manually](https://www.wpbeginner.com/wp-content/uploads/2019/02/install-ga-code-manually.png)
Go ahead and copy this tracking code because you will need to enter it in your WordPress site depending on the method you use below. You can also simply leave this browser tab open and switch back to copy the code when needed.
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 set up 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 set up Google Analytics in WordPress. We will show you three methods where the first option is the easiest and the last is 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 pageviews in your Google Analytics account.
Method 1: Google Analytics for WordPress by MonsterInsights
MonsterInsights is the most popular Google Analytics plugin for WordPress. Over 3 million websites use it, including the likes of Bloomberg, PlayStation, Zillow, WPBeginner, 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 eCommerce tracking, ads tracking, author tracking, and so on. The process of setting them up is the same.
For more information, you can see our complete MonsterInsights review.
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, and you’ll see a welcome screen. Go ahead and click the ‘Launch the Wizard’ button.
![Launch setup wizard Launch setup wizard](https://www.wpbeginner.com/wp-content/uploads/2009/08/launch-setup-wizard.png)
Clicking on it will open the 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 the ‘Save and Continue’ button.
![MonsterInsights setup wizard Choose what describe your website](https://www.wpbeginner.com/wp-content/uploads/2019/02/choose-what-describe-your-website.png)
Next, you need to connect MonsterInsights with your WordPress website.
Simply click on the ‘Connect MonsterInsights’ button.
![Connect MonsterInsights Connect MonsterInsights with your site](https://www.wpbeginner.com/wp-content/uploads/2019/02/connect-monsterinsights-with-your-site.png)
This will take you to Google accounts, where you will be asked to sign in or select a Google account if you are already signed in.
Go ahead and choose your Google account or enter your email to sign in.
![Sign in or select a Google account to continue Choose Google account to sign in](https://www.wpbeginner.com/wp-content/uploads/2019/02/choose-google-account-to-signin.png)
Next, you will be asked to allow MonsterInsights to access your Google Analytics account.
Click on the ‘Allow’ button to continue.
![Allow MonsterInsights to access your Google Analytics account Allow access to your Google account](https://www.wpbeginner.com/wp-content/uploads/2019/02/allow-access-to-your-google-account.png)
The next step to completing the connection 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 Connect analytics with your site](https://www.wpbeginner.com/wp-content/uploads/2019/02/connect-analytics-with-your-site.png)
After that, simply click on the ‘Complete Connection’ button to continue. MonsterInsights will now install Google Analytics on your website.
Next, you will be asked to select the recommended settings for your website.
![Recommended settings for Google Analytics Recommended settings](https://www.wpbeginner.com/wp-content/uploads/2019/02/recommended-settings.png)
The default settings will 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.
MonsterInsights will also ask who can see the reports. You can choose different WordPress user roles.
Once you are done, just click on the ‘Save and Continue’ button to save your settings.
![Who can see the reports Who can see the reports](https://www.wpbeginner.com/wp-content/uploads/2019/02/who-can-see-the-reports.png)
Next, MonsterInsights will show you a list of website tracking features you would like to enable.
You can scroll down and click on the ‘Continue’ button or the ‘Skip for Now’ option.
![Choose which tracking features to enable Choose which tracking features to enable](https://www.wpbeginner.com/wp-content/uploads/2019/02/choose-which-tracking-features-to-enable.png)
On the next screen, MonsterInsights will show that you’ve successfully set up Google Analytics tracking.
You can see that Google Analytics is connected, the tracking code is installed, and data is now being collected.
![Tracking should be all setup Tracking should be all setup](https://www.wpbeginner.com/wp-content/uploads/2019/02/tracking-should-be-all-setup.png)
Next, you can scroll down and see a field to enter your license key.
Go ahead and click the ‘Complete Setup without Upgrading’ option for now.
![Continue setup without upgrading Continue setup without upgrading](https://www.wpbeginner.com/wp-content/uploads/2019/02/continue-setup-without-upgrading.png)
You’ve successfully added Google Analytics to your WordPress website.
Disable Enhanced Measurement in Google Analytics
Now, if you created a Data Stream in GA4 on your own instead of letting MonsterInsights create one, then you’ll need to switch off Enhanced Measurement.
That’s because MonsterInsights adds multiple custom-enhanced tracking features. Leaving the Enhanced Measurement option enabled will skew your data and show incorrect results.
First, you can head to the Google Analytics tab or window in your browser. From here, click on the ‘Admin’ settings option in the bottom left corner.
![Switch to admin view in Google Analytics Switch to admin view in Google Analytics](https://www.wpbeginner.com/wp-content/uploads/2023/06/go-to-admin-settings.png)
Once you are on the ‘Admin’ page, you’ll see different settings.
Simply click on the ‘Data Streams’ option.
![Go to admin and data stream settings Go to admin and data stream settings](https://www.wpbeginner.com/wp-content/uploads/2019/02/go-to-admin-and-data-stream-settings.png)
Next, you’ll see your Data Streams.
Simply select the data stream you connected with MonsterInsights.
![Select your data stream Select your data stream](https://www.wpbeginner.com/wp-content/uploads/2019/02/select-your-data-stream.png)
On the next screen, you will need to disable the ‘Enhanced measurement’ option.
To do that, simply click the toggle.
![Disable enhanced measurement Disable enhanced measurement](https://www.wpbeginner.com/wp-content/uploads/2019/02/disable-enhanced-measurement.png)
Next, a popup window will open, confirming that you’d like to turn off the enhanced measurement.
Go ahead and click the ‘Turn off’ button.
![Click turn off button for enhanced measurement Click turn off button for enhanced measurement](https://www.wpbeginner.com/wp-content/uploads/2019/02/click-turn-off-button-for-enhanced-measurement.png)
Change Data Retention Settings in Google Analytics
By default, Google Analytics will set the data retention setting to 2 months. However, you can change this so that you can use your data in custom reports beyond 2 months.
First, you need to head to Admin » Data Settings » Data Retention in Google Analytics.
![Open data retention settings Open data retention settings](https://www.wpbeginner.com/wp-content/uploads/2019/02/open-data-retention-settings-1.png)
Next, you can click the ‘Event data retention’ dropdown menu.
From here, simply select the ’14 months’ option and click the ‘Save’ button.
![Change data retention settings Change data retention settings](https://www.wpbeginner.com/wp-content/uploads/2019/02/change-data-retention-settings.png)
Remember, it will take Google Analytics some time before showing your stats.
View Google Analytics Reports Inside WordPress Dashboard
The best thing about MonsterInsights is that you can view your Google Analytics reports inside your WordPress dashboard.
Simply visit the Insights » Reports page to check out a quick overview of your analytics data.
![Your Google Analytics reports in WordPress dashboard Dashboard reports](https://www.wpbeginner.com/wp-content/uploads/2019/02/dashboard-reports.png)
You can also add annotations directly to your MonsterInsights reports to record key changes you make to your website.
For example, you can add a note when you publish a new blog post, add a new landing page, and so on. This makes it easy to track how these events impact your traffic.
![View your site notes under the report View your site notes under the report](https://www.wpbeginner.com/wp-content/uploads/2023/05/view-your-site-notes-under-the-report.png)
For more details, see this guide on how to get GA4 site annotations in WordPress.
In addition, it comes with a Popular Posts addon that allows you to show your top-performing content to boost your traffic and pageviews.
![MonsterInsights Popular Post Templates MonsterInsights Popular Posts Widget](https://www.wpbeginner.com/wp-content/uploads/2011/11/prevnextmonsterinsights.png)
You can use it to automatically add inline popular posts links to boost engagement.
If you are running an online store, then it can also automatically add your top-performing products at the end of each blog post to boost sales:
![Popular products after content MonsterInsights popular products](https://www.wpbeginner.com/wp-content/uploads/2019/02/monsterinsights-popularproducts.png)
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: Install Google Analytics in WordPress With WPCode
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 (Global site tag) that you copied in Step 4 earlier when creating a Google Analytics account.
![Install GA code manually Install GA code manually](https://www.wpbeginner.com/wp-content/uploads/2019/02/install-ga-code-manually.png)
Next, you need to install and activate the WPCode plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Code Snippets » Header & Footer page. Here you must paste the Google Analytics tracking code that you copied earlier into the ‘Header’ section.
![Adding Google Analytics tracking code using Insert Headers and Footers plugin Enter tracking code in header using WPCode](https://www.wpbeginner.com/wp-content/uploads/2019/02/paste-ga-tracking-code-in-header.png)
Don’t forget to click the ‘Save Changes’ button to store your settings.
That’s all, you have successfully installed Google Analytics on your site.
Method 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 and paste code snippets in WordPress.
First, you will need to copy the Google Analytics tracking code that you copied in Step 4 earlier. You can view it in the Web Stream Installation section under the ‘Install manually’ tab.
![Install GA code manually Install GA code manually](https://www.wpbeginner.com/wp-content/uploads/2019/02/install-ga-code-manually.png)
Now there are two common ways to add this code to 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 code that you copied earlier right after the <body>
tag.
Don’t forget to save your changes and upload the file back to your server.
2. Add via Functions File
You can also add Google Analytics tracking code to the 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 } ?>
Don’t forget to replace the ‘Paste your Google Analytics tracking code from Step 4 here’ section in the above snippet with your Google Analytics code.
Viewing Reports in Google Analytics
Google Analytics is capable of showing you a treasure trove of data collected from your stats. You can view this data by visiting your Google Analytics dashboard.
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.
![GA4 reports GA4 reports](https://www.wpbeginner.com/wp-content/uploads/2019/02/ga4-reports-1.png)
Google Analytics 4 reports are a bit different from previous Universal Analytics reports. In the left column, you’ll see a dedicated Reports option. The reports are grouped together under 2 broad categories, including Life Cycle and User.
One of the most noticeable differences you’ll find in GA4 reports is that there’s no bounce rate metric. Other than that, you’ll find a new reporting interface, new metrics like engagement time, no goals in GA4, and more.
Here’s a breakdown of different reports in Google Analytics 4:
- Realtime report is similar to Universal Analytics and shows active users on your site in real time.
- Acquisition report shows which medium users use to find your websites, like organic, referral, email, and affiliate.
- Engagement report shows conversions and events that take place on your site.
- Monetization report shows all your eCommerce data in one place, along with new reports like in-app purchases and publisher ads.
- Retention report basically shows new vs. returning visitors and helps you get insights about user retention.
- Demographics report helps you see website traffic from top countries, cities, and more. It also shows gender breakdown and interest reports.
- Tech report shows which device, browser, operating system, app version, and screen size people use the most to view your website.
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, while 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
- WordPress conversion tracking made simple – A step-by-step guide
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.
If you want to improve your WordPress SEO rankings and get more traffic, then we recommend using the AIOSEO plugin for WordPress, which is an all-in-one SEO toolkit.
There’s also a free version of AIOSEO that you can use too.
This plugin will help you fully optimize your WordPress site with proper schema markup, sitemaps, and everything you need to improve your SEO rankings.
We hope this article helped you learn how to install Google Analytics in WordPress. You may also want to see our ultimate guide to increasing your blog traffic and our comparison of the best email marketing services.
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.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Benjamin says
Hi,
Great video. What if you wanted to paste the Google Analytic code on a specific page. I wanted to paste mine on the “CART” and “CHECKOUT” pages of my website.
Thanks in advance.
Benjamin
Sharon says
Hi, thanks so much for this! I have a question though.
So I didn’t set up my wordpress site, the intern before me did. And instead of inserting the google analytics tracking code in a plugin, he inserted it in the theme header and footer.
I foresee myself changing the theme, and just to save myself and the next intern a lot of trouble, I want to insert the google analytics tracking code through a plugin.
There are two problems I am facing though.
1. The universal tracking code that google analytics give me is this:
But I spotted the tracking code in the theme footer to be an extended version that looks like this:
So my question is, what is the difference between the two tracking codes? Does the extended version serve an additional function? If yes, what is this function?
2. When I tried to insert the google analytics code through the plugin “Insert Header and Footer”, and then when I checked my wordpress site, my google tag assistant says that there are multiple tags detected. My question is – are multiple tags a problem? Will it affect the tracking in any way?
Would really appreciate any help! Thank you!
WPBeginner Support says
You should only use either one of these codes. Just to be on the safe side, use the code provided by Google Analytics ua tracking.
Admin
Patricia says
Thank you for this!
Nate Balcom says
I wouldn’t say I’m a WordPress beginner, but I always forget where to embed the GA Code. That and it’s changed over the years. Thanks for the post. Love the site too. Great design.
Sally says
Very helpful, thanks!
Beth says
Thank you! This was so helpful!
Kate says
This was very helpful. Thank you!
Gabrielle Tyler says
Thank you for the easy, quick and useful info!
Sundar says
Useful info. Presented well.
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.
WPBeginner Support says
Please take a look at our explanation here, should you install plugins not tested with your WordPress version
Admin
Barry Richardson says
Your Search box does not seem to be working – I tried in Firefox and Chrome!
Michele says
Great and informative. However, I am not using WordPress.com 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?
Meg says
Hi,
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,
Meg
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.
Admin
priscilla says
Hi, complete beginner here with wp plugins. i dont have a clue how to install the insert header and footer plugin? i pressed download and then it goes into my computers download folder but what do i do next? i have my google analytics code ready to paste as soon as i can figure out this plugin. thanks!
WPBeginner Support says
Please take a look at our Step by Step Guide to Install a WordPress Plugin for Beginners.
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?
WPBeginner Support says
Every page.
Admin
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.
Nirmal says
Thanks for your excellent article. I managed to add Google Analytics to my site following your article.
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.
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
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!
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
Nicole says
Thank you for the instructions – hopefully I did everything properly!
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.
Steven Taitinger says
I think free wordpress.com 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.
Candice says
Thank you so much… you guys make everything so easy!! you rock!! xx
nasri says
Video was very helpful, thank you
Thessauron says
Thanks! If only everyone can explain in the concise, clear way you do.
McKenzie says
Wow, you’re a lifesaver!!!!
Shruti says
Hi,
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.
Wander Bite says
Hello,
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!
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
WPBeginner Support says
You will still need to enter your Google Analytics code.
Admin
sazia kazia says
Hi,
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.
Admin
Jake says
great tutorial! two thumbs up
Editorial Staff says
Thanks![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
vahid mohammadi says
thanks great article
but can i use my Gmail to manage unlimited sites
or its 1 gmail per site
Erik says
Hey Vahid, Google allows 50 sites per account. Enjoy!
Have an awesome day.
James says
Thank you for nice tutorial.
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
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.
Admin
Cephas says
Will try it out. Hope it works
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?
Deelip says
Hey
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?
Regards
Deelip
WPBeginner Support says
If they are on the same domain then you can use the same analytics code on both sites.
Admin
Malin Johansson says
Hi!
I´ve tried to seek information about plugins and Google analytics.
If I understand correctly you must have wordpress.org ? Or is it enough to upgrade wordpress.com to premium to be able to use plugins?
Thanks
/Malin
WPBeginner Support says
No you will still need a self hosted WordPress.org site to take full advantage of plugins. Please see our guide on the difference between self hosted WordPress.org vs free WordPress.com blog.
Admin
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.
Iris Dorreboom says
Hi!
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!
Iris
WPBeginner Support says
Yes pasting the code once in header is enough.
Admin
Iris Dorreboom says
Thanks! However, I may have done it twice by mistake – where do I check whether it appears only once in the code?
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?
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.
WPBeginner Support says
Yes, it does matter. You can only have Google Analytics tracking code once on every page. See our beginner’s guide on how to use Google Analytics for your WordPress site
Admin
Katie says
Video was very helpful, thank you!
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 wordpress.com site to the new wordpress.org!
Regards,
Amin
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.
Admin
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.
Admin
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
Simon Engström says
Hi,
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?
Regards
Simon
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”.
Simon Engström says
Gah! Again.. Anyway, “the closing head tag”.
WPBeginner Support says
You can paste it in either. However, pasting it in the header is often recommended.
Admin
Kat says
Thanks for your help!