Image for How to add Google Analytics and Webmaster tools to your site

Google Analytics (GA) and Google's Webmaster Tools (GWT) are tracking tools to monitor your website and your visitors.

To connect Google Analytics or Webmaster tools to your side you need to include a script before the closing head tag. Use GA to monitor the visitor's behaviour such as total visits, unique visitors, page visit duration and much more. Use GWT to monitor keywords, submit sitemaps and detect indexing issues with your site

What are they used for?

Google Analytics

Google Analytics or GA it's most common use case is monitor your site's traffic. Traffic being the amount of total page visits, unique visits, type of devices and much more.

You can also track how people get in touch with site (Via Google search, directly or social media).

Google Webmaster tools

Google Webmaster tools or GWT, also named Search Console is a tool to monitor the health of your website by keeping track of search terms, crawlissues and much more.

Search Console overview

This is a graph that represents a website of mine, you can see over a period of time the amount of clicks, visits, click-through-rate and position the website has. But you can also see this foreach keyword, which is very handy!

Let Google know your site exists by submitting it to the search engines, preferably with a sitemap! You can see how many pages are indexed and why they're not.

The fetch as Google option also verifies your is in good condition to getting crawled by Google. You can also submit the result and request indexing.

How to add GA and WMT to your site

Let's start with GA, as it's way easier to add WMT afterwards.

Google Analytics

You should first add a GA property to your GA account, a form will open which requests the site name, url, category and timezone.

After creation, you'll receive a tracking code similar to this:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="<YOUR-ID>"></script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '<YOUR-ID>');

Add this code before the close </head> tag.

Back to GA to verify this script and voila! GA is setup.

Webmaster tools Since your GA account and your webmaster tools account are the same thing, it's really easy to sync those up.

Add a property and add it's url, preferabbly https://www and rewrite all your links to this one, if you do not do this you should add every extension you can think of.

When added, you'll have to verify your website. Since you already have GA installed you can use the same code by choosing the "Verify with GA" option (usually the default)".

You're all set!

Starting adding your sitemap to the GWT and have fun experimenting.

Interested in more articles about Tools?

  • Monitor your users clicking, scrolling and live interaction with hotjar

    Dec 06 2018

    Track clicks, movement and watch live recordings with Hotjar. Even make funnels to test your conversion and see why people left your form. Continue to the article for the Hotjar integration and more i...

  • Thumbnail for git setup and workflow

    Git setup and workflow

    Dec 06 2018

    Git is an Open Source version control system (VCS). Developed by Mr. Linux himself to improve the workflow of managing code while collaborating as a team.

  • Thumbnail for how to deploy from gitlab ci

    How to deploy from Gitlab CI

    Dec 06 2018

    Gitlab CI is a built-in continuous integration tool from Gitlab, in this tutorial, we will explain how to setup auto-deploy for any kind of system