Google Analytics allows you to monitor your site traffic closely. It is a free service made available by Google. By creating an account and connecting it to your website, you can start to analyze traffic data thoroughly. Only, here, to follow these data, you must insert a Google Analytics tracking code into your site...
Good news, the theme Divi allows you to do this easily and quickly without installing additional plugins. Let's see how...
- Usefulness of Google Analytics
- Why do you need to integrate a tracking code inside your site?
- Create a Google Analytics account
- Get Google Analytics tracking code
- Where to integrate the tracking code in Divi
- Check that the tracking code works
To start with Divi, discover all the articles to start calmly!
1 – Usefulness of Google Analytics
Connect your website to Google Analytics is not an obligation. However, Google provides us with a great tool that allows us to track ROI (return on investment) on our site.
What do you want to lose it for? That would be a shame!
The analysis of figures and statistics is rich in information. You will know which pages are most visited, how many pages are visited by the same internet user, what is the time spent on the site and more!
Google Analytics data is very comprehensive and will allow you to better consider your future marketing actions.
2 - Why do you need to integrate a tracking code inside your site?
The reason is simple, for a security issue, Google wants to make sure that you are the owner of the site you want to track the data from.
To prove that this is the case, you must have access to the administration part of your site.
By inserting this code, Google will be able to read it. This validates your property and allows Google to start recording visits.
Fortunately Google checks that you are the owner of the site, otherwise, anyone could follow the statistics of any site!
3 – Create a Google Analytics account
If you don't have a Google Analytics account yet, you can do it quickly at Next address.

- Click "Start Free".
- You will be redirected to connect to your Google Account. If you don't have one, you can create it during this step.
- Click "Register"
4 – Get your Google Analytics tracking code

- Choose « Websiten»
- Give your account a name
- Give your site a namen. For example "My site".
- Enter the URL address of your site, not forgetting to choose the option http:// or https://
- Define the sectoral theme of your site among the proposals,n
- Choose the time zone according to the country
- Click "Get a tracking ID"
- Accept the general conditions of use.
You will then be directed to the page dedicated to your property.

You'll only have to copy Google Analytics tracking code present in the dedicated field. Be careful to copy the entire code without forgetting anything.
Google Analytics tracking code looks like the following:
< ! -- Global site tag (gtag.js) - Google Analytics -- >
< script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X »>< / script >
< script >
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXX-X’);
< / script >
Do you know you can test Divi for free? See you on this page and click on "TRY IT FOR FREE"
5 - Where to integrate the tracking code in Divi
Once you have copied the code obtained in the previous step, go to the administration of your site, tab: Divi > Theme option > Integration
Read this article to understand all the settings in the "Integration" tab of Divi.

- Check that all buttons are enabled
- The first window corresponds to the HEAD section of your site
- The second window corresponds to the section BODY
It is in one of the two fields that you can paste your Google Analytics tracking code. Google advises to stick it in the HEAD section (pastille 2), while Divi proposes to paste it in the BODY section (pastille 3). Both work: choose one of the two. Remember to save your changes before you leave.
6 - Check that the tracking code works

To make sure that Google Analytics tracking code has been taken into account, I advise you to browse your site as an Internet user lambda would and to view in parallel the numbers of your Google Analytics account. You should see real-time views: yours (at least).
Need more resources on Divi? Visit ElegantThemes blog full of ideas and tutos!


Merci, c’est très clair !
Merci à toi Maité 😉
Bonjour,
Je découvre Divi et inévitablement je suis à la recherche de divers trucs et astuces pour mettre en route un nouveau site.
Curieusement je me retrouve souvent sur « Astuces-Divi »
Merci pour le boulot.
Merci Patrick 😉
Merci !! super bien rédigé !
Merci pour cet article !
Salut Lycia.
Article toujours très intéressant comme toujours!
Mais désormais on n’a plus la partie Code de suivi dans Analytics, plus de gtag.js…
MErci !
Salut Pat ! Oui en effet je vais mettre l’article à jour
Pas de soucis merci pour tes tutos toujours précieux !
Bonjour Lycia et merci pour tous vos contenus, si précieux ! J’ai une question par rapport à l’installation de Google Analytics. J’ai installé une extension : site kit, pour suivre mes visites. Pendant la procédure, il m’a été demandé de valider qu’il s’agit bien de ma propriété. Ensuite, tout semblait relié à mon tableau de bord sur Google Analytics… Mais j’ai reçu un mail indiquant que je dois ajouter ce code sur toutes les pages… Dois-je quand même le faire comme expliqué dans votre article ? Merci par avance pour votre aide.
Bonjour Quartero. Eh bien, je pense que c’est Site Kit qui s’occupe de la balise ? Il vous dispense de mettre le code via une autre solution ? Enfin je crois, car j’ai jamais essayé Site Kit et je n’utilise plus Google Analytics.
Bonjour Lycia, merci pour cette réponse ! Tara Quartero
Bonjour Lycia, déjà un grand merci pour vos ressources ! En commentaire vous dîtes ne plus utiliser Google Analytics. Quelles solutions recommandez-vous actuellement à la place ?
Salut Hugues. Tu peux mettre l’extension Burst qui est RGPD compliance mais tu auras des statistiques très sommaires. Sinon JetPack mais quid du RGPD puisque c’est américain aussi…