Skip to content

Commit

Permalink
Merge pull request #163 from alphagov/Fixing-typos-and-adding-a-littl…
Browse files Browse the repository at this point in the history
…e-to-the-'Find-in-GA4-page'

Fixing typos and adding a little SQL to the 'Find things' page
  • Loading branch information
annecremin authored Apr 3, 2024
2 parents 88974da + f510463 commit 50631c7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 28 deletions.
41 changes: 30 additions & 11 deletions source/analysis/govuk-ga4/find-in-ga4/index.html.md.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Find things in the GOV.UK GA4 data
weight: 3
last_reviewed_on: 2024-03-27
last_reviewed_on: 2024-04-03
review_in: 6 months
---

# Use the GOV.UK GA4 data
# Find things in the GOV.UK GA4 data
<span style="color:red">This page is a work in progress.</span>

Google Analytics 4 (GA4) is used to collect data on the usage of GOV.UK.
Expand All @@ -15,8 +15,6 @@ This page provides some guidance on how to find commonly requested information i

More information on the data source itself can be found on the [GOV.UK GA4 data source page](/data-sources/ga/ga4/).

Currently, the methods in this document are written to help people using explorations in GA4, but similar steps can also be used in Looker Studio.


## Page views

Expand All @@ -32,9 +30,9 @@ However, the definition of a session has changed in GA4, so the figures produced

We recommend using ‘page path’ over the ‘page location’ dimension as ‘page location’ is compatible with fewer other dimensions.

The ‘page path’ is the part of the URL after the hostname (not including any query strings) of a page -
The ‘page path’ is the part of the URL after the hostname (not including any query strings) of a page.

#### Method - using the views metric
#### Method - using the views metric in an exploration

Steps:

