in Blog

How To Add Google Analytics To Your WordPress Site?

“If it cannot be measured, it does not exist” is a phrase that we have heard in many conferences on e-commerce and digital projects worldwide.

The importance of measuring what happens on our websites goes beyond installing a simple counter, as we did in the 90s. A vanity metric that made us happier the more the number increased.

But now everything has changed, and the counters have come to be called data. The reports of tools such as Google Analytics, Amplitude, or the alternatives Open Sources Matomo and Open Source OWA are essential to show your solvency as a digital business.

Beyond the tool, we should care about when taking data from our visitors to establish the business model we are creating, know the product funnel, set KPIs, look at the metrics that matter, and all this methodology analytics software that any startup knows and loves. We will get off the cloud and start implementing the first step of your new data policy on your website made with WordPress: install Google Analytics.

What is Google Analytics?

It is an analytical tool that tracks the clicks made by a person who visits your website. It is quantitative; it offers you numerical data on the behavior of your users.

We will know a whole series of behaviors that will surely come in handy to make decisions based on data. Here we bring you a list of the main things that you can know with Analytics:

In addition, with Google Analytics 4, you will be able to do many more things that you previously needed from Google Tag Manager to configure them finely. Some of these improvements are:

Create your first account in Google Analytics

The first step you must take is to create an account in Google Analytics if you have not done so yet. Being a Google product, you will need a Google account (Gmail).

The first screen that appears is the administration panel of your property (this first property is created automatically).

Property is found within Google Analytics, and it is the one that has the code and the tracking ID associated with it. Usually, one property per web page is configured. 

Add Google Analytics to your WordPress website.

After creating your account in Google Analytics, now it’s time to add the code of your property to your website. If your website is made in WordPress, you have three different options to do it:

Option A: add the Google Analytics script.

Option B: using Google Tag Manager (recommended).

Option C: using a plugin.

a) Option A: Adding the script

In this option, you will have to find the piece of JavaScript code that you own by Google Analytics and copy and paste it directly into the source code of your website so that it runs on all the pages of your website.

Although this is a custom-made website, it will be practically the only option that goes ahead that in WordPress; we do not recommend it at all.

The reason is that we are touching WordPress source code. It’s like digging into the engine of your car without mechanical knowledge. The probability that you end up loading your website is high. For this reason, we are telling it here so that you know that this path exists, but we do not delve into it.

The code we are talking about can be found in the administration panel of your Google Analytics property.

How to add the Google Analytics script in WordPress?

b) Option B: Using Google Tag Manager (recommended)

Google Tag Manager is a tag manager or container that allows you to insert new tags to your website without knowing to program.

These tags are also known as “pixels” such as Google Analytics, Google Ads, Facebook, etc. In other words, they are small pieces of code that are used to send information to different tools.

For example, once you have Google Tag Manager (GTM) added to your website’s pages, if you want to add the tracking of a new Google Analytics property, you can do it all from the GTM interface without touching anything else on your Web. Or, if you need to add the Facebook Ads or Google Ads conversion tracking code or any other Google Analytics event, you can also do it from the GTM interface itself.

Create a Google Tag Manager (GTM) container and add it to your web page:

c) Option C: Using a plugin

What is the best option to add Google Analytics to your website?

They are all equally valid, but you should always check that the installation was successful.

IMPORTANT! You must use only one way to add Google Analytics to your website. Otherwise, you will be duplicate recording visits to your Google Analytics property since each of the ways it does is add the code of your Google Analytics property to your web page.

Read on to check that you’ve added everything correctly and that you don’t have your duplicate tracking code.

Check that you have correctly added Google Analytics to your website.

Once you have implemented Google Analytics to record all the page views that occur on your web page, you must make sure that everything is correctly implemented.

Just as there are different options to implement the Google Analytics tracking code, there are other ways to verify that you have done the implementation correctly and ensure that you are effectively registering the traffic on your website.

The four methods to verify if you have added Google Analytics are:

a) Real-time reports

To see if you are registering visits to your Google Analytics property, you can go to one of your views in Google Analytics and open the ‘In Real Time’ report, indicating how many users are currently on your website. And, you can also see from which country they are accessing, through which source, and which pages of your website they are currently viewing.

b) Google Tag Assistant

Google Tag Assistant is an extension available in the Google Chrome browser through which you can see what tags are running on the website you are viewing (regardless of whether you have access to it or not).

After installing it, an icon will appear next to the toolbar that, after clicking, and if you are currently browsing your website, it will show you which tags are running on your website.

If you see the Google Analytics tag with your Property ID, it means that visits to your website are being recorded.

c) Google Analytics Debugger

Another Google Chrome extension that is used to verify if the tracking code of your Google Analytics property has been implemented correctly is “Google Analytics Debugger”:

After installing it, you must:

Wrap Up

Google Analytics is a potent tool with tons of excellent features. Some are pretty obvious and easy to use, while others require more effort, including additional setup and teardown phases.

Google Analytics works very well with Google Search Console to help you measure your site’s search traffic and performance, fix issues, and make your site thrive in Google Search results.

If you want to boost your website SEO rankings and get more traffic, we’d love to connect and help you. Our dedicated team has expertise in taking your digital business to the next level!

We hope this article helped you learn how to install Google Analytics in WordPress. If you liked our article and thought it could help someone, please share it on your social media profiles. 

REACH OUT

Writer and a Baker, working hard to earn the name and fame in the writing industry. Published 100's of articles and blogs for domestic and international clients.

Stay in the loop

Subscribe to the weekly newsletter for all the latest updates

Wordpress Social Share Plugin powered by Ultimatelysocial