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 the 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.
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:
- Access analytics.google.com on your favorite browser
- On Sign up page, click on Sign Up button and login with your Gmail ID
- Fill in the form with basic details about your site and category type of site
- Submit the signup form and accept the terms & condition along with GDPR compliance policy
- That’s it, you will now navigate to Google Analytics Administration page
You’ve now successfully signed up for a free Google Analytics account.
Get the Google Analytics Tracking Code
Once you’re on the 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:
- Login to Google Analytics account
- Click on Admin tab with Gear icon — there will be 3 sections: Account, Property, and View
- Select Tracking Info > Tracking Code under the Property section
- Under Website Tracking section within the Tracking Code, you will find the Global Site Tag (gtag.js)
- That’s your Google Analytics Tracking Code with tracking ID: UA-XXXXXX
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:
- Login to WordPress Dashboard
- Navigate to Theme Editor under Appearance menu
- Open the header.php file in Theme Editor
- Lookup for the closing head tag – </head>
- Copy and paste the Google Analytics Tracking Code just before closing </head> tag
- Update and Save the header.php file in Theme Editor
- That’s it!
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 the Realtime overview report.
- Login to Google Analytics account
- Hover and click on the left-sidebar tab with name – Realtime
- And select the Overview Report within the Realtime tab
Here you’ll be able to check all the pages that you’re interacting with 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 tutorials 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.
I hope you liked the video, please subscribe to our channel.
What’s next in the #WordPressBlog 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. Cheers!