govuk_publishing_components 27.8.0 → 27.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +9 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +12 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_organisation-logo.scss +3 -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: 2f2aa4a5338ce625693a82792f054575ba77e17f7b59dec7a43375cd69bdc0a0
|
|
4
|
+
data.tar.gz: b972a36c99f444e03f1190b54dc38c48a4e755779df9b3596331765785a0ea28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ef57a9ae12333724ca55b5826eb2f962e02c51877e2944b10d7d214258e38aa517317692cc1ee2aab58f38ed7051ebf9fe3ddc864e6982330baf286fe314f9d
|
|
7
|
+
data.tar.gz: 8548a40fad2185b2a63fd7c7748f1bcee2511dfc0c610fbeb8f50caf7ad0daf6739e04fe0c06bcf9e52536d71e8a35203f22847a83ece3b3517c826eda87a8ae
|
|
@@ -36,11 +36,20 @@
|
|
|
36
36
|
fieldsObject = { cookieDomain: fieldsObject }
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
function setLinkedDomains () {
|
|
40
|
+
var domains = window.GOVUK.analyticsVars.primaryLinkedDomains
|
|
41
|
+
if (domains && domains.length > 0) {
|
|
42
|
+
sendToGa('require', 'linker')
|
|
43
|
+
sendToGa('linker:autoLink', domains)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
39
47
|
configureProfile()
|
|
40
48
|
anonymizeIp()
|
|
41
49
|
disableAdFeatures()
|
|
42
50
|
stripTitlePII()
|
|
43
51
|
stripLocationPII()
|
|
52
|
+
setLinkedDomains()
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
GoogleAnalyticsUniversalTracker.load = function () {
|
|
@@ -3,9 +3,12 @@ var analyticsInit = function () {
|
|
|
3
3
|
|
|
4
4
|
var analyticsVars = window.GOVUK.analyticsVars || false
|
|
5
5
|
if (analyticsVars) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
6
|
+
// the property naming convention here isn't consistent, but used in static and
|
|
7
|
+
// govuk-account-manager-prototype, so hard to change
|
|
8
|
+
var primaryGaProperty = window.GOVUK.analyticsVars.gaProperty || false
|
|
9
|
+
|
|
10
|
+
var crossDomainGaProperty = window.GOVUK.analyticsVars.gaPropertyCrossDomain || false
|
|
11
|
+
var crossDomainLinkedDomains = window.GOVUK.analyticsVars.linkedDomains || false
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
window.GOVUK.Analytics.checkDigitalIdentityConsent = function (location) {
|
|
@@ -39,7 +42,7 @@ var analyticsInit = function () {
|
|
|
39
42
|
|
|
40
43
|
// Disable analytics by default
|
|
41
44
|
// This will be reversed below, if the consent cookie says usage cookies are allowed
|
|
42
|
-
var disabler = 'ga-disable-' +
|
|
45
|
+
var disabler = 'ga-disable-' + primaryGaProperty
|
|
43
46
|
window[disabler] = true
|
|
44
47
|
|
|
45
48
|
if (consentCookie && consentCookie.usage) {
|
|
@@ -48,14 +51,14 @@ var analyticsInit = function () {
|
|
|
48
51
|
// Load Google Analytics libraries
|
|
49
52
|
window.GOVUK.StaticAnalytics.load()
|
|
50
53
|
|
|
51
|
-
if (
|
|
54
|
+
if (primaryGaProperty) {
|
|
52
55
|
// Use document.domain in dev, preview and staging so that tracking works
|
|
53
56
|
// Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
|
|
54
57
|
var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain
|
|
55
58
|
|
|
56
59
|
// Configure profiles, setup custom vars, track initial pageview
|
|
57
60
|
var analytics = new window.GOVUK.StaticAnalytics({
|
|
58
|
-
universalId:
|
|
61
|
+
universalId: primaryGaProperty,
|
|
59
62
|
cookieDomain: cookieDomain,
|
|
60
63
|
allowLinker: true
|
|
61
64
|
})
|
|
@@ -63,8 +66,9 @@ var analyticsInit = function () {
|
|
|
63
66
|
// Make interface public for virtual pageviews and events
|
|
64
67
|
window.GOVUK.analytics = analytics
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
// set up linking of domains for cross domain ga property
|
|
70
|
+
if (crossDomainLinkedDomains && crossDomainLinkedDomains.length > 0) {
|
|
71
|
+
window.GOVUK.analytics.addLinkedTrackerDomain(crossDomainGaProperty, 'govuk', crossDomainLinkedDomains)
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
} else {
|
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: 27.8.
|
|
4
|
+
version: 27.8.1
|
|
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: 2021-10-
|
|
11
|
+
date: 2021-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|
|
@@ -642,6 +642,7 @@ files:
|
|
|
642
642
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
|
|
643
643
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
|
|
644
644
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss
|
|
645
|
+
- app/assets/stylesheets/govuk_publishing_components/components/print/_organisation-logo.scss
|
|
645
646
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss
|
|
646
647
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
|
|
647
648
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_textarea.scss
|