[Screenshots] How to Configure Google Analytics for SiteGround WordPress Sites

Install and Configure Google Analytics on SiteGround
Install and Configure Google Analytics on SiteGround

DISCLOSURE: This post may contain affiliate links, meaning when you click the links and make a purchase, we receive a commission.

If you want to get an in-depth report on your website visitors.

Then ‘Google Analytics’ is a must-have tool for your website. It is undoubtedly the best website traffic analysis tool in the world right now. So, you should integrate this awesome tool with your website/s as soon as possible.

And did we tell you that this tool is free to use? However, Google also offers a paid version of this tool. But, we think that the free version is more than enough.

So, in this article, we will let you know how to install, configure and integrate Google Analytics to your WordPress website hosted on a SiteGround web host. As always, this article will contain screenshots to make it easier for everyone.

Are You Ready?

Our Top Ranked #1 Web Host

Hostinger Logo

Ideal for WordPress, Joomla, Drupal and eCommerce

Visit Hostinger

Creating a Google Analytics account:

First, you need to have a Google account/Gmail address in order to create a ‘Google Analytics’ account. So if you don’t have any, create a new one right now. We recommend you to create a separate Google account only for your business related activities. Although in this article, we will assume that you have one already.

  • So, go to Google.com on your browser and click on the ‘Sign In’ button from the top right corner of the page
Sign in to Google
Sign in to Google
  • Then enter your Gmail address and password to log in to your Google account. Remember that this account will be used to sign up for the Google analytics account
Enter Username and sign in
Enter Username and sign in
Sign In page
Sign In page
  • Now click on the ‘Sign In’ button from the top corner. This will bring out a number of  options
  • You need to click on the ‘Analytics’ options from the list
Choose Analytics
Choose Analytics
  • On the next page, click on the ‘Sign Up’ button
Sign Up
Sign Up
  • This will take you to a new page where you can start the initial process of creating a Google Analytics account. By default, the account would be created for websites. However, you can create an account for mobile apps too. But as we need to track websites. So, we will go with the default option which is ‘Website’
Website option
Website option
  • Now you will have to fill up some forms. We will let you know all of the details about this section
  • Write a name on the ‘Account Name’ box. It could be your name or just your company name
Account Name
Account Name
  • In the section ‘Website Name’, type the name of your website
Website Name
Website Name
  • In the ‘Website URL’ box, type the whole address of your website. You can also choose between the ‘http’ and ‘https’ protocol. If you have SSL Protection on your site you need to select the ‘https’ and vice-versa
Website URL
Website URL
  • The ‘Industry Category’ is related to your website’s subject matter. There are a lot of different types of categories on this box. Choose the one which is the closest to your website’s niche
Industry Category
Industry Category
  • Choose the time zone of your location on this ‘Reporting Time Zone’ section
Reporting Time Zone
Reporting Time Zone
  • On the bottom of the page, you will find some settings related to ‘Data Sharing’. By default, all of them will be selected. However, if you don’t want to share data with Google, then you can uncheck the boxes
Data Sharing
Data Sharing Settings
  • Lastly, click on the ‘Get Tracking ID’ button on the bottom of the page
Get Tracking ID
Get Tracking ID
  • In doing so, a new popup window will appear with Google’s ‘Terms and Services’ (the Terms and Services are different for each location). However, you need to check-mark next to all of the boxes. And then you can click on the ‘I Accept’ button. At this point, your Google Analytics account will be created
Terms and Services
Terms and Services
  • So that you will be taken to the dashboard of your ‘Google Analytics’ account. You will find a unique ‘Tracking ID’ and an HTML tag code’ (‘Global Site Tag’) on the dashboard. This information is very important. So, do not share them with others
Analytics Dashboard
Analytics Dashboard

Good Job! You have just created your ‘Google Analytics’ account. Now you need to connect it to your websites. And there are numerous ways to do this. But, not all of them are effective. So, we will show 3 methods to install and connect ‘Google Analytics’ to your websites in the following section of this article. As always all of the methods will be described separately and in step by step style. So, what are you waiting for?

Method 1. Using Plugin:

It is the easiest way to install ‘Google Analytics’ on your website. So, if you are a beginner, you can try this method. There are a lot of plugins available which can be used to install ‘Google Analytics’. But in this article, we will talk about a couple of them.

Because both of these plugins are very easy to use and they have some extra features too. So, let’s start with the first one. The name of this plugin is ‘Google Analytics Dashboard for WP’. From now on, we will call it GADWP in the rest of the article.

Plugin 1:

How to install GADWP plugin to your WordPress account:

  • Log in to the WordPress dashboard of your website
WordPress Login
WordPress Login
  • Navigate to the left sidebar, hover your mouse over the option labeled as ‘Plugins’. You will see a new sub-menu will be visible. Click on the ‘Add New’ button from the sub-menu to proceed
‘Add New’ button
‘Add New’ button
  • Now on the next page, look at the top right corner. You will notice a ‘Search’ box
