In this tutorial, I’m going to be showing you How To Add Google Analytics To WordPress.
How to add Google Analytics to WordPress
First of all, log into your site. Adding Google Analytics to WordPress is actually quite easy, with the use of one simple plugin called Header and Footer. In this tutorial, I will show you how to install Header and Footer, and use this plugin to easily insert your Google Analytics tracking code on every page of your website.
Go To Plugins & Install
Go to your plugins area which you can find in the sidebar to the left of your dashboard. From here we’re going to be clicking ‘add new’ which will take you to the section that you can search for all the plugins available for your WordPress site.
Search for ‘Header and Footer’ in the search box at the top right as you can see below.
The plugin we want to install should be the first result, ‘Insert Headers and Footers’, go ahead and click install.
Activate & Configure
Once you have installed the plugin, click active and you’ll be taken to a list of your active plugins.
Next, you need to configure your brand new plugin. It should say ‘click here’ to configure – once you have done that you’ll see the settings.
Today we’re going to add Google Analytics by using the tracking code as you can see below, Google suggests copying and pasting your code into the head of every page you want to track, so that’s what we’re going to do.
Insert Your Code
Simply copy your code and paste it into the ‘header’ section of the plugin.
Make sure you hit save!
Check it’s Working
In the previous tutorial, we spoke about a trick to use to check if it’s working – to do this, you have to hover the mouse over any part of the screen, right-click and choose ‘view page source’
This is going to show you the code on the back end of this page. Now all you need to do is use a ‘find’ function to search for this tracking code. On Windows, press CTRL and F, on Mac press CMD and F.
Go back to your Google Analytics page and copy the tracking code at the top as you can see below.
Paste it into your search box at the bottom of your back-end code and if it’s working you can see it highlighted in green on the page.
You’ve Done It!
Now you have successfully learnt how to add Google Analytics to WordPress. If you’re unsure how to find your tracking ID, just go to your Google Analytics dashboard, then admin and under property you’ll see ‘tracking info’ on the menu.
Hopefully, you found this post How to add Google Analytics to WordPress useful. If there’s anything you’d like to see expanded upon let me know, or if you need help to add Google Analytics to WordPress, email me at – firstname.lastname@example.org.