How To Install Google Analytics On Your WordPress Site Without A Plugin?

How do your visitors interact with your website content? How long have they stayed on your page and what action they took when they visited your site? 

Knowing all these factors will help you design your business strategy for online business success. There are different tools to track visitors and get detailed insights into their behavior (such as page views, bounce rate, time spent on pages traffic source, etc.) and create a detailed report based on these parameters. 

Although millions of WordPress website owners use plugins such as MonsterInsights or GA Google Analytics to install Google Analytics on their site, it is still possible to integrate Google Analytics into WordPress without a plugin and the best part is it’s available for free!

But what if you don’t know how to install Google Analytics on WordPress without a plugin, read out this step-by-step guide to set up Google Analytics. Experts recommend hiring a custom WordPress development company for hassle-free and smooth installation of Google Analytics.

Backup Your Site Before You Proceed To Install Google Analytics

Before making any modifications to your site, WordPress customization experts recommend backup their site. You can choose one of the following backup plugins options:

  • BackWPup: This is the popular backup plugin that helps you to backup your site to Dropbox and other cloud storage services available. 
  • Jetpack: This versatile plugin is widely known for its excellent backup features, along with many other useful tools.
  • UpdraftPlus: With the help of this plugin, you can save backups directly to multiple locations, such as Google Drive, Dropbox, Amazon S3, email, and more.

How to install Google Analytics on WordPress without a plugin?

If you’re an advanced WordPress user and comfortable with code, you can add Google Analytics tracking code directly to your theme files. 

However, this method is not suitable for beginners as it can be unreliable and the code may vanish when updating or changing themes.

If you’re new to adding code to WordPress files, use this simple step-by-step guide.

Step-1: Create your Google account

If you don’t have a Google account, create one simply as shown in the image above.

Step-2 Login to Google Analytics

Once you have created your Google account, you can sign in to Google Analytics. 

  • Go to the Google Analytics homepage and click on the “Sign in” button located at the top right-hand corner of the page. 
  • Enter your email address and password and click on the “Next” button. Make sure to select the right one if you have many accounts.

Step-3 Get your Google Analytics Tracking ID

After logging into your account, navigate to the bottom-left corner of the google analytics dashboard. This area will show you three columns in the settings controls. 

Click on the middle column and select the “Tracking Info” option. From there, you need to choose “Tracking Code” to proceed with setting up the process of your Google Analytics tracking code on your website.

Step-4 Copy your Google Analytics Tracking Code

You will find your property’s unique tracking ID along with the complete Google Analytics tracking code in the Tracking Code tab. 

Copy this tracking code as you will need it to integrate Google Analytics with your WordPress website.

As you get your GA tracking code, you must copy it properly.

Step-5. Login to WordPress and insert the code

Now it’s time to log in to the backend of your WordPress website. Navigate to Appearance > Editor

You’ll be able to view all your site’s files in the editor tab and each file’s Google Analytics code snippet in the center of the page.

Also, you can see the header.php file on the right side, open it in the code editor and apply the tracking code site-wide.

Use your browser’s search function (Ctrl+ F) to find the closing </head> tag.

As you locate it, keep your cursor just before the </head> tag and paste into your full Google Analytics tracking code.

Now click the Update File button just below the code editor to save the modifications.

Step-6: Check Your Google Analytics Connection by Sending Test Traffic

Once you are done with all the steps of adding Google Analytics to your WordPress site, it may take almost 48 hours for data to start populating. 

You’ll not start seeing data related to traffic on your site immediately, so utilize your waiting period by testing your connection. It will allow you to check whether it was established correctly.

Go back to the Tracking Code page in your Google Analytics account and find the Status Update section next to your Tracking ID. 

Click on the “Send Test Traffic” button to open a small window with your website. This shows that everything is working correctly.

With this, your account should update and show an active user count of 1. However, you need to keep in mind that it might take up to a minute for this number to appear. So, don’t worry, be patient!

How to View Reports on the Google Analytics Website?

So, the process of installing Google Analytics on your WordPress is complete. Now, you must be excited for viewing the data collected from your stats. 

Go to the Google Analytics dashboard where in the left column you’ll see the built-in Google Analytics report. Each section is segmented into different tabs. As you click on a tab, it’ll expand it to show more options.

Here’s what multiple reports in Universal Analytics indicate-

  • Audience- This tab will help you get insights into your users. You can see user behaviors, demographics, interests, and the devices they are using to access your site.
  • Real-time– This report will display the view of your traffic with the number of active users, their geographical location, and the page they are visiting. 
  • Acquisition- This report will reflect where your users came from. You can check organic search, social media, paid search, referral sites, and other sources in this report.
  • Behavior– This report will give you a summary of what your users do after they land on your site. You can track the page visit, and time duration they spend on each page. You can even check their actions like making a purchase or filling out a form.

Conversion- This report will show the conversion rate and revenue generated from your site. Ultimately, you can see how well you are doing to achieve your business goals.


In this blog, we have shared easy steps to install Google Analytics on your WordPress site. We hope you’ll find this helpful. If you still find any difficulty in installing Google Analytics to your site, connect with us. We are just a call away! We have a team of WordPress experts who can make the process simple and hassle-free.

Share your views on this blog in the comment section below!

whatsapp logo