How To Setup Google Analytics On WordPress

Setting Up a WordPress Website is not enough for you to track the visitor’s data. You must configure Google Analytics properly. Don’t skip just scroll down slowly and you will learn how to setup google analytics on WordPress.

Google Analytics is a web based service that allows users to track visitors or user’s data. You can configure analytics on a website or app (Android or IOS). First, you need to create an account in Google Analytics. If you already have a Google account then you are done. If you don’t have Google account then first create a Google account. 

Let me show you how to sign up on Google Analytics and Add property. 

How to add a property in Google Analytics?

Visit Google Analytics homepage and click on the “Start measuring” button. Now it will redirect you to the sign-up process.

Google Analytics Homepage

There are three steps to complete your registration. The first part is account setup, second is property setup, and third is about your business. When you finish your data submission, click on “Create” button. A popup with “Terms of Service” will appear. Just check and click continue. Enjoy the following screenshots and you will get it.

Google Analytics Account Setup
Google Analytics Property Setup
Google Analytics About Your Business
Google Analytics Agreement

Now it’s time to get the tracking code for website. You will see “Data Streams” option like the following screenshot.

Data Streams Global Site Tag

Click on your website streams. You will see “Global Site Tag (gtag.js)” option there. Click on this option and copy the code or keep this code open in your browser tab.

Global site Tag Code

Paste Google Tag code in Header.php

I recommend you to install a Child Theme on your website. Then log in to your Website Cpanel or FTP. Navigate to wp-content> Themes> Your Active Child Theme.

Child Theme header php file

Upload your header.php file inside child Theme. Edit the header.php file and find out the <head> tag. Now paste the “Global Site Tag” code inside <head> tag.

Paste Google Analytics Code in Child Theme header

[Note: If you use any blank page template, then Google will not track visitor of this page. Because a blank page template doesn’t contain any header or footer. I am just recommending you to put the “site tag code” in the header because generally, we use a dynamic header for all pages and posts. There is a problem if you update the main Themes header.php file. When you will update the Theme in future, you have to place the Google Analytics code again. ]

Configure Analytics using MonsterInsights Plugin

MonsterInsights one of the best plugin that will help you to setup Google Analytics on WordPress website.

Navigate to plugins>Add new, search for “MonsterInsights”. Install and active the first plugin. This is a freemium plugin available in WordPress plugin library. To get basic visitors data, the free version is enough. If you need more data and page target for your website, then you can move to the pro plan.

Start the setup wizard and it will take care of everything. You don’t have to manually insert anything. After starting the setup wizard, just input your all data properly and connect your Google account, which you want to link for Google Analytics.

MonsterInsights setup Wizard

Google Analytics for hosting user made it easy for Google Analytics lovers. Inside your dashboard, you will see tools>marketing option. Go to traffic tab and scroll down. There is a dedicated option for Google Analytics. Just paste your Gtag, no need to put the full code.

Google Tag ID for WordPress Hosting User

That’s all about setting up Google Analytics service on your WordPress website. If you are non technical then you can try the plugin as a solution. You will get a lot of visitors data including behavior in Google Analytics. I recommend you to try the manual step first. 

Your Elementor Projects Deserve the Best

Get Master Addons Now

© 2021 - Master Addons| All rights reserved

Master Addons Demos


Animated Headlines
Dual Heading
Gradient Headline


Image Hover Effects
Image Hotspot
Filterable Image Gallery
Image Comparison
Gallery Slider
Advanced Image


Advanced Accordion
Toggle Content
Team Member
Team Slider
Business Hours
Pricing Table
Restrict Content
Dynamic Table

Special Elements

Call to Action
Progress Bar
Progress Bars
Creative Button
Creative Links
News Ticker
Table of Contents
Current Time
Domain Search
Nav Menu
Counter Up
Countdown Timer


Animated Gradient BG
Reading Progress Bar
Background Slider
Custom CSS
Custom JS
Container Extras
Mega Menu
Entrance Animation
Display Conditions
Dynamic Tags
Floating Effects
Custom Breakpoints
Post/Page Duplicator
Wrapper Link

Contact Form

Contact Form 7
Ninja Form
WP Forms
Gravity Forms
Caldera Forms