Adding Google Analytics to your WordPress website is a great way to track your website’s performance and gain valuable insights into your visitors’ behavior.
Google Analytics is a powerful tool that can help you understand how people find and use your website. It can also help you identify areas of improvement and track the success of your marketing campaigns.
Fortunately, adding Google Analytics to WordPress is easy. In this guide, we’ll show you how to add Google Analytics to WordPress in just a few steps.
Step 1: Create a Google Analytics Account
The first step is to create a Google Analytics account. To do this, go to the Google Analytics website and click the “Sign Up” button.
You’ll then be asked to provide some basic information about your website, such as its URL and the industry it’s in. Once you’ve filled out the form, click the “Get Tracking ID” button.
Step 2: Install the Google Analytics Plugin
Once you’ve created your Google Analytics account, you’ll need to install the Google Analytics plugin for WordPress. This plugin will allow you to easily add your Google Analytics tracking code to your website.
To install the plugin, go to the Plugins page in your WordPress dashboard and search for “Google Analytics.” Once you’ve found the plugin, click the “Install Now” button and then activate it.
Step 3: Add Your Tracking ID
Once the plugin is installed and activated, you’ll need to add your Google Analytics tracking ID. To do this, go to the Settings page in your WordPress dashboard and click the “Google Analytics” link.
On the Google Analytics settings page, you’ll see a field where you can enter your tracking ID. Copy and paste your tracking ID into this field and then click the “Save Changes” button.
Step 4: Verify Your Tracking Code
Once you’ve added your tracking ID, you’ll need to verify that it’s working correctly. To do this, go to the Google Analytics website and click the “Real-Time” tab.
If your tracking code is working correctly, you should see a graph that shows the number of active users on your website. If you don’t see any activity, you may need to double-check that you’ve entered the correct tracking ID.
And that’s it! You’ve successfully added Google Analytics to your WordPress website. Now you can start tracking your website’s performance and gain valuable insights into your visitors’ behavior.
Are you looking for a way to improve your WordPress website’s performance? Why don’t you try using Google Analytics? In this article, we’ll uncover the functionality of this tool and all the perks you can expect from using it. To top it off, we’ll also explain how to add Google Analytics to your WordPress website.
How to Add Google Analytics to WordPress Blog – Video Tutorial
Learn how to add Google Analytics to WordPress and improve your website performance in our step by step video guide.
Subscribe For more educational videos!
Hostinger Academy
If you prefer reading, check out the instructions below.
What Is Google Analytics
Google Analytics is one of the most popular web analytics tools on the market. This Google-powered free service can give you valuable data regarding website traffic and audience behavior. Thus, you get to make data-driven decisions to plan the growth of your site far ahead.
If you want to learn more about Google Analytics, sign up for free Analytics Academy Courses. These include beginners, advanced, power users, and more.
Why Is Google Analytics Important
Often, when you start a blog, your main goal is to get more followers and more traffic. Google Analytics is one of the ways that can help you do that.
Here are four reasons why you should consider the option to add Google Analytics to your WordPress site:
- Gain insights into your audience. See who visits your website and where your audience is located. You can also see what users are doing and how long they stay on your site. By segmenting your audience, you’ll get to develop a business growth plan in a calculated manner.
- Optimize your marketing strategies. Having insights into your market segments will make it easier for you to create the right marketing campaign decisions in order to achieve optimal results.
- Maintain quality content. As the tool allows you to see which pages and links receive most of the clicks, you can craft better content to provide to your audience’s needs and preferences.
- Identify the most active time. Posting time is one of the most important factors that can affect your website’s traffic. Once you know those peak times, you can adjust your posting time accordingly.
How to Sign up for Google Analytics
Before you can add Google Analytics to WordPress site, you need to sign up first. Not to worry, the process is quite simple and only requires a Google account.
Check out the steps to signing up for Google Analytics below:
- If you haven’t logged into your Google account or simply don’t have one yet, navigate to the registration page.
- Now, go to Google Analytics, click on the Set up for free button to start the process.
- On the Create Account page, enter your account name, set your Account Data Sharing Settings, and then click Next.
- In the following section select how you want to measure your site. Click on the Web option, then proceed to the next page.
- Enter your website details (i.e., name, URL, industry category, time zone, etc.) in the third section. Once you’re done, click on the Create button.
- Google Analytics will then present its Terms of Service. Tick all the necessary boxes, then click the I Accept button.
- That’s it! You have successfully created a Google Analytics account.
How to Install Google Analytics on WordPress
There are two methods to install Google Analytics onto your WordPress site. The first is by using a plugin and the second is doing it manually. Check it out below.
Adding With the Official WordPress Plugin
If you don’t want to mess with your theme, you can use a third-party plugin to do the job for you. Not only is it easier, but it reduces the risk of messing up the code.
Check out this article to learn how to install a WordPress plugin.
Since there are a ton of great Google Analytics plugins to choose from, we took the liberty to create a guide using one of the best plugin options on the market — MonsterInsights.
Supporting over two million users and counting, MonsterInsights is a robust Google Analytics dashboard plugin for all of your marketing needs. The plugin’s biggest advantage lies in its ability to create customized reports based on your choice of parameters.
If you only need the basic features of a web analytics tool, MonsterInsights offers a free Lite version. Should you need more options, you can upgrade to the Plus version at a starting price of $99.50 per year and is a great choice for small businesses. However, more options are available should you need it.
Here’s how to add Google Analytics with MonsterInsights:
- From your WordPress dashboard, navigate to Plugins -> Add New.
- Search for Google Analytics Dashboard Plugin for WordPress by MonsterInsights plugin. Download and activate it.
- Go back to your WordPress dashboard. A new Insights option should pop up.
- Scroll down a bit and you’ll see Launch the Wizard! button. Click on it. Follow the instructions to complete your initial setup. This is where you’ll need to connect MonsterInsights to your Google Analytics account.
- Continue following the instructions and filling in the necessary information. Once everything is done, you’ll see the Finish Setup & Exit Wizard button.
- Congratulations, you have completed the integration process! You can go to Insights -> Reports to see your site’s performance.
Adding Google Analytics to WordPress Manually
When you have signed up your Google Analytics account, you need to get a tracking code and place in on your website.
In order to add the Google Analytics code to the functions.php file, you need to have a child theme installed. How so? Aside from being relatively easier to modify, the child theme preserves all the changes you’ve made even when you update the parent theme.
You can check out this article to learn more about WordPress child theme creation.
Getting Google Analytics Tracking Code
After you completed the signup process, the service will redirect you to the area where you can obtain the Google Analytics code. However, if you want to retrace the steps, here’s how to get your tracking code manually:
- Log into your Google Analytics account, then navigate to the Admin menu on the bottom left.
- Click on the Tracking Info menu. Then, click on the Tracking Code submenu.
- You should now be able to see your Tracking ID and Global Site Tag. Save both of these codes as we will need them later.
Once you’ve obtained the tracking code, you can navigate to your WordPress to begin the configuration steps.
1. functions.php Code
There are a couple of ways to add Google Analytics to WordPress using the code snippet.
The first location where you can add the Google Analytics tracking code is the functions.php file. You create a new function that contains the code snippet.
Pro Tip
For precautionary reasons, it’s best to create a backup copy of the file before you modify it.
- On your WordPress dashboard, navigate to the Theme Editor section under the Appearance menu.
- Open the Theme Functions(functions.php) file from the right column.
- Add the following code snippet to the file. Don’t forget to replace the Tracking ID with your own.
add_action('wp_head','my_analytics', 20); function my_analytics() { ?> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-26575989-48"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-26575989-48'); </script> <?php }
- Once you’re done, click on the Update File button to save the changes.
You can also add the Google Analytics tracking code to the Theme Header (header.php) file.
- Navigate to the Theme Editor once again.
- Open the Theme Header (header.php) file on the right column.
- Paste the Google Analytics code snippet in the header area or, more specifically, above the </head> tag.
- Once you’re done, click on the Update File button to save the changes.
Google Tag Manager
Another method you can use to set up Google Analytics on WordPress is Google’s Tag Manager. This is used to increase your agility. Meaning you can update your own tags for conversion tracking, look at site analytics, and more.
Easily add or change your tags as you please, or include third-party tags for web and mobile apps. The best part is, you can update or add more scripts from the Tag Manager user interface instead of in WordPress.
After signing up, download the Tag Manager WordPress plugin. On your WordPress site, go to Plugins -> Add New -> search for Google Tag Manager -> Activate.
Once that is complete you will need to enter your Google Tag ID into the plugin. To do this go to your Tag Manager site and click on Admin. Here you will find an ID starting with GTM, copy it for now.
Then on your WordPress site go to Settings -> Google Tag Manager, and paste it into the Google Tag Manager ID box.
Conclusion
Google Analytics is a robust free web analytics tool that collects crucial information regarding your web performance and target audience. By gaining web analytics insights, you get to make data-driven decisions to grow your WordPress website in the most efficient way.
There are two ways for setting up Google Analytics on WordPress:
- Using a WordPress Google Analytics plugin — we highly recommend using MonsterInsights for this job.
- Adding it manually — adding a code snippet along with the tracking code to functions.php or header.php file.
We hope you found this guide useful on how to add Google Analytics to WordPress. If you have any more questions, feel free to leave a comment down below.
How to Add Google Analytics to WordPress: A Beginner’s Guide
Adding Google Analytics to your WordPress website is a great way to track your website’s performance and gain valuable insights into your visitors’ behavior. With Google Analytics, you can track page views, bounce rates, and other important metrics that can help you optimize your website for better user experience and higher conversions.
Step 1: Create a Google Analytics Account
The first step to adding Google Analytics to your WordPress website is to create a Google Analytics account. To do this, go to https://analytics.google.com/ and click on the “Sign Up” button. You will then be asked to fill out a form with your website’s information, such as the website’s name, URL, and industry.
Step 2: Get Your Tracking ID
Once you have created your Google Analytics account, you will be given a tracking ID. This tracking ID is a unique code that is used to identify your website in Google Analytics. You will need this tracking ID in order to add Google Analytics to your WordPress website.
Step 3: Install a Google Analytics Plugin
The easiest way to add Google Analytics to your WordPress website is to install a Google Analytics plugin. There are several plugins available, such as Google Analytics by MonsterInsights and Google Analytics Dashboard for WP. Once you have installed the plugin, you will need to enter your tracking ID in the plugin’s settings.
Step 4: Verify Your Installation
Once you have entered your tracking ID in the plugin’s settings, you will need to verify that the installation was successful. To do this, go to your Google Analytics account and click on the “Real-Time” tab. If you see data being tracked, then your installation was successful.
Conclusion
Adding Google Analytics to your WordPress website is a great way to track your website’s performance and gain valuable insights into your visitors’ behavior. By following the steps outlined above, you can easily add Google Analytics to your WordPress website and start tracking your website’s performance.