Insert Google Analytics Tracking Code in WordPress without Plugin

Learn how to implement the Google Analytics Tracking Code without using any WordPress Plugin. Just add the snippet in header tag and start analyzing the user behavior in realtime report.

Google Analytics is the ultimate online program for analyzing the user and overall website traffic. By using the Google Analytics tracking code on our WordPress blog, we can understand how our blog is performing as well as a judge what are the most interesting topics for our users.

Google Analytics is a free web-based tool and anyone with Google account or Gmail ID can sign up and take benefit of the tool.

In this article, we are going to learn how to sign up for a Google Analytics account and set up the tracking code in the WordPress blog for User behavior analysis.

If you’re following us, this is the Ninth article and video tutorial in #WordPressCloud series. We previously published the Free CDN for CSS Styles and JS Scripts.

Let dive into getting Google Analytics Tracking Code for our WordPress Blog —

Sign up for Free Google Analytics

Google Analytics is a free tool and anyone with Google account can sign up and take benefit of this amazing tool. Follow the below steps to sign up Google Analytics:

Google Analytics Sign up Page

  1. Access analytics.google.com on your favorite browser
  2. On Sign up page, click on Sign Up button and login with your Gmail ID
  3. Fill in the form with basic details about your site and category type of site
    Google Analytics Sign Up form Industry Category
  4. Submit the signup form and accept the terms & condition along with GDPR compliance policy
    Google Analytics Data and GDPR Terms and Conditions
  5. That’s it, you will now navigate to Google Analytics Administration page

You’ve now successfully signed up for free Google Analytics account.

Get the Google Analytics Tracking Code

Once you’re on Administration page after the first-time signup, you will be either displayed the Google Analytics tracking code to implement on your site. Or may need to navigate to get the tracking snippet.

Follow these steps to get the Google Analytics tracking code:

  1. Login to Google Analytics account
  2. Click on Admin tab with Gear icon — there will be 3 sections: Account, Property, and View
  3. Select Tracking Info > Tracking Code under the Property section
  4. Under Website Tracking section within the Tracking Code, you will find the Global Site Tag (gtag.js)
  5. That’s your Google Analytics Tracking Code with tracking ID: UA-XXXXXX

Google Analytics Tracking Code

Copy the tracking snippet and paste with <head> ... </head> tag in your website.

Inserting Google Analytics Tracking Code

We can easily insert the Google Analytics tracking code into a WordPress site without using any extra plugin. Follow the below steps to insert the GA Tracking code:

  1. Login to WordPress Dashboard
  2. Navigate to Theme Editor under Appearance menu
  3. Open the header.php file in Theme Editor
    WordPress Theme header.php file location
  4. Lookup for the closing head tag – </head>
  5. Copy and paste the Google Analytics Tracking Code just before closing </head> tag
  6. Update and Save the header.php file in Theme Editor
  7. That’s it!

Google Analytics Tracking Code in WordPress header.php file

The GA tracking code is inserted into WordPress <head> across the site.

Refresh and Test the Real-Time Visitor

Once the GA tracking code is installed, you can check your own visit session in Realtime overview report.

  1. Login to Google Analytics account
  2. Hover and click on the left-sidebar tab with name – Realtime
  3. And select the Overview Report within the Realtime tab

Google Analytics Realtime Overview Report

Here you’ll be able to check all the pages that you’re interacting your site on a real-time basis.

Quickly navigate into some pages or post on your site and notice the Per second graph for the number of Pageviews. The Top active pages will display the page that you’re currently visiting.

You can also check other reports tomorrow to see your complete interaction aggregated with other visitors you received on the website. Though you cannot identify yourself unless you’re the only visitor on your new site.

Google Analytics is also available as a native smartphone app in both Android as well as iOS devices.

Watch Google Analytics Setup for WordPress

Video tutorial on how to get the Google Analytics Tracking Snippet and also inserting it into the WordPress <head>. You can also view the real-time visits at an instant.

Easily insert Google Analytics tracking code in WordPress 🌐 without Plugin

I hope you liked the video, please subscribe to our channel.

What’s next in #WordPressCloud Series?

Now that we have installed the Google Analytics tracking code in our WordPress blog, next we are going to add and set up Rank Math plugin for the On-Page Search Engine Optimization plugin.

If you've any thoughts on Insert Google Analytics Tracking Code in WordPress without Plugin, then feel free to drop in below comment box. Also, please subscribe to our restoreBin YouTube channel for amazing videos tips. Cheers!

Share

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *