Do you know how many website visitors you are getting and which pages they are viewing?
Google Analytics is a free website analytics tool provided by Google that tracks and reports your website user activity. It will give you data on which pages the users visit most, their session duration, overall bounce rate, and much more.
If you are using Divi, you can easily add Google Analytics to your site without using any third-party plugins.
The guide below is a step-by-step tutorial on adding Google Analytics to Divi without using plugins. But first, here is a quick look at the various benefits of adding Google Analytics to Divi or any WordPress site in general.
Why should you add Google Analytics to your Divi website?
Adding Google Analytics to your Divi website will give you access to tons of useful data and user insights. Here’s a list of ways in which you can use this data to better your website’s performance.
- Know your traffic source: Know where visitors are coming to your website. You will get a detailed overview of how many users are coming from search engines, social network sites, paid advertisements, etc. It will also tell you which countries your visitors belong to.
- What are your visitors looking for: Get detailed insight on what users do on your website from the moment they land on it. This includes which pages they visit, what links they open, which files they download, and much more.
- Make your site easier to navigate: By knowing where your visitors are coming from, which device they are using, what links they are clicking, and how long they stay on your website, you can get an idea of what they might be looking for. This can help you improve your site’s navigation and the overall UI/UX of your website.
- Create relevant content: Like before, by understanding what your visitors are looking for. You can create targeted content that will help you attract and engage even more users on your website.
- Understand your conversions and sales figures: eCommerce store owners can utilize Google Analytics information to get an idea of their conversion rates and track how much revenue they are generating from their e-store.
Now that you have an idea of why you should add Google Analytics to Divi let’s talk about the how.
How to add Google Analytics to your Divi website
There are two main ways in which you can add Google Analytics to your WordPress website. You can either use a plugin or manually add the Google Analytics tracking code to your WordPress site’s source code. The second option can be intimidating for some users, which is why they prefer using a plugin. However, having too many plugins on your website isn’t ideal.
Thankfully, with Divi, adding the Google Analytics tracking code is as simple as copy-pasting to a designated field in the Theme Options area. This makes it possible for you to add Google Analytics without restoring to bulky third-party plugins.
Now, that being said, you still need to get your hands on the Google Analytics tracking code before adding it to your website. And for that, here’s a step-by-step guide to help you out.
Step 1: Create a Google Analytics account
The first thing you need to do is create a new Google Analytics account.
To do this, log in to your Google Account. This account will be linked to your Google Analytics. Next, head on to the Google Analytics Homepage and click on the “Start Measuring” button.
This will take you to the account setup form. Set a name for your Google Analytics account. For the sake of this tutorial, we will set it as “Demo Tracker.” Next, select which data sharing options you want to enable/disable.
Once done, click on the Next button.
Step 2: Create a Google Analytics Property for your website
A Google Analytics Property is used to present a business’s web data and/or app data. The Google Analytics account you just created can contain one or more (max 100) Properties pointing to your different websites and/or apps.
For this tutorial, we are creating a new Property to add to our Divi website.
To do this, first, we need to provide a Property name. We are going to call it “Demo Website.”
Next, we will need to specify the reporting time zone and currency. You can also change these details later on if you need to.
After providing the Property details, click on the Next button. In the next section, you will need to specify information about your business.
Step 3: Fill out the Business Information form
To complete your Google Analytics account creation, you will need to fill out this final Business Information form.
Note: The information you provide here is specific to the Property you just created and not your entire Google Analytics account. So in our case, this form is for “Demo Website” and not “Demo Tracker.” Later, if you create another Property, you will need to fill out another business information form for it as well.
In the form, you will need to provide your industry category from a drop-down list. Choose the one that most closely presents your business.
Next, specify how many employees work with you in your business.
And finally, tick all the ways you intend on using Google Analytics for your business.
After completing the form, click the Create button. And that’s it. You have successfully created your new Google Analytics account with a new Property for your website.
Step 4: Set up your Data Stream Platform
After completing the Google Analytics account setup, you’ll get dropped into the Google Analytics dashboard. Once you are here, you will set up a data stream to start collecting data.
Now, in case you are wondering, a “data stream” is just a fancy term representing the flow of data from the customer touchpoint to Google Analytics. In this case, it’s asking you where the customer touchpoint is – website, android app, or iOS app. In our case, it’s a website, so we select the “Web” platform.
This will bring up a new section where we will need to provide additional information like website URL, website name, and what metrics we wish to measure.
As you can see, by default, we are opting in to measure 6 different user metrics. However, this can be easily enabled/disabled by clicking on the gear icon.
After setting up the data stream, click on Create Stream.
Step 5: Get your Measurement ID and Google site tag
After setting up your new data stream, you will get a screen giving you a glance at your Measurement ID and Google site tag, among other details.
The Measurement ID is used to identify web traffic or data stream that is sending data to your Google Analytics Property.
The Google site tag is used to start fetching data from Properties designed using websites builders or CMS-hosted sites like WordPress.
Now to see your Google site tag, just click on the arrow button to expand it.
As you can see, it gives you a short code snippet with the Measurement ID attached.
From here, you need to copy this code. Next, we will add it to our Divi website.
Step 6: Add Google site tag to your Divi website
After copying the Google site tag, head on over to your WordPress website’s backend dashboard. From there, navigate to Divi > Theme Options. Under the Integration tab, you will find a field for adding the “tracking codes such as Google Analytics.”
Simply paste the code here, scroll down, and hit “Save Changes.”
And that’s it. You have successfully added Google Analytics to your Divi website. Now all that remains to do is to test if it works.
Step 7: Test Whether Google Analytics Works
To ensure everything is working correctly, head back to your Google Analytics dashboard.
Now, using the left-hand sidebar, navigate to the Reports section. From here, you should be able to see all user statistics on your website, including real-time data.
Wrapping Up
And that brings us to the end of our quick tutorial on how to add Google Analytics to Divi. As you can see, Divi makes it super easy to add the Google Analytics tracker on your WordPress website without using any additional plugin. If you have added an SEO plugin to Divi and performed on-site SEO then you need to know how successful your work is.
The main effort on your part is to create a new Google Analytics account and get the site tag. But that’s something you would need to do even if you were using a third-party plugin.
Now, all things considered, there are a couple of things you should keep in mind if you use this method.
First, your Google Analytics tracker is attached to your Divi theme. So if you were to change your Divi theme in the future, even with the Elegant theme’s own Extra theme, then the tracking code will get removed.
Also, to access the user data, you need to log in to your Google Analytics dashboard, and there’s no option to view it from your WordPress backend.
We actually have trouble on some Divi sites when we add the G-code instead of the old UA code. I am not sure why, but when we add it to the body, it doesn’t always transmit data. But when we add it to the head, it does. Any ideas why?
I agree, why are we adding it to the body if even Google states to add it to the header ?
thank you so much, really usefull article, worked like a brease
youre welcome. im always amazed at how many people are not looking at their website data. it really shows what is working and what is not and what needs improving.
Hi Craig, my client has sent me a different tracking code for each page. Is it possible to add a different code to each individual page (and does it make sense at all)? I’m not sure what the purpose is as I thought a global tag would provide the same function. Thanks so much.
You can add to each page but i cant think of any reason do this. I would ask them why.