Support Home > Help Guides > Search Engine Optimisation > How to add Google Analytics to your website

How to add Google Analytics to your website

Google Analytics tells you how many people visit your website, which pages they read and where they came from, which is far better ground for decisions than guesswork. Adding it to a Hubb site means placing Google’s tracking code into your design templates.

Adding the tracking code

This involves editing your live design templates

The tracking code goes in the head of your design templates, which control how your whole website displays to visitors, and it must be added to every template in use. A mistake here can affect how the site looks or works, so go carefully; if you’d rather not touch the templates yourself, raise a ticket via the contact form below and our UK team will be happy to help.

  1. Sign up for a free Google Analytics account and add your website to it.
  2. During setup, Google gives you a snippet of tracking code (the ‘Google tag’, a short script beginning with googletagmanager.com) to install on every page you want to track. Copy it.
  3. In your web office, open your design template and paste the code into the Head Contents section, then save. Repeat for every template your site uses; a template without the code is a blind spot in your statistics.
  4. Google also needs to verify that you own the domain. Of the methods Google offers, we recommend the HTML tag method for Hubb sites: Google gives you a small meta tag, which goes into the same Head Contents area of your template.
  5. Give it time: Google usually starts receiving data around 48 hours after installation, and reports update much faster from then on.

Good to know

  • Adding analytics changes your cookies position. The cookies a Hubb site sets by itself are essential to running the site, so no consent banner is needed, but Google Analytics uses tracking cookies, and those do need covering. As a minimum, add Google’s analytics cookies to your cookies policy, which lives under Site Settings > Users > Cookies Policy; Google publishes the current list of cookies its analytics sets.
  • Technically confident users can keep the main snippet in a shared script file used across templates, but the loading line still has to sit in each template’s head.
  • Analytics tells you what’s working; if the numbers show people aren’t finding you in the first place, start with a sitemap and good page titles.

Still stuck? We’re real people.

Raise a support ticket and our UK team will get back to you.

Contact support