govuk_publishing_components 30.7.2 → 30.7.3

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: 3c7f16760ab4f91b2f86e6dda6f9066d33f3e1dc305170a0a7aca313df2fbf63
4
- data.tar.gz: 7484fc85aad02f15bdb4de512979855520517a7cff39b6f8c7365be85666f176
3
+ metadata.gz: 5a0126e6016869d447d661d4e1c4777d68a10292c19e388bcb22477021877b7b
4
+ data.tar.gz: e83f7124df4f9126819c1f11310bfda63dde08be6c57749ead9395eef1d58ea0
5
5
  SHA512:
6
- metadata.gz: 19878d148ec4971e70494e929eb372e1c83411ca86e14435afba05929feb01d793c3300152150f11fe94370ae98997b30c2759a1b5c84dff4e81d7013446631a
7
- data.tar.gz: 9e29ae1795f429a733a63da7da96382318a9a590e767086222e47802c075a0a6b510d511e57205a95d63a0528e03b6458d9e4266ca092e617134b71d8db58387
6
+ metadata.gz: 03ac390a2a2a9fa5378699daac0dab1a55551bee3ab995f159487c5a5d295a3ff139629fab6b9f0b95dc52bc4d89d5b941f867e00c20fe9562eafbb5d5af43ef
7
+ data.tar.gz: ee961b5da8eacf0d47567ae446a1c1741ea65576affbdeb84916bb48a64064de8383c1ad64de86da84def9ad5f13c034c7893dca904a7a64e8405b0133754e37
@@ -1,3 +1,5 @@
1
+ // note that because this file is .js.erb it is not linted
2
+ // temporarily rename to .js to check with the linter
1
3
  window.GOVUK = window.GOVUK || {}
2
4
  window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
3
5
 
@@ -6,28 +8,29 @@ window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
6
8
 
7
9
  var core = {
8
10
  load: function () {
11
+ var firstScript
12
+ var newScript
13
+
9
14
  if (window.GOVUK.analyticsGA4.vars.gtag_id) {
10
15
  // initialise gtag
11
16
  window.dataLayer = window.dataLayer || []
12
- function gtag() { dataLayer.push(arguments) }
17
+ var gtag = function () { window.dataLayer.push(arguments) }
13
18
  gtag('js', new Date())
14
19
  gtag('config', window.GOVUK.analyticsGA4.vars.gtag_id)
15
20
 
16
- var firstScript = document.getElementsByTagName('script')[0]
17
- var newScript = document.createElement('script')
18
- var dl = 'dataLayer' != 'dataLayer' ? '&l=' + 'dataLayer' : ''
21
+ firstScript = document.getElementsByTagName('script')[0]
22
+ newScript = document.createElement('script')
19
23
 
20
24
  newScript.async = true
21
- newScript.src = '//www.googletagmanager.com/gtag/js?id=' + window.GOVUK.analyticsGA4.vars.gtag_id + dl
25
+ newScript.src = '//www.googletagmanager.com/gtag/js?id=' + window.GOVUK.analyticsGA4.vars.gtag_id
22
26
  firstScript.parentNode.insertBefore(newScript, firstScript)
23
27
  } else {
24
28
  // initialise GTM
25
29
  window.dataLayer = window.dataLayer || []
26
30
  window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
27
31
 
28
- var firstScript = document.getElementsByTagName('script')[0]
29
- var newScript = document.createElement('script')
30
- var dl = 'dataLayer' != 'dataLayer' ? '&l=' + 'dataLayer' : ''
32
+ firstScript = document.getElementsByTagName('script')[0]
33
+ newScript = document.createElement('script')
31
34
 
32
35
  var auth = window.GOVUK.analyticsGA4.vars.auth || ''
33
36
  var preview = window.GOVUK.analyticsGA4.vars.preview || ''
@@ -39,10 +42,10 @@ window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
39
42
  }
40
43
 
41
44
  newScript.async = true
42
- this.googleSrc = 'https://www.googletagmanager.com/gtm.js?id=' + window.GOVUK.analyticsGA4.vars.id + dl + auth + preview
45
+ this.googleSrc = 'https://www.googletagmanager.com/gtm.js?id=' + window.GOVUK.analyticsGA4.vars.id + auth + preview
43
46
  newScript.src = this.googleSrc
44
47
  firstScript.parentNode.insertBefore(newScript, firstScript)
45
- window.dataLayer.push({ 'gtm.blocklist' : ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
48
+ window.dataLayer.push({ 'gtm.blocklist': ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
46
49
  }
47
50
  },
48
51
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "30.7.2".freeze
2
+ VERSION = "30.7.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 30.7.2
4
+ version: 30.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev