Skip to content

Commit 407c390

Browse files
committed
Rename GA4 gtag analytics partial
This code is specifically for gtag.js approach to tracking with GA4. This clarification is useful in advance of adding support for the other approach: Google Tag Manager https://support.google.com/tagmanager/answer/7582054 https://developers.google.com/tag-platform/tag-manager/datalayer
1 parent 36758d8 commit 407c390

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

example/config/tech-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ footer_links:
1919
Accessibility: /hidden-page.html
2020
Hidden Page: /hidden-page.html
2121

22-
# Tracking ID (if using GA4 e.g G-XXXXXX)
22+
# Tracking IDs
23+
# Google Analytics 4 using gtag.js (e.g G-XXXXXX)
2324
ga4_tracking_id:
24-
25-
# Tracking ID from Google Universal Analytics (e.g. UA-XXXX-Y)
25+
# Google Universal Analytics (e.g. UA-XXXX-Y)
2626
ga_tracking_id:
2727

2828
# Enable multipage navigation in the sidebar

lib/source/layouts/_analytics_head.erb renamed to lib/source/layouts/_analytics_ga4_gtag.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
gtag('js', new Date());
88
gtag('config', '<%= config[:tech_docs][:ga4_tracking_id] %>');
99
</script>
10-
<% end %>
10+
<% end %>

lib/source/layouts/core.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<html lang="en" class="govuk-template <%= config[:tech_docs][:show_govuk_logo] ? 'govuk-template--rebranded ' : '' %>no-js">
33
<head>
4-
<%= partial 'layouts/analytics_head' %>
4+
<%= partial 'layouts/analytics_ga4_gtag' %>
55

66
<meta content="IE=edge" http-equiv="X-UA-Compatible">
77
<meta charset="utf-8">

0 commit comments

Comments
 (0)