How to Add Google Analytics to Joomla 4

Google analytics is a free service to analyze the audience of your website. A large part of the administrators of the websites use it. It is a very powerful tool that collects user data to identify them and analyze their behaviors in order to better understand your users and adapt your strategy in return. This tool will help you a lot in improving your SEO. We will see in this tutorial how to add Google Analytics with Joomla 4.

You must at first create a Google Analytic account, then log in to your account and find a code similar to the one in the screenshot below.

Exemple du code de Google analytics

You can found it in the Administration > Tracking Information > Tracking Code section.

Copy this code and continue on the back-end of your site to copy it to your file, via System > Site templates > Your Template. In your index.php file, place your code in the first position just below like this : 

Code Google analytics placé juste après l'ouverture de la balise head dans le fichier index.php du template tag.

The results are not immediate, it will be necessary to wait about a day before having your first statistics.

شارك الموضوع

مواضيع ذات صلة