‘Search’ box
‘Search’ box
  • In that search box, type on the name ‘Google Analytics’ and press the ‘Enter’ key on your keyboard
  • In doing so, you will see a lot of plugins have been loaded on the search results section of the page. Look for the one plugin named as GADWP; usually, it will be the first one and the developer of this plugin is ‘Exactmetrics’.
GADWP plugin
GADWP plugin
  • When you find it, click on the ‘Install Now’ button. Within seconds the plugin will be installed on your WordPress website
Install Now
Install Now
  • Now you can click on the ‘Activate’ button to activate it
Activate
Activate

This is the way to install any plugin to your WordPress website. Now, you need to configure the GADWP plugin to integrate ‘Google Analytics’ tool on your website. Let’s see how.

How to configure the GADWP plugin:

  • After you have activated the plugin, look at the bottom left sidebar. You’ll notice that a new option named as ‘Google Analytics’ has appeared
Google Analytics
  • So, Click on the Google Analytics option to proceed
  • Then click on the ‘Authorize Plugin’ button
Authorize Plugin
Authorize Plugin
  • Now you will be redirected to a page where you will need to provide an access code. So, click on the red coloredGet Access Code’ button to generate the required access code
Get access code
Get access code
  • At this moment, you will need to sign in to your Google account (the account which was used to open Google Analytics account)
Sign In
Sign In
  • Then you should click on the ‘Allow’ button to continue
Allow icon
Allow icon
  • Then, you will be taken to a page where you will find a code automatically generated. It is that required access code. So, copy this code
Copy the Code
Copy the Code
  • Then paste this code to the blank box and click on the ‘Save Access Code’ button
Save Access Code
Save Access Code
  • Then you will see a notification on the next page saying that the plugin has been authorized successfully. This page will also bear a number of settings. It is up to you to choose the right settings for yourself. Although we recommend that you enable the ‘Auto Update’ setting. As always do not forget to save the changes
Save the changes
Save the changes
  • If you want to check out if this plugin is working or not. You can go to your WordPress dashboard. You will find a new widget which is known as Google Analytics Dashboard’. This is an awesome addition to this plugin. You can view a variety of data regarding your website’s visitors on that widget. This data will be directly fetched up from your Google Analytics account. So, you won’t even need to leave your WordPress dashboard to look for them
Real Time
Real Time
  • Now go to your site from a new tab of your browser. And then from the drop-down menu of the ‘Google Analytics Dashboard’ widget, select ‘Real Time’ and you will come to know that one visitor is visiting your website (see the image above). And we think you already know that this is none other than you. That means that the plugin is working successfully.

Now, we will talk about another plugin which does the same thing but in a different way. To be noted, do not use multiple plugins of the same kind. It’s up to you which plugin you are going to use. So, let’s start.

Plugin 2:

  • We assume that you are familiar with the process of installing a new plugin on WordPress. As we have mentioned the process earlier in this article
  • So by following that process, you have to install a new plugin named ‘Google Analytics for WordPress by ‘Monsterinsights’
  • So, as you are on the plugin installation page of WordPress, start typingMonsterinsights’ on the search box and pressEnter’ on your keyboard
Monsterinsights
Monsterinsights
  • The plugin we are looking for will be the first one in the search results. It is developed by ‘Monsterinsights’
Monsterinsights Plugin
Monsterinsights Plugin
  • So, click on the ‘Install Now’ button to install
Install Now
Install Now
  • And then click on the ‘Activate’ button to complete the installation
‘Activate’ button
‘Activate’ button

How to configure the ‘Google Analytics by Monsterinsights’ plugin:

  • Now, you will find a new option named as ‘Insights’ on the left sidebar of the WordPress dashboard. It is related to this plugin we just installed
Insights
Insights
  • So click on the ‘Insights’ button
  • Then on the main window, you will find a button name ‘Authenticate with your Google account’. And, click on it
Authenticate with your Google account
Authenticate with your Google account
  • Then sign in with the Google account which you used to register your Google analytics account
Sign in
Sign in
  • Then click on the ‘Allow’ button to proceed
‘Allow’ button
‘Allow’ button
  • Now, you can choose the websites you want to connect with your Google analytics account. It is better to leave at ‘All web site data’ option
‘All web site data’ option
‘All web site data’ option
  • Then click on the ‘Complete Authentication’ button and you will see a new pop up screen showing that the authentication is finalizing
Complete Authentication
Complete Authentication
  • Then you will be taken to a page, where you will come to know that your plugin is authorized. So, it means that you are done. Now, you can change some settings from the bottom of the page. We recommend enabling ‘Auto Update’ option. Then finally save the changes
Save the changes
Save the changes

Method 2. Editing the theme file:

In this method, you have to edit your theme file. So, we highly recommend creating a child theme of your current theme before trying out this method. On another note, this method is not applicable for the beginner users.

