Set up Google Analytics on your website

Basics: Set up Google Analytics on your website

If you are setting up your first website, one of the basic things which must be done is to install Google analytics script on your website. Google Analytics is a power tool that will do more than you can think of. Here are some stats that you will see when you start with Google Analytics:

  • Audience overview including new users, sessions, bounce rate etc
  • Visitor acquisition, channels, sources etc
  • Website behavior- page views, site speed etc
  • Conversions- product performance, goals etc

There are two ways to set up Analytics in your account:

  1. Manually upload Analytics code
  2. Use Google Tag Manager

Manually upload Google Analytics Code:

Step 1:

Head over to and sign up for account. Fill the required information.

Select get tracking ID and you will be redirected to your own analytics account!

Step 2:

You will see Global Site Tag (gtag.js). Copy the code and give it to your developer to implement in the <head> of every webpage. In case you forget this code, or accidently close the browser, you can just go to Analytics>Admin (gear icon on left panel)>Property>Tracking Info>Tracking Code to access the script again.

Step 3:

Once your developer has implemented the code, it is time to check whether code is working correctly or not. You need Chrome browser and an extension called tag assistant. Download the extension, go to your website (any random page) and click on the tag assistant icon and enable it. Refresh or reload the page to see results from tag assistant. Your Google Analytics tag will appear in the tag assistant.

Use Google Tag Manager

Step 1:

Head over to, and create a new account. Fill in the info and contained name. See screenshot below.

Step 2:

Once your account is created, you will be redirected to Google Tag Manager (GTM) interface where you will see script for GTM. Give it to your developer to install it at your website global head tag. In case you lose this tag, you can always find it at Admin>Container>Install Google Tag Manager.

Step 3:

Once your GTM is set up.

Create a new Tag; choose tag type Google Analytics- Universal Analytics from dropdown. Choose track type as page view so that every page view is counted in analytics data. In the Google Analytics settings, choose a new variable, give the variable a name and put the tracking id from Step 3 and save this variable.

The firing trigger should be set to all pages. Click on the “Save” button on top right corner.

Step 4:

You will be directed to default workspace. To check whether tag implementation has been correct, click on preview. Open a new tab and go to your website. A tag manager window will open up simultaneously which will show Google Analytics tag has been fired one time. This will verify that your set up is correct and you are ready to go. Go back to Tag Manager window and push the changes live.

 Which option to choose for implementation?

There will be no difference in data from Google Analytics.  The advantage with GTM is once you get through implementation, most of other tag implementations can easily be sorted and done via GTM instead of manually inserting code every time.