Google Analytics allows you to closely monitor your site's traffic. It is a free service provided by Google. By creating an account and connecting it to your website, you can start to analyze traffic data in a comprehensive way. However, to track this data, you must insert a Google Analytics tracking code into your site....
Good news, the Divi theme allows you to do this easily and quickly without installing any additional plugins. Let's see how to do it....
- The usefulness of Google Analytics
- Why do you need to integrate a tracking code into your site?
- Create a Google Analytics account
- Get a Google Analytics tracking code
- Where to integrate the tracking code into Divi
- Verify that the tracking code is working
Advertisement: This article contains affiliate links that you will easily recognize. The classic links are in purple and sponsored links are in pink.
To get started with Divi, discover all the articles to start serenely!
1 - The usefulness of Google Analytics
Connecting your website to Google Analytics is not a requirement. However, Google provides us with a great tool that allows us to track the ROI (return on investment) of our site.
Why deprive yourself of it? That would be a shame!
The analysis of figures and statistics is rich in information. You will know which pages are the most visited, how many pages are visited by the same user, how much time is spent on the site and more!
The data from Google Analytics is very complete and will allow you to better plan your future marketing actions.
2 - Why do you need to integrate a tracking code inside your site?
The reason is quite simple, for security reasons, Google wants to make sure that you are the owner of the site whose data you want to track.
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 created yet, you can do it quickly at the following address.
- Click on "Start Free of Charge".
- You will be redirected to connect to your Google Account. If you don't have one, you can create it in this step.
- Click on "Register".
4 - Get your Google Analytics tracking code
- Choose "Site Web "
- Give a name to your account
- Give your site a name. For example, for example "My site".
- Enter the URL address of your site, without forgetting to choose the option http:// or https://
- Define the sectoral theme of your site among the proposals,
- Choose the time zone according to the country
- Click on "Get a tracking ID"
- Accept the general terms and conditions of use.
You will then be directed to the page dedicated to your property.
All you have to do is copy the Google Analytics tracking code in the dedicated field. Be sure to copy the entire code without forgetting anything.
The tracking code of Google Analytics looks like the one below:
< ! -- 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 || ;
gtag('js', new Date());
< / script >
Did you know that you can test Divi for free? Go to this page and click on "TRY IT FOR FREE"
5 - Where to integrate the tracking code into Divi
Once you have copied the code obtained in the previous step, go to the administration of your site, to the tab : Divi > Theme option > Integration
Read this article to understand all the settings of 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 BODY section
It is in one of the two fields that you can paste your Google Analytics tracking code. Google recommends pasting it in the HEAD section (tablet 2), while Divi suggests pasting it in the BODY section (tablet 3). Both work: choose one of them. Remember to save your changes before leaving.
6 - Verify that the tracking code is working
To make sure that the Google Analytics tracking code has been taken into account, I advise you to browse your site as a normal user would and view your Google Analytics account numbers in parallel. You should see real-time views appear: yours (at least).
Need more resources on Divi? Visit ElegantThemes' blog full of ideas and tutorials!