govuk_publishing_components 30.5.1 → 30.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +20 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 073dc54341c48d15d952800db0ebbfd5d4d87de9f26a6d07b94250ef9bc0ed9d
|
4
|
+
data.tar.gz: 201402f75e2b8461f236e7776e4d797a34c040a12058ea18eef10f4a32d9b760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 990eb134bb9dafa279cc4a4953a09942340744a892d9ab064ebd5e951a49895ad8dce0bd40f631a08a2ca144373537ee70fa730cd1112354aa01ce05a2e7ba52
|
7
|
+
data.tar.gz: 0b6224f2181204e5ba0db96cd8b87f81d2d288b1c3589a200ed88bcc150761d44ac26d2d8e180ccecfb18a0ba07991cd127991595a72ad8d85f6c4da7f4e5c1b
|
@@ -0,0 +1,20 @@
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
2
|
+
window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
|
3
|
+
|
4
|
+
(function (analytics) {
|
5
|
+
'use strict'
|
6
|
+
|
7
|
+
var core = {
|
8
|
+
load: function () {
|
9
|
+
/* eslint-disable */
|
10
|
+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
11
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
12
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
13
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=' + window.GOVUK.analyticsGA4.vars.auth + '>m_preview=' + window.GOVUK.analyticsGA4.vars.preview + '>m_cookies_win=x';f.parentNode.insertBefore(j,f);
|
14
|
+
})(window,document,'script','dataLayer',window.GOVUK.analyticsGA4.vars.id);
|
15
|
+
/* eslint-enable */
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
analytics.core = core
|
20
|
+
})(window.GOVUK.analyticsGA4)
|
@@ -7,6 +7,8 @@ var initFunction = function () {
|
|
7
7
|
var consentCookie = window.GOVUK.getConsentCookie()
|
8
8
|
|
9
9
|
if (consentCookie && consentCookie.usage) {
|
10
|
+
window.GOVUK.analyticsGA4.core.load()
|
11
|
+
|
10
12
|
var analyticsModules = window.GOVUK.analyticsGA4.analyticsModules
|
11
13
|
for (var property in analyticsModules) {
|
12
14
|
var module = analyticsModules[property]
|
@@ -14,7 +16,6 @@ var initFunction = function () {
|
|
14
16
|
module.init()
|
15
17
|
}
|
16
18
|
}
|
17
|
-
// to be added: attach JS from Google to the DOM and execute
|
18
19
|
// to be added: cross domain tracking code
|
19
20
|
} else {
|
20
21
|
window.addEventListener('cookie-consent', function () {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 30.5.
|
4
|
+
version: 30.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -436,6 +436,7 @@ files:
|
|
436
436
|
- app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
|
437
437
|
- app/assets/javascripts/govuk_publishing_components/all_components.js
|
438
438
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4.js
|
439
|
+
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js
|
439
440
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js
|
440
441
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js
|
441
442
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js
|