How to Install Google Analytics on a WordPress Site – Counter

print · Время на чтение: 3мин · - · Опубликовано · Обновлено

playListen to this article

How to install Google Analytics on a WordPress siteHow to install Google Analytics on a WordPress site - There are several ways to solve this issue. In the last article, I already talked about how to add the Yandex Metrica counter code to the site. Google Analytics counter connects to WordPress by similar methods.

It is worth noting that Google analytics is quite seriously implemented in many WordPress plugins and even themes. This distinguishes it from Yandex metrics at times.

I decided to describe some of the most correct ways to add a Google Analytics counter to your site. Let's get started.

The content of the article:

How to install Google Analytics on a WordPress site using a plugin

Using plugins when adding Google Analytics to a site is a very common and easy method. It is enough to install the required plugin and place your Google Analytics code in it. Once pasted, the data will immediately appear in your analytics profile.

Install Google Analytics in WordPress using a plugin.

Consider the Google Analytics plugin for WordPress, with which you can easily connect Google analytics to the site. To do this, do the following:

  1. Download the plugin and install the plugin.
  2. Activate the plugin and follow the instructions.
  3. Log in to start the plugin.

An example of setting up a Google Analytics plugin for WordPress.

As a rule, authorization of the plugin in the Google Analytics system does not take much time. The plugin needs permissions and your Google Analytics account. After obtaining the necessary accesses and permissions, the plugin will connect to your profile and start reading your website traffic.

Installing Google Analytics on WordPress via Theme Settings

This method can be chosen by those who have a PRO theme at their disposal. Such themes give us more tools to implement new functionality on the site. For example, an extended footer where you can place your Google Analytics code. Using the example of inserting the Yandex Metrica code. Go to appearancetune - next you need to find the basement settings. Where we actually place the code itself. See image.

An example of inserting the counter code in the footer.php theme file.

Installing the Google Analytics Counter Code in WordPress Using the Footer.php Theme File

Another very effective way to host your Google Analytics code is in the footer.php file. This file is located in your theme, you can find it in the following ways: in the theme editor (appearance - editor) or manually in the theme file in the site folder on the server (hosting). I will consider the second way:

  1. Connect to the site via ftp client.
  2. Then open the directory wp-content-themes.
  3. Select the folder of your active theme.
  4. Open footer.php file.
  5. Add the generated code to the bottom of the file, behind the authorship display function.
  6. Save the file.
  7. Then you should open the site and check the correct display of the counter.
  8. If necessary, you can move the code, at your discretion, to the place in the basement where it is convenient for you to place it.

See the image below for an understanding of the whole picture.

Inserting an Analytics counter in WordPress.

Embedding Google Analytics HTML code into footer.php code.

Conclusion

Please note that at the moment you can implement Google Analytics using most plugins. Better use them or you can use Header and Footer Scripts. Right in it, you can add all the necessary HTML codes or scripts to your site at once on all pages. I hope this guide helped you, if you have any questions, please write them in the comments. Well, in the following posts, I will share with you information on how to create an XML and HTML sitemap, how to make robots.txt for WordPress, and how to protect information from copying on a WordPress site. We continue to study WordPress, there will be many more articles on this topic.

Reading this article:

Thanks for reading: SEO HELPER | NICOLA.TOP

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 291

No votes so far! Be the first to rate this post.

Читайте также:

Добавить комментарий

Your email address will not be published. Обязательные поля помечены *

three × 2 =