Google Analytics

We use Google Analytics for all our websites, typically this is a request from our clients, however, this is not always a requirement and fairly often access is requested after launch. Google Analytics tracks lots of metrics for websites and helps us understand user behaviour and experience - it is therefore an important tool for all websites.

Creating a hostname filter

Filters are used by Views to show the data in manageable groups, which can be used to include specific sets of traffic and exclude unwanted data.

  1. Visit Admin > View > Filters and create a new filter
  2. Choose the Custom option, then select "Include" with field "Hostname"
  3. You can verify that the filter is working if there is data already

Setting a goal

There are many types of goals. To reduce bounce rates when a single page visit is expected:

ga("send","pageview"),setTimeout("ga('send','event','Profitable Engagement','Time on page more than 2 minutes')",12e4);

Google Analytics and GDPR

In almost all cases, after 25th May 2018, Google Analytics will now need to be enabled on an opt-in basis. Giving website users control over the cookies that is stored on their browser.