How to Add Google Analytics Code to WordPress without Plugin in 2018

Share this Article

 

Google Analytics is used for measuring the traffic. We will tell you about How to Add Google Analytics to WordPress without Plugin. If you install more plugins that it slows down the website speed. So use this method and install Google Analytics in 1 minute.

What is Google Analytics?

Google Analytics is a freemium web analytics tool provided by Google to track the website traffic and website report.  This tool is made for the Search Engine Optimization and Marketing purpose.

 

Add Google Analytics to WordPress without Plugin
How to Add Google Analytics to WordPress without Plugin

 

It is developed by Urchin Software and Google bought it in 2005 from Urchin Software. You should use the Analytics tool to measure your website traffic and get the reports. Google Analytics is important On Page SEO factor.

How to Add Google Analytics to WordPress without Plugin in 2018: 7 Steps to Follow

Step 1: Sign up for Google Analytics. Create a Gmail Id because these are the Google’s Product. Gmail Id is much needed.  Search with analytics.google.com. 

 

How to Add Google Analytics to WordPress Website

 

Step2:  Click Sign-up with Gmail Id and Password.

 

How to Add Google Analytics to WordPress Website

 

 

Step 3: After Sign-up you can track your website or App here. Here you will add Website Name, URL, Category of your website, Reporting time zone. In website URL, you will add URL without HTTP or HTTPS.

 

How to Add Google Analytics to WordPress Website

 

Step 4: Click on Get Tracking ID. Google Analytics gives you the Javascript Code. You will copy this code and Paste in your website. The JavaScript code is like this.

 

<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-123456789-1″></script><script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-123456789-1’);
</script>

 

Note: If you have lost this code during verification then you will go in Admin section. You will go to Property.  In Property, you will see Tracking Info. Tracking Code is available in Tracking Info.

Step 5:  When will you get the tracking code from Google Analytics then you will go to your WordPress Website. Go to Appearance and you will see the Editor.

 

How to Add Google Analytics to WordPress Website

 

Step 6: Go to the header.php file. You can find this file in the right section where the themes files are available.

Step 7: So paste your Analytics Javascript code between the <head></head> otherwise paste the Javascript code before </body>.

 

Example: 

<head>

<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-123456789-1″></script>

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-123456789-1’);
</script>

</head>

 

Other Method: 

Step 1: Copy the Javascript code and Create the file analyticstracking.php. Paste Javascript code in this file and save this file.

Step 2: Upload this file to the root directory (public_html)  of the website.

Step3: Add <?phpinclude_once(“analyticstracking.php”) ?> after <body> tag. The <body> tag will be find in header.php file in WordPress.

Your code is added to the website and after adding the code you can test through Google Analytics.

Example: if you type the website URL like this www.ellisonhub.com then you will see 1 visitor in Real-time report or Main Dashboard of Analytics of your website.

 

How to Add Google Analytics Code in WordPress without Plugin

 

Note: If you want to open your desired website report then Go to Accounts> Property>Views. It will open all the reports.

So, these are the methods, How to Add Google Analytics Code in WordPress Without Plugin. Use these method and measure your website traffic after installation.

Conclusion:

By this blog, you have learned How to Add Google Analytics to WordPress without Plugin in 2018. Apply any method of adding the code. The first method is comparatively easy to the second method. Analytics is necessary for SEO prospects. So use these methods and add Google Analytics early if you have not added.

if you have liked this article then like our Facebook Page to get more relevant content regarding Digital Marketing, WordPress.

Read this:

12 Best Free WordPress Plugins Every Digital Marketer Should Use (2018) 

A Step by Step Guide to SEO Checklist 2018

Summary
Review Date
Reviewed Item
Ellison-Hub
Author Rating
51star1star1star1star1star

Share this Article

Vishal Tyagi

I am a Digital Marketer, SEO Professional and Blogger. In this blog, We will tell you about SEO, WordPress, Facebook, Social Media, Blogger Platform.

shares