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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aaf755f85b8026ae4db7ba3b16e3c0940ae637cbd4fefc845e3dc6986ba04dc
4
- data.tar.gz: 9160f6eaab747fc9a75d42692e95a85e999d66c654e38aabb03367cd8d894ea6
3
+ metadata.gz: 073dc54341c48d15d952800db0ebbfd5d4d87de9f26a6d07b94250ef9bc0ed9d
4
+ data.tar.gz: 201402f75e2b8461f236e7776e4d797a34c040a12058ea18eef10f4a32d9b760
5
5
  SHA512:
6
- metadata.gz: 1d82fbcb7a72a89928cf3d622105212e58fa1600575f42a1ace4bf35db2bd4842e216bbc8c95f424a852f3547c0456282cc11d896031d43d7559ea71edfd95a4
7
- data.tar.gz: 2a315750a2897941cbfd673b9dcecaf6ff679389ed3c379a826de53e3437f47508dd070237dba918e05e88d0c629fe0ed336d747ee44072088fb79097b341706
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+ '&gtm_auth=' + window.GOVUK.analyticsGA4.vars.auth + '&gtm_preview=' + window.GOVUK.analyticsGA4.vars.preview + '&gtm_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 () {
@@ -1,4 +1,5 @@
1
1
  // The following modules are imported in a specific order
2
+ //= require ./analytics-ga4/ga4-core
2
3
  //= require ./analytics-ga4/ga4-schemas
3
4
  //= require ./analytics-ga4/pii-remover
4
5
  //= require ./analytics-ga4/ga4-page-views
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "30.5.1".freeze
2
+ VERSION = "30.5.2".freeze
3
3
  end
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.1
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-09 00:00:00.000000000 Z
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