However, we will also add a shortcut for this method. So if you are a beginner you can try this. So let’s get to know the process.

First and foremost:

You need to get the ‘Global Site Tag’ (an HTML tag code from your Google analytics account). Let’s see how to do that.

  • Sign in to your Google analytics account
  • Then look at the bottom left corner of the analytics dashboard. Click on the ‘Admin’ button down there
Admin button
Admin button
  • Now, a new page will open with 3 options named as Account, Property, and View
Account, Property, and View
Account, Property, and View
  • You need to navigate to the ‘Property’ widget which will be in the middle of the page. And then click on the ‘Tracking Info’ option
Tracking Info
Tracking Info
  • This way, a new sub-menu will appear. Click on the ‘Tracking Code’ option from the new sub-menu which will take you to the page where you will find your unique ‘Tracking ID’ and the ‘Global Site Tag’
Tracking Code
  • You need to copy the ‘Global Site Tag’ code and paste it into the ‘Header.php’ file of your current theme
Global Site Tag
Global Site Tag

We will share in detail the process of pasting the Google HTML code in the ‘Header.php’ file of your theme down below. There are two methods of doing it. One is automatic and another is manual. Let’s see one by one.

Manual Process:

  • On your WordPress dashboard, hover your mouse over the option labeled as ‘Appearance’ and a sub-menu will appear. From that sub-menu click on the ‘Editor’ option
Click on the ‘Editor’
Click on the ‘Editor’
  • In doing so, your theme’s will be editable. In this article, we will use ‘WordPress 2017’ theme as an example. Whatever theme you use the process would be almost similar for all of them
  • So, when you open the theme editor, you will see a page like this image below
Theme editor
Theme editor
  • On the right-hand sidebar of the page, you will find ‘Theme Files’ option. Scroll down and find the option named ‘Header.php’ or ‘Theme Header’ and click on it
Theme Files
Theme Files
  • Now, on the left-hand side, the ‘Header.php’ file will be editable. You have to paste the Google Analytics HTML tag code (‘Global Site Tag’) in between the ‘wp_head()’ and the ‘</head>’ lines
Global Site Tag placement
Global Site Tag placement
  • Go back to your Google analytics account and Copy the HTML code from there
Copy the ‘Global Site Tag’
Copy the ‘Global Site Tag’
  • So, paste the ‘Global Site Tag’ code in its particular place. It will be like the image below
Paste the ‘Global Site Tag’
Paste the ‘Global Site Tag’
  • Then click on the ‘Update File’ button from the bottom of the page to save the settings
Update File
Update File

Now, if this method of editing your theme is troublesome for you. Then you can follow the shortcut method below. To perform this next step, we will take help from another plugin named ‘Insert Headers and Footers’.

Automatic Process:

  • On your WordPress dashboard, install and activate the plugin ‘Insert Headers and Footers’. It is developed by ‘WPBeginner
Install and activate this plugin
Install and activate this plugin
  • You will find it by searching by ‘Insert Headers and Footers’ (not case sensitive)
Search Plugin
Search Plugin
  • After installing the plugin, navigate to the left sidebar of the WordPress dashboard. And hover the mouse pointer over the ‘Settings’ option & a new sub-menu will appear
  • Click on the ‘Insert Headers and Footers’ option from that sub-menu
Install and activate this plugin
Install and activate this plugin
  • It will open a new page where you can paste the Google HTML tag code (‘Global Site Tag’)
Header code placement
Header code placement
  • You have to paste the code on the ‘Scripts in Header’ section
Scripts in Header
Scripts in Header
  • And then click on ‘Save’ button to finish the process

Method 3. For specific themes:

Some particular premium themes come with an option to enter a code in the header section of the theme. So, it is not suitable for everybody. On top of that, not every theme have the same method to perform this action. So, we will explain a common way by following which you will be able to replicate the method on almost all of the themes. Yet, if it doesn’t match yours. Don’t do it.

  • Go to the ‘Settings’ of your theme
  • Head over to the ‘Header’ settings of your theme
  • Typically, you will find a box named as ‘Header code’ or ‘Add code to header’ etc. where you could enter the code
  • Enter the Google HTML code (‘Global Site Tag’) on that box and save the settings to finish it up

How to check if Google Analytics configured correctly:

  • Go to your ‘Google Analytics’ dashboard
  • Click on the ‘Send Test Traffic’ button
Send Test Traffic
Send Test Traffic
  • In doing so, it will open a new browser window and it will automatically browse to your website. Don’t close that window

  • After a while, you will see that the ‘Status‘ has changed. It will show a notification saying ‘1 active user right now (including 1 from test traffic); which  means Google Analytics has been configured impeccably on your website
Status
Status

To sum up:

If you are struggling to install Google Analytics on your website, we hope this article will help you. We recommend that you use plugins to install Google Analytics on your website whenever possible. However, if that’s not possible you can always follow other methods mentioned above.

Leave a Comment