Google Analytics collects various information about visitors to your website. For example, this tool displays information about who visits the web, how often and for how long , demographics, and what end devices are used by site visitors..
This information can be useful in many areas. For example, with it you can personalize or create content marketing strategies by analyzing the most popular articles, pages, products or other content, as well as improve inbound marketing , better target audiences, optimize user experience and increase sales. conversion rates. This is why Google Analytics is the best standard tool to optimize the performance of your WordPress page in the long term.
Before integrating Google Analytics into WordPress, create a new Google Analytics account by clicking the button? Get started for free? on the main page of the Google Marketing Platform. After creating the account, you will find the tracking code created by Google for your website in the tracking section of the website. You can embed this code in WordPress later..
In this tutorial, we tell you how to use the tracking code to integrate Google Analytics in WordPress and what you should keep in mind in relation to data protection.
The easiest way to add Google Analytics to your website is with a plugin , since this way it is not necessary to edit the page code . There are several WordPress plugins available, which make it easy to integrate Google Analytics into WordPress. We recommend Jeff Starr's free GA Google Analytics plugin , with over 400,000 active installs and an average rating of 5 stars..
IONOS WordPress hosting is very simple: it offers a number of perfectly configured extensions to make your work easier, so you can start creating content on your new WordPress page right away.
After installing and activating the plugin , you must embed the Google Analytics tracking code obtained previously in the settings. Open the Google Analytics tab in your WordPress control panel, in? Settings ?. In the plugin settings , insert the tracking ID in the appropriate field . After inserting the code, scroll down and click the "Save changes" button. Google Analytics should now be active on your WordPress website.
If you don't want to use a plugin , you can embed the Google Analytics tracking code directly into the WordPress theme via the functions.php file . To manually enter the Google Analytics tracking code, it is important to use a child theme. This will prevent the tracking code from being overwritten with every WordPress theme update.
A WordPress child theme is a theme that inherits the functions of another main theme or template, called a parent theme (or mother theme).
To add the code to the WordPress website, go to the theme editor and find the header.php file. There the Google Analytics tracking code is inserted directly before the closing </head> tag in the editor .
Click on the button? Update file ?. Google Analytics tracking code has been added to WordPress.
Furthermore, there is the possibility to integrate Google Analytics into WordPress with the help of the Google Tag Manager.
Google Tag Manager is a tag management system that allows you to manage your website's tags and code instead of editing the code directly in WordPress . This reduces the risk and possibility of errors and allows editing without the need for development skills . To simplify installation, you can use Google Tag Manager as a WordPress plugin .
Download the plugin , install it and activate it . Create a Google Tag Manager account and a new container . Copy the container ID from the Google Tag Manager control panel by opening the? Administration? and looking for a string of characters beginning with? GTM ?. On the WordPress website , paste the Google Tag Manager ID into the corresponding field on the plugin's settings page , under? Settings ?, on the? Google Tag Manager ?.
The tag configured in Google Tag Manager now works on the WordPress website through the plugin .
According to the latest ECJ rulings, Google Analytics can no longer be used without the consent of visitors. Therefore, you should take some precautions to ensure the use of Google Analytics on your website while respecting privacy :
There are other tools to analyze the performance of your website. Some alternatives to Google Analytics give more importance, for example, to data protection.