Expand All @@ -46,6 +44,27 @@ Remember to check the [data quality icons](https://support.google.com/analytics/

For an example in Looker Studio, see the ‘Top pages’ table in [this sample Looker Studio report](https://lookerstudio.google.com/reporting/d8cdf584-8cc8-4b77-bbef-1d51ed6f66ea/page/gbJuC).


#### Method in BigQuery

The following SQL gets a count of page views for the 1st January 2024 from the flattened GOV.UK GA4 dataset
```
#Get a count of page views for the 1st January 2024 from the flattened GOV.UK GA4 dataset
SELECT
event_date,
COUNT(*) AS pageviews,
FROM
`ga4-analytics-352613.flattened_dataset.flattened_daily_ga_data_*`
WHERE
_TABLE_SUFFIX BETWEEN '20240101'
AND '20240101'
#Filter to just page_view events
AND event_name = 'page_view'
GROUP BY
event_date
```


## Navigation (link clicks)

Link clicks are now tracked as events with the event name ‘navigation’.
Expand All @@ -57,7 +76,7 @@ These events should all have dimensions such as the ‘Link URL’, ‘Link text

### External link clicks on a given page

#### Method
#### Method in an exploration

Steps:

Expand All @@ -76,7 +95,7 @@ File downloads will have the event name ‘file_download’.

### File downloads on a given page

#### Method
#### Method in an exploration

Steps:

Expand All @@ -93,7 +112,7 @@ A basic exploration containing search terms used on GOV.UK can be [found here](h

There are a couple of different ways that this can be done with the GA4 data.

#### Method one - using the search event
#### Method one - using the search event in an exploration

Steps:

Expand All @@ -106,7 +125,7 @@ This should give you a table showing the search terms used from your given page

For an example in Looker Studio, see the ‘Top searches from these pages’ table in [this sample Looker Studio report](https://lookerstudio.google.com/reporting/d8cdf584-8cc8-4b77-bbef-1d51ed6f66ea/page/p_ot3jtudu9c).

#### Method two - using the view_item_list (search results) event
#### Method two - using the view_item_list (search results) event in an exploration

Steps:

Expand Down Expand Up @@ -134,7 +153,7 @@ It is important to note that the bounce rate can only be used when reporting on
Do not use the bounce rate metric with more general page dimensions (such as ‘Page path and screen class’, ‘Page path + query string’, ‘Page location’ and so on).
Although GA does not prevent you from adding bounce rate to such reports, the figures reported will not be accurate!

#### Method
#### Method in an exploration

Steps:

Expand Down
13 changes: 6 additions & 7 deletions source/processes/ga-access/index.html.md.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
---
title: GOV.UK GA access
weight: 1
last_reviewed_on: 2024-02-20
last_reviewed_on: 2024-04-03
review_in: 6 months
---

# GOV.UK GA access

Google Analytics (GA) is not designed for collecting personally identifiable information (PII), and collecting PII is against GA terms and conditions.

If you notice PII in GA, please raise a Zendesk ticket as quickly as possible.

## What we provide access to
Users are able to request access to:

Expand All @@ -27,7 +23,7 @@ Departments and organisations that publish on www.gov.uk will be allowed access
Access will only be granted to email accounts managed by the department.
Accounts linked to gmail or other non-Civil Service email addresses will not be allowed access and may be removed without warning.

Every organisation must have an [analytics single point of contact (SPOC)](/processes/spocs/) nominated who raises requests and administers users.
Every organisation must have an [analytics Single Point of Contact (SPOC)](/processes/spocs/) nominated who raises requests and administers users.

## Access request process
The user access request process is as follows:
Expand All @@ -37,7 +33,7 @@ graph TD
A[DEPT:
SPOC raises request via SignOn] --> B
B(Zendesk:
ticket generated and sent tp Analyst queue)
Ticket generated and sent to Analyst queue)
B --> C[User added via the user admin tool]
C --> D[User added to Basecamp]
D --> E[Close ticket]
Expand Down Expand Up @@ -71,6 +67,9 @@ It is OK to authorise tools such as Excel Plugins and Python or R scripts to acc

Data must not be processed via third-party or cloud-based systems.

Google Analytics (GA) is not designed for collecting personally identifiable information (PII), and collecting PII is against GA terms and conditions.
If you notice PII in GA, please raise a Zendesk ticket as quickly as possible.

Google Analytics data itself is management information and not an official statistic.
The Government Analysis Function has published [guidance on the use of management information](https://analysisfunction.civilservice.gov.uk/policy-store/national-statisticians-guidance-management-information-and-official-statistics/).

Expand Down
21 changes: 11 additions & 10 deletions source/tools/ga4-user-admin-tool/index.html.md.erb
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
---
title: GA4 USer Admin Tool
title: GA4 User Admin Tool
weight: 4
last_reviewed_on: 2024-02-08
last_reviewed_on: 2024-04-03
review_in: 6 months
---

# GA4 User Admin Tool
This is a tool to add and delete users to www.gov.uk production GA data.
The tool adds a user to www.gov.uk GA4 production as well as Universal Analytics views 1a and 2.
The GA4 User Admin tool is used to add and delete users' access to www.gov.uk production Google Analytics data.
The tool adds a user to [www.gov.uk GA4 production data](/data-sources/ga/ga4/) as well as Universal Analytics views 1a and 2.

The tool is located [here](https://34.36.39.60.nip.io/) and is deployed from the [GA4 Analytics project](/gcp).
To access the tool you will need to be signed into your GDS Google account and be a member of the Google Group 'ga-user-admin'
The app uses [IAP](https://console.cloud.google.com/security/iap) to grant access
To access the tool you will need to be signed into your GDS Google account and be a member of the Google Group 'ga-user-admin'.
The app uses [IAP](https://console.cloud.google.com/security/iap) to grant access.

[Github repository](https://github.com/alphagov/ga4-user-admin)
The code, and issue management, can be found in the [ga4-user-admin Github repository](https://github.com/alphagov/ga4-user-admin).

## Adding a user
When adding a user via this tool they will not be automatically notified by Google, therefore it is important to still send any welcome messaging. The standard message is located in this [Google Doc](https://docs.google.com/document/d/1A7KLTPxxtTPsVK8zzm7B-UqdjTLYxL0ykRyai2Q_01Y/edit#heading=h.xxmc91ktkyr2).
Users added via this tool will not be automatically notified by Google so it is important to still send any welcome messaging.
The standard message is located in this [Google Doc](https://docs.google.com/document/d/1A7KLTPxxtTPsVK8zzm7B-UqdjTLYxL0ykRyai2Q_01Y/edit#heading=h.xxmc91ktkyr2).

## Issues and errors when adding a user
If in the marketing platform you get an error that says the user does not satisy the organisations user policy then this is related to not having associated their account with Google.
see [this support article](https://support.google.com/analytics/thread/235084253/new-user-error-this-user-did-not-satisfy-this-organization%E2%80%99s-user-policy?hl=en&sjid=9628882099368924042-EU)
If you get an error in Marketing Platform stating that the user does not satisy the organisation's user policy this is related to not having associated their account with Google.
[This support article](https://support.google.com/analytics/thread/235084253/new-user-error-this-user-did-not-satisfy-this-organization%E2%80%99s-user-policy?hl=en&sjid=9628882099368924042-EU) should help you deal with this issue.

0 comments on commit 50631c7

Please sign in to comment.