Google Analytics

What is it?

Google analytics helps you see the traffic on your webpage. You can track how many people are visiting your site, where they are visiting from and which of the pages are the most popular. This will help influence business decisions when updating your website.

How to set it up

  • Go here to open the developer dashboard for analytics.
  • If you have multiple analytics set up, you can switch between them from the name towards the top left.
  • To add a new website, you will need to create a new property.
  • Click of the settings/admin button on the bottom left.
  • Click the blue + Create button and select a new property.
  • Fill in a name for your property.
  • Select the industry and number of employees.
  • Select some of your objectives from the list.
  • Then select whether your project is a website or an app.
  • Then enter your base website URL to focus on the whole site. In some niche cases you may want to enter a longer URL to focus on, for example, just an information page on your website.
  • Enter a Stream Name, this is just a label for the data stream to help identify it.
  • Click Create and Continue
  • Then copy the Google tag and place it at the bottom of your head element
  • To make any changes, go to settings/admin -> property settings -> data collection and modification -> data streams. Here you can e.g. update the URL.

Example google tag:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'G-XXXXXXX');
</script>