How to setup Google Analytics for your website

Setup Google Analytics featured

What is Google Analytics

Before we setup Google Analytics, let us understand what is Google Analytics and why do you need it.

Google Analytics is a free web analytics tool provided by Google to help you analyze your website traffic. Web data are collected daily and the dashboard will have information such as

  • Which pages on your website are the most popular?
  • Where do your visitors come from?
  • How many people visit your website?
  • and so on

Once you have an understanding of these data, you can make a better decision on how to improve your website traffic. (this will be in another article)


How does Google Analytics work?

During the setup process, a set of code is generated, you or your web designer/developer will have to add the code into every page of your website. Every time a user visits your website, the code will be triggered and it will log in Google Analytics. To get more accurate data of the day, check it the next day than using real-time data.


How to setup Google Analytics

If you have a Google account like Gmail, you can easily create a Google Analytics account just by signing in. If you do not have a Google account, simply create one.


Step by step guide to creating your Google Analytic account

  1. Go to Google Analytics website 
  2. Login using your Gmail account
    Setup Google Analytics - 1
  3. After which it will bring you to the Analytics setup page. Click on the “Sign up” button on the right
    Setup Google Analytics 2
  4. Now fill up all the field
    – Select Website
    – Give a name for this account
    – What is the name of your website
    – Your website URL
    – Select an industry category from the dropdown list
    – Select the reporting time zone from the dropdown listScroll down to the bottom and click “Get Tracking ID”Setup Google Analytics - 3
  5.  A pop-up terms of service agreement appear
    – Select your country/region
    – Check the Data Processing Terms and the Measurement Controller-Controller Data Protection TermsScroll down and click on the “I Accept” buttonSetup Google Analytics - 4
  6. Once done, it will redirect you to the admin page of your newly created account.
    From there you will see a set of code, copy the code and add it into the header section of every single page of your site.
    Setup Google Analytics 5


How and where do you add the code to your website?

Example your html code is as follow, copy the code provided by Google Analytics and add it before the end of the </head> tag.

<!DOCTYPE html>
<meta charset=”UTF-8″>
<title>Title of the document</title>

<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”″></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-142542214-1’);

Content of the document……

I hope you now know how to set up your first Google Analytics code to your website. In the next post, I will show you the different dimension and metrics from Google Analytics report and how to read them.


facebook icon twitter icon linkedin icon what app icon