govuk_publishing_components 30.7.1 → 30.7.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c7f16760ab4f91b2f86e6dda6f9066d33f3e1dc305170a0a7aca313df2fbf63
|
4
|
+
data.tar.gz: 7484fc85aad02f15bdb4de512979855520517a7cff39b6f8c7365be85666f176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19878d148ec4971e70494e929eb372e1c83411ca86e14435afba05929feb01d793c3300152150f11fe94370ae98997b30c2759a1b5c84dff4e81d7013446631a
|
7
|
+
data.tar.gz: 9e29ae1795f429a733a63da7da96382318a9a590e767086222e47802c075a0a6b510d511e57205a95d63a0528e03b6458d9e4266ca092e617134b71d8db58387
|
@@ -6,14 +6,44 @@ window.GOVUK.analyticsGA4 = window.GOVUK.analyticsGA4 || {};
|
|
6
6
|
|
7
7
|
var core = {
|
8
8
|
load: function () {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
if (window.GOVUK.analyticsGA4.vars.gtag_id) {
|
10
|
+
// initialise gtag
|
11
|
+
window.dataLayer = window.dataLayer || []
|
12
|
+
function gtag() { dataLayer.push(arguments) }
|
13
|
+
gtag('js', new Date())
|
14
|
+
gtag('config', window.GOVUK.analyticsGA4.vars.gtag_id)
|
15
|
+
|
16
|
+
var firstScript = document.getElementsByTagName('script')[0]
|
17
|
+
var newScript = document.createElement('script')
|
18
|
+
var dl = 'dataLayer' != 'dataLayer' ? '&l=' + 'dataLayer' : ''
|
19
|
+
|
20
|
+
newScript.async = true
|
21
|
+
newScript.src = '//www.googletagmanager.com/gtag/js?id=' + window.GOVUK.analyticsGA4.vars.gtag_id + dl
|
22
|
+
firstScript.parentNode.insertBefore(newScript, firstScript)
|
23
|
+
} else {
|
24
|
+
// initialise GTM
|
25
|
+
window.dataLayer = window.dataLayer || []
|
26
|
+
window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
|
27
|
+
|
28
|
+
var firstScript = document.getElementsByTagName('script')[0]
|
29
|
+
var newScript = document.createElement('script')
|
30
|
+
var dl = 'dataLayer' != 'dataLayer' ? '&l=' + 'dataLayer' : ''
|
31
|
+
|
32
|
+
var auth = window.GOVUK.analyticsGA4.vars.auth || ''
|
33
|
+
var preview = window.GOVUK.analyticsGA4.vars.preview || ''
|
34
|
+
if (auth) {
|
35
|
+
auth = '>m_auth=' + auth
|
36
|
+
}
|
37
|
+
if (preview) {
|
38
|
+
preview = '>m_preview=' + preview + '>m_cookies_win=x'
|
39
|
+
}
|
40
|
+
|
41
|
+
newScript.async = true
|
42
|
+
this.googleSrc = 'https://www.googletagmanager.com/gtm.js?id=' + window.GOVUK.analyticsGA4.vars.id + dl + auth + preview
|
43
|
+
newScript.src = this.googleSrc
|
44
|
+
firstScript.parentNode.insertBefore(newScript, firstScript)
|
45
|
+
window.dataLayer.push({ 'gtm.blocklist' : ['customPixels', 'customScripts', 'html', 'nonGoogleScripts'] })
|
46
|
+
}
|
17
47
|
},
|
18
48
|
|
19
49
|
sendData: function (data) {
|
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.7.
|
4
|
+
version: 30.7.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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|