How to install Google Analytics on Wordpress?
Have you heard of Google Analytics and have been told you need to install it on your Wordpress website ? You are in the right place !
Knowing how your audience interacts on your website is
important to understand your Internet users, analyze and make the necessary
correction to improve your performance. The large amount of data collected is
the best way to know your audience. In this sense, Google Analytics gives them
back to you for free.
In this article, we will see togethers why Analytics is an
essential tool for your website and how to installs it on your Wordpress site ,
step by step.

Why use Google Analytics on your website?
When you said to yourself that you were going to create your
website , whether it was to run a business blog , present your company or even
get into e-commerce, your number 1 goal was certainly to attract traffic to it.
Google Analytics will allow you to collect information on
Internet users coming to your various pages. This collection enables analysis
tools to better identify Internet users and their interests in order to offer
them ever more consistent and personalized content.
Google Analytics is an extreme powerful tool that allows you
to analyze a large amount of information relating to the activity on your
website. This solution is offered by Google free of charge without the need to
pay entry or user fees afterwards.
A. Know who is visiting your website?
The tool will allow you to identify the behavior of your
Internet users. You will be able to have information relating to:
• their
geolocation
• their
frequency of visit
• distribution
by gender, age, ...
• their use
and the medium they use to visit you: mobile, tablet or even computer.
All this information is important to determine the content,
design, and frequency of publication of your posts.
Your website remain the core of your digital presence. As a
result, your site is in the best position to collect as much information as
possible on the behavior of Internet users, in order to allow you to judge the
effectiveness of the campaigns you launch to promote your products or services
online. This tool will help you analyze the results of your digital marketing
strategy .
B. What are they doing on your site?
It's easy to see which pages are performing well, thanks to
the number of page views, but also the time spent on each page, the number of
page views per session (per visit if you prefer) or the bounce rate.
All of this information will help you understand what works
, and what you need to fix. So you will be able to find out which articles work
best and explore these topics in depth.
C. When do they visit your site?
Knowing the frequency and peak time of visits to your site
is crucial to knowing when to publish your article, offer, operation ...
Google Analytics allows you to easily configure this kind of
report. We just explain how to do it in this article: Know the best time to post thanks to Google
Analytics .
D. Where do your Internet users come from?
Finally, you can find out how they got to your site. Google
Analytics will distinguish between sources, ie through which channel the
Internet user arrived.
Find out how to analyze and measure incoming traffic to your
website: How to measure the performance of your marketing campaign on Google
Analytics?
How to sign up for Google Analytics?
Step 1 : Sign up for Google Analytics
First of all, you have to registers on the platform and
create an account . For this you need a Google account or a Gmail account. If
you already have one you use it and
register with it. If not, it will be necessary to create one.
After your Google registration, you arrive on this page
which invites you to register for Google Analytics. This is where you will logs
in each time with your Gmail address to access Analytics.
Step 2 : Selection of the website.
At this step, you will choose whether you want to choose a
monitoring of your website or your mobile application.
Then you just have to configure the name of the account (it
is recommended not to put the name of the website with the www). For the
website URL, if it is secure (HTTPS), change the selection. Be sure to select
the sectoral category of your website. It will allow you to be registered and
compared by sites in the same industry.
Finally, complete the time zone .
Once all of this information has been saved, click on
Receive Tracking Code ID and you will be presented with all of the Google
Analytics terms of service that you must agree to to continue.
Step 3 : Here is
the tracking code for your Analytics account. Copy it, we will now install it
on your Wordpress site.
These 4 steps work for creating any Google Analytics
account, regardless of the type of website. The following steps will be
specific to Wordpress.
How to install Google Analytics on a Wordpress site?
There are different ways to implement the Analytics tracking
code:
1. By using
a plugin (option 1 recommended if you are not yet familiar with the Wordpress
interface and their functionalities)
2. By adding
a tracking script directly to the header.php file
3. Or by
creating a new function in the functions.php file.
Today I will tell you about the first and the second
solution. The third requires coding knowledge.
OPTION 1: Use of a Plugin
Among the different plugins (also called extensions)
available to connect your Google Analytics tracking, a certain number are free.
Here are four equally efficient ones.
All you needs to do is add your Google Analyltics ID which
begins with: “UA-” followed by a number.
We will focus on the first one with more than 1 million
installations activated.
Step 1: Add the Plugin
To downloads it, you can install it by going to your
Wordpress dashboard. There you will find the extension, click Add and search
for Google Analytics Dashboard .
Step 2: Install and link the plugin
The second step is to click on “Install the application” (by
clicking on Install as the name suggests).
Now you will have to link your Google Analytics Account to
the Plugin . To do this, in the menu on the left of your Wordpress, click on
Google Analytics> General plugin settings and click on “Authorize the
extension”.
By authorizing the extension it will offer you to “Obtain
the access code”.
Select the Google accounts you want to link and on which you
created your Google Analytics account:
Next, authorize the Google Analytics plugin to access your
account data:
Final step : Access code
Google will give you a long piece of code, you just have to
copy and paste it in the plugin settings, in the field entitled "Access
code".
There you have it, your wordpress site is now linked to the
Analytics tool. Wait 24 hours to start seeing the first statistics, in
particular the sessions, go up on your Analytics page. The first analyzes are
yours!
OPTION 2: Insertion of the code in header.php
As I mentioned above, there are several way to integrate
Google Analytics code into a WordPress blog. For example, the code can be
included in your theme's header.php file. This manipulation is more advanced,
for those who have better knowledge of Wordpress.
1. Go to the
WordPress admins area and go to Appearance -> Editor
2. Open
header.php for editing.
3. Insert
the Analytics tracking code “UA-XXXXX”, which you acquired in step 4 in Google
Analytics, before the </head> tag and and press the Update file button.
Please note: the Analytics code will only be inserted on
your active theme. You will have to add it agains if you change the theme.
Here are the two installation options to install Google
Analytics on your Wordpress site. There is a third one, less used and that we
will not discuss in this tutorial, namely the creation of a new function in the
functions.php file. This method, which is more for Webmasters, requires
extensive coding knowledge and we recommend that you use it only if you are
sure what you are doing.
If you want to make
your Wordpress website a prospecting machine, see our article How will your
website generate business?