How to setup Google Analytics in WordPress

Google Analytics in WordPress
By Aditya Samanta Updated

Get your Tracking ID

Google Analytics or to be more precise Google Universal Analytics is a cross platform tracking service to collect tracking information from any device. It provides you with all sorts of information about your visitors like who has been visiting your site, where they come from, time of the day when you receive most visitors, real time monitoring and much more which you can use to analyze your audience. In this tutorial, we will show you how to setup your self hosted WordPress site with Google Analytics. Please note that you can’t use Google Analytics with free sites.

The first step is to get your own tracking id. For that you will need to have a Google Analytics account

If you have a gmail account, then you can use it to signup or else you will need to create a new account Once your account is setup and you are logged in, visit the signup url again and you will see a screen like this

google analytics signup

Click the Sign up button

You will be taken to the account setup page. You have two available options – track a Website or Mobile app. For our purpose, we need to select Website

google analytics account

The setup is pretty straight forward. Fill in all the required fields and click the Get Tracking ID button

The Google Analytics Terms of Service Agreement will appear, which you must agree to. Click I Accept

You will land on the page with your tracking id. This is the code that we need, so copy it.
google analytics account

Integrate Google Analytics in WordPress

There are many ways in which you can integrate Google Analytics in WordPress. We will do it using a simple plugin which you can download here plugin download link. First we neet to install the plugin

1.Go to Dashboard > Plugins > Add New
dashboard plugins

2.Click Upload Plugin

add plugin button

3.Click Choose file button and select that you downloaded

upload plugin

4.Click Install Now

5.Once the plugin is installed click Activate Plugin

plugin installed

6.Your plugin is now installed and active. Not its time to set some some simple settings…

plugin activated

Plugin options

To configure the plugin, proceed to Dashboard > Settings > Lp Google Analytics
dashboard settings

This is a super simple plugin with only two settings

plugin settings

Google Analytics ID

This is the only option that you need to configure. Enter your Property Tracking Id that you received from Google.

Load scripts in

This is optional. By default, the script is loaded ih header (recommended by Google) but you can choose to place it in the footer area or simply ignore this option.

Input your tracking id, select where you would like to place code and click Save Settings button to save

Your WordPress powered site is now configured with Google Analytics. It may take anything between 12 to 24 hours for Google to provide you with statics for your site.