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:
- 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“.
If you already have a Google account, click on the account. If not, click on “Create an account“.
Click on the tab administration“Found in the menu at the bottom left of the page.
Press the button Create an account“.
Enter a name for the account you want to create and click on the “button next“.
Select “web“To measure the audience of your website and click on the button”next“.
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“.
Check the Google Analytics Terms of Service and click on the & # 39;I accept“At the bottom of the new window.
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.
Enter the tracking ID and click on the “Saving Changes“.
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“.
click on header.php“In the right column to open the file.
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“.
Select the file functions.php is located in the right column.
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:
Once you have made the change, click the & # 39;Update file“.
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 👍