In this article, we will see how to correctly set up Google Analytics for WordPress. We will no need any plugin and you will see that this is very easy! Google Analytics, together with Google Search Console, are powerful free tools that Google kindly give us to track our website traffic.
With Google Analytics you can track from where and at what time your website has been visited. You can do a lot with this tool and you can also connect it to Google Tag Manager to receive further analytics information that you may need.
Hot to set up Google Analytics for WordPress
As a first thing, we need to create a Google Analytics account. Well, you should also have a Gmail account but I assume you already have one. Even if I can set up 50 different websites in my account, I usually work for clients’ websites so I create a new Gmail account every and each time I’m setting a WordPress website analytics.
If you type into Google ”Google Analytics”, the Google Analytics website will come up as one of the first options available. Click on it and go to the start page. If you are not logged in into any Google Account, the system will ask you to choose one in between your actives accounts in order to carry on. Of course, if you don’t have one, you can just follow the easy steps to create one in 2 minutes. You can go to the registration page clicking here if it helps.
Registering a new Goole Analytics Account
Set up Google Analytics for in your WordPress Website
To set up Google Analytics for WordPress let’s now go to our WordPress admin panel. As a first thing let’s go to the back and exactly in appearance -> Theme Editor. Here the system will warn you that is very dangerous to touch the PHP codes. In some way it’s true, it is dangerous because you could really mess up your website, but, on the other hand, you have backups available. If you want to be sure about not messing up, just do a backup of your website. If you don’t know how to do one, just talk to the server customer support and, in most of the cases, they’ll do it for you. Anyway I’ve prepared here below a picture that will show you how easy is this process.
Inside the Theme Editor
Now it’s time to look for the header.php on your theme editor sidebar. Once located, click on it and look for the <head> tag in its inside. Just right after the <head> tag, as I’m showing you in the picture below, paste the tracking code you have previously copied inside your Google Analytics dashboard.
THAT’S IT!! Your Google Analytics tracking code is set up and your website will start collecting data in a matter of minutes.
In my case, above the Google Analytics code, I have the Google Tag Manager one, just ignore it. Place your code exactly under the <head> tag.
We also organize free live WordPress Classes, to have more information click here.
See you soon.