govuk_publishing_components 23.2.1 → 23.3.0
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: 023220040cfb5795cd3e6b148e22b442144f18028ef8e09853e764b004a5de0a
|
4
|
+
data.tar.gz: 5b2a54316ce8efa8ae221bf8dddf3948934a2472838f629abbda0b2d56bc7f42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62418105d4b33b8d133b05dcbbf7f440fd0159e07144f8a9c9de272ccb2061c832b54d1233efdbecf91269aa0b98a97fa589ffba74591e86ae9892deef1cfb82
|
7
|
+
data.tar.gz: 21a872c9340a3f6d8d95dcfa60a4935d1d945d75f24cd5a3427649679d062948d34e8f38a60429ca14f85243bc322beff2c87756ea489b828ca60fcdf714a689
|
@@ -1,8 +1,14 @@
|
|
1
|
-
var analyticsInit = function (
|
1
|
+
var analyticsInit = function () {
|
2
2
|
'use strict'
|
3
3
|
|
4
|
-
var
|
4
|
+
var analyticsVars = window.GOVUK.analyticsVars || false
|
5
|
+
if (analyticsVars) {
|
6
|
+
var gaProperty = window.GOVUK.analyticsVars.gaProperty || false
|
7
|
+
var gaPropertyCrossDomain = window.GOVUK.analyticsVars.gaPropertyCrossDomain || false
|
8
|
+
var linkedDomains = window.GOVUK.analyticsVars.linkedDomains || false
|
9
|
+
}
|
5
10
|
|
11
|
+
var consentCookie = window.GOVUK.getConsentCookie()
|
6
12
|
var dummyAnalytics = {
|
7
13
|
addLinkedTrackerDomain: function () {},
|
8
14
|
setDimension: function () {},
|
@@ -23,22 +29,24 @@ var analyticsInit = function (gaProperty, gaPropertyCrossDomain, linkedDomains)
|
|
23
29
|
// Load Google Analytics libraries
|
24
30
|
window.GOVUK.StaticAnalytics.load()
|
25
31
|
|
26
|
-
|
27
|
-
|
28
|
-
|
32
|
+
if (gaProperty) {
|
33
|
+
// Use document.domain in dev, preview and staging so that tracking works
|
34
|
+
// Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
|
35
|
+
var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
// Configure profiles, setup custom vars, track initial pageview
|
38
|
+
var analytics = new window.GOVUK.StaticAnalytics({
|
39
|
+
universalId: gaProperty,
|
40
|
+
cookieDomain: cookieDomain,
|
41
|
+
allowLinker: true
|
42
|
+
})
|
36
43
|
|
37
|
-
|
38
|
-
|
44
|
+
// Make interface public for virtual pageviews and events
|
45
|
+
window.GOVUK.analytics = analytics
|
39
46
|
|
40
|
-
|
41
|
-
|
47
|
+
if (linkedDomains && linkedDomains.length > 0) {
|
48
|
+
window.GOVUK.analytics.addLinkedTrackerDomain(gaPropertyCrossDomain, 'govuk', linkedDomains)
|
49
|
+
}
|
42
50
|
}
|
43
51
|
} else {
|
44
52
|
window.GOVUK.analytics = dummyAnalytics
|
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: 23.
|
4
|
+
version: 23.3.0
|
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: 2020-11-
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|