How to Link Google Analytics to Your WordPress Website

How to Link Google Analytics to Your WordPress Website

Google Analytics is one of the essential tools that you must use when creating a website. This will help you keep track of the traffic your page receives, among many other things. In this article, we show you a step-by-step on how you should link your WordPress website with a Google Analytics account.

First of all, I want to tell you some things that Analytics will help you with:

  • See which entries get the most traffic.
  • What country does your traffic come from?
  • Keep a count of how many people visit your site.
  • View users, sessions, and page views.
  • Compare date periods to see if your site is growing, staying the same, or going down.
  • What is the source of your traffic (organic, referred, direct, or social)?
  • From which devices do they visit your website (computer, phone, or tablet).
  • See the time spent by users.
  • Among many other functions that you will see as you use this tool.

First, you must have two tabs open: one with your website, where you have to be logged in and in the other, you must open Google Analytics.

If you don’t have an account, don’t worry, just have a Gmail email in which you are logged in, and there it will ask you if you want to create an account, it is as simple as clicking a button.

Steps to follow in Analytics

Once you are in the Analytics interface, go to the ” manage ” option at the bottom of the left column.

In the middle column, the one that says “property”, you must click on the blue button that says “create a property” and the following box will open.

In this section we must fill in the information that is requested starting with the name of the property, it is recommended that you put the name of your website, taking this website unmeso.com as an example, here you would write “One Meso”.

Next, you must select the country and the time zone, important to do this, since the data will be saved depending on the time you set, but do not worry, you can always change this in case you move to another country and have to change the hour.

Then we give the next and fill as appropriate.

In case you don’t know what to put in the last option «How will you use Google Analytics with your company? Please select all that apply. » I always select the first three options and “measure the monetization of my content.” For the moment those options will come in handy. Then we click on Create.

In the box that then appears “Configure a data flow to start collecting information,” we must select “Web” and the following section will open.

You must verify if your site is HTTP or HTTPS and select the option according to your site.

Then you type the URL of your website onesportslive.com and then you can rename your site.

In the Tagging Instructions section, you must click on “Global website tag (gtag.js)” and a code will be displayed that you must copy, this says that you must paste it in the <head> section of each page. Have that code handy and now go to the tab with your website.

Steps to follow in WordPress

You must access your website with your username and password and once inside go to Appearance> Theme editor in the left column. If it is the first time you enter there you will get a warning message, give yourself time to read it, and then click on “understood”.

Now you should look for an option that says ” Topic Header (Header.php) ” and click on it. Look for the tag that says “<head>,” usually before line 15.

Once you locate it, make some spaces and paste the code you received in Google Analytics.

Once you paste the code, click on “Update file” and from that moment on you will receive the data of the users who enter your website.

You can do the test yourself by entering your website and viewing the “Real-time” section of Google Analytics. If you did all the steps correctly now you have to be viewing yourself online on your website.

By the way, Google Analytics has a mobile version that you can save for iOS or Android in your phone’s virtual store so that you can monitor your data at any time of the day from your mobile.


Also Read: How to View Others Website Traffic and Data for Free