Integrating Google Analytics to your WordPress Website

Statistics and metrics are important for any project, from a small blog to large and complex sites. It is a fact that knowing your audience and what most pleases is something very important for a project to be successful. For this, we need to use tools such as Crazy Egg, Hotjar, Google Analytics, among others.

Ranked as one of the most robust free tools, Google Analytics is the darling among the data analysis tools of blogging sites and audiences around the world. Easy integration, you can add it to any site without much effort.
If you are the one who want to know whom your site / blog is targeted, it is worthwhile to see how to integrate it with the GA in a simple and practical way.

Getting tracking tag for GA?

The tracking tag can be achieved through the Google Tag Manager, product available for managing tags of all Google products.

Setting up Google Analytics with Google-Tag-ManagerUsing Google Tag Manager to generate the GA tag

Integrating with Google Analytics without using plugins

If you have no preference for the use of plugins to make this integration, I suggest to you to insert the Google Analytics code in the header.php theme file that is used in your project.

This can be done via admin panel (Appearance> Editor) or by FTP access / SSH of your project. (Note: remember to save a copy of the file if you need to go back to the previous version).

User's Guide for All in One SEO Pack Google-Tag-Manager-codeheader.php file being edited via admin panel

Plugins to insert Google Analytics code in your project

We can cite some very interesting plugins and facilitate the integration of project with GA.

Header and Footer

The Header and Footer plugin allows the inclusion of code via admin panel. Settings> Header and Footer, there is a very intuitive division where you can enter any code in your project.

Google Analytics by Yoast

The same company that developed one of the SEO plugins used on most of the sites, the Google Analytics by Yoast allows to manually enter the code or connect with your account at GA automatically. Some advanced settings that are permitted in order to increase the data that is collected.

User's Guide for All in One SEO Pack google-analytics-by-yoastGA code setting via Google Analytics by Yoast

All in One SEO Pack

Even as a plugin integrated for SEO strategies, the All in One SEO Pack supports the insertion of the GA code. You just need to manually enter the UA code so that it can appear on your site.

User's Guide for All-in-One-SEO-Pack-Google-Analytics-SettingField for manual configuration of the GA code in the plugin All in One SEO Pack

Other plugins ideas:

  • Google Analytics Dashboard for WP
  • BestWebSoft Analytics
  • Google Analyticator

So have you already set up Google Analytics code in your project?