How to setup Google Analytics in WordPress
Get your Tracking IDGoogle 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 WordPress.com 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
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
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.
Integrate Google Analytics in WordPressThere 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
2.Click Upload Plugin
3.Click Choose file button and select lp-google-analytics.zip that you downloaded
4.Click Install Now
5.Once the plugin is installed click Activate Plugin
6.Your plugin is now installed and active. Not its time to set some some simple settings…
To configure the plugin, proceed to Dashboard > Settings > Lp Google Analytics
This is a super simple plugin with only two 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.