fbpx
  Login
How to easily install Google Analytics on WordPress?

How to easily install Google Analytics on WordPress?

How to easily install Google Analytics on WordPress?

Google Analytics is free software making you track visitors who surf on your website. Moreover, it makes it possible to follow the habits of each of them, but also the sources of traffic, social statistics and many other things. With these statistics you can plan and create targeted content for your visitors. This article explains how you can add Google Analytics to your WordPress site.

How important is Google Analytics?

After your WordPress site is installed, you must concentrate on it the increase in traffic and the number of subscribers visit your website. Therefor you can install At last Google Analytics. Indeed, this software will help you make decisions based on the statistical data from your WordPress site.

You can visualize various things with Google Analytics statistics.

Who visits your website?

The first part of Google Analytics u indicates the geographic location of your visitors, the browser used and other important information such as the screen resolution and the language of your visitor.

This data is very useful and can help you, as part of a custom design, to ensure that your site is compatible with the target audience.

What do visitors do on your website?

In fact, Google Analytics lets you know where visitors go to your website. You can also find the navigation time and the bounce rate (the percentage of users who leave your site on the first visit). You can also read the most popular articles.

When do people visit your site?

You can view the hottest hours of the day on your site, allows you to choose the time to publish your articles.

How did people get your website?

This part of the analysis indicates the origin of the users (for example: search engines, direct links, referral links from another site).

This section also displays the percentage of visitors for each source.

How does Google Analytics work?

The operation of Google Analytics is relatively simple. This software consists of:

  • Javascript code: The Javascript code is inserted on your pages. It is then performed to collect all information about your site and your visitors.
  • A service with which data can be collecteds: The data collected by JavaScript code, the latter being sent to Google for processing
  • Data processing: After collections, Google converts raw data into useful information such as the visitor's country, screen type used and other data.

1. Create the Google Analytics account

First and foremost you must create a Google Analytics account. With this account you can indeed restore the tracking code. To do this, go to the homepage & # 39;Google Analytics“. Click on Log in to Analytics“.

Google Analytics "width =" 590 "height =" 293 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_1-300x149.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_1.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

If you already have a Google account, click on the account. If not, click on “Create an account“.

Google Analytics "width =" 590 "height =" 295 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102556_814_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_2-300x150.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_2.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Click on the tab administration“Found in the menu at the bottom left of the page.

Google Analytics "width =" 590 "height =" 292 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102556_166_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_3-300x148.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_3.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Press the button Create an account“.

Google Analytics "width =" 590 "height =" 294 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102557_904_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_4-300x149.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_4.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Enter a name for the account you want to create and click on the “button next“.

Google Analytics "width =" 590 "height =" 294 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102557_98_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_5-300x149.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_5.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Select “web“To measure the audience of your website and click on the button”next“.

Google Analytics "width =" 590 "height =" 294 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102558_375_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_6-300x149.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_6.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Enter the ownership information, such as the name of the site, the URL of the site, the category of your website and your time zone. Finally click on the “button create“.

Google Analytics "width =" 590 "height =" 294 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102559_499_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_7-300x149.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_7.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Check the Google Analytics Terms of Service and click on the & # 39;I accept“At the bottom of the new window.

Google Analytics "width =" 590 "height =" 295 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102559_128_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_8-300x150.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_8.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

You have just created your Google Analytics account. You will now find the Google Analytics tracking code on the page.

2. Add Google Analytics to your WordPress site

You have several options add Google Analytics tracking code to WordPress. You can indeed use a plug-in to add the tracking code to your file header.php or by creating a new function in the file functions.php.

Use a plug-in

If you are not familiar with the structure of a WordPress site and you are not familiar with PHP, the easiest way to do this is to install a plug-in on your WordPress site. You can set up Google Analytics for this. Therefor log in to your WordPress dashboard click on “extensions“Then on”to add“. Search for the plug-in”Google Analytics“, Install and activate the plugin.

Google Analytics "width =" 590 "height =" 294 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102560_687_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_9-300x149.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_9.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Enter the tracking ID and click on the “Saving Changes“.

Google Analytics "width =" 590 "height =" 295 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102560_327_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_10-300x150.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_10.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

After configuring the plug-in you have to wait 12 to 24 hours so that the first results are displayed in Google Analytics.

Enter the code in the header.php file

Go to the WordPress dashboard, click on “appearance“Then on”Theme editor“.

Google Analytics "width =" 590 "height =" 287 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102561_183_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_11-300x146.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_11.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

click on header.php“In the right column to open the file.

Google Analytics "width =" 590 "height =" 295 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102561_216_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_12-300x150.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_12.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Place the Google Analytics tracking code in front of the tag . When done, press the & # 39;Update file“.

It should be noted that with this method the analysis will only be accessible for the standard theme used. That is why you must submit the code if you change the theme.

Create a new function in the function.php file

After you are connected to your WordPress dashboard, click & # 39;appearance“Then on”Theme editor“.

Google Analytics "width =" 590 "height =" 286 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102562_764_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_14-300x146.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_14.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Select the file functions.php is located in the right column.

Google Analytics "width =" 590 "height =" 295 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102562_213_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_15-300x150.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_15.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

The following excerpt creates a new function and inserts it just before the tag of your WordPress site. The code is the following and is inserted at the end of your file functions.php:

Google Analytics "width =" 590 "height =" 221 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102562_10_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_16-300x112.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_16.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

Once you have made the change, click the & # 39;Update file“.

Google Analytics "width =" 590 "height =" 285 "srcset =" http://www.luhoster.com/wp-content/uploads/2019/11/1574102562_680_How-to-easily-install-Google-Analytics-on-WordPress.png 590w, https: // blog .lws-hosting.com / wp-content / uploads / 2019/10 / Screenshot_17-300x145.png 300w, https://blog.lws-hosting.com/wp-content/uploads/2019/10/Screenshot_17.png 643w "sizes =" (max. width: 590px) 100 vw, 590px

How to place adsense in WordPress?

conclusion

You are now able to install Google Analytics on your WordPress hosting. This software is essential for the success of your website. Indeed, it allows you to better understand your visitors and to offer optimized content for the latter.

I hope this article helped you and thank you for reading me so far

Feel free to like and share this article 👍

 

 

**//

Need help? Call our award-winning support team 24/7 at (UK)+44 7512836962  OR  (PK)+92 347 7500509

    Subscribe our newsletter

Copyright © 2009-2020 LuHoster.com - All rights reserved.