govuk_publishing_components 23.1.0 → 23.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20fcbde55a95f5ca3e7ac5744c94f69b573b563e9c5df919681864c6662dff16
4
- data.tar.gz: 9d65b762cc90d4e8bfa3ba37b2c811778af94f55a3d88d0e45ca0ed7f0d0161a
3
+ metadata.gz: 585d11b9396da0fe9700ea8df8b1b551609b70255b536e4230e7c185a2985d27
4
+ data.tar.gz: 64f9b47b4a80c994a9b4f5821e6ce3ca2195f53c6e7b5e1da9077b56a7488cba
5
5
  SHA512:
6
- metadata.gz: 10d6c20ed45850b0bc92826e009dd10d8cbc5a6e09368ad9822e33d97a7bf6b8b59b43c50b18cf630e109455df35e4b993b6c1e497d0eeb94adc2081b128da41
7
- data.tar.gz: b3fdb29493b563ef3893f1c2d33f21feb2f9817d38952cff97091e6b318bd0d11c2ddd3c85ba08f0baf80560a30150651ed283fbaf06700b4045d161cb187740
6
+ metadata.gz: 69c3d73429e1bd91e90ae4cd47ff35b35d360c207736314498e9de92f5de1052bc0353134302f410d6bae056d4504f74bb5d6b9e7573abbabf2f2f5454db484e
7
+ data.tar.gz: 2af0e5162819931a95c301608f782c991dc4b047d34c24e29d84093a6be5ed03cb0fc143294cbcfcfa8956c6cc22a361dd41bc4cfa76adf50095cd331f599653
@@ -0,0 +1,48 @@
1
+ var analyticsInit = function (gaProperty, gaPropertyCrossDomain, linkedDomains) {
2
+ 'use strict'
3
+
4
+ var consentCookie = window.GOVUK.getConsentCookie()
5
+
6
+ var dummyAnalytics = {
7
+ addLinkedTrackerDomain: function () {},
8
+ setDimension: function () {},
9
+ setOptionsForNextPageView: function () {},
10
+ trackEvent: function () {},
11
+ trackPageview: function () {},
12
+ trackShare: function () {}
13
+ }
14
+
15
+ // Disable analytics by default
16
+ // This will be reversed below, if the consent cookie says usage cookies are allowed
17
+ var disabler = 'ga-disable-' + gaProperty
18
+ window[disabler] = true
19
+
20
+ if (consentCookie && consentCookie.usage) {
21
+ window[disabler] = false
22
+
23
+ // Load Google Analytics libraries
24
+ window.GOVUK.StaticAnalytics.load()
25
+
26
+ // Use document.domain in dev, preview and staging so that tracking works
27
+ // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
28
+ var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain
29
+
30
+ // Configure profiles, setup custom vars, track initial pageview
31
+ var analytics = new window.GOVUK.StaticAnalytics({
32
+ universalId: gaProperty,
33
+ cookieDomain: cookieDomain,
34
+ allowLinker: true
35
+ })
36
+
37
+ // Make interface public for virtual pageviews and events
38
+ window.GOVUK.analytics = analytics
39
+
40
+ if (linkedDomains && linkedDomains.length > 0) {
41
+ window.GOVUK.analytics.addLinkedTrackerDomain(gaPropertyCrossDomain, 'govuk', linkedDomains)
42
+ }
43
+ } else {
44
+ window.GOVUK.analytics = dummyAnalytics
45
+ }
46
+ }
47
+
48
+ window.GOVUK.analyticsInit = analyticsInit
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "23.1.0".freeze
2
+ VERSION = "23.2.0".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: 23.1.0
4
+ version: 23.2.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-10-27 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -406,7 +406,7 @@ files:
406
406
  - app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js
407
407
  - app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js
408
408
  - app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js
409
- - app/assets/javascripts/govuk_publishing_components/analytics/init.js.erb
409
+ - app/assets/javascripts/govuk_publishing_components/analytics/init.js
410
410
  - app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js
411
411
  - app/assets/javascripts/govuk_publishing_components/analytics/page-content.js
412
412
  - app/assets/javascripts/govuk_publishing_components/analytics/pii.js
@@ -1,50 +0,0 @@
1
- var analyticsInit = function(linkedDomains) {
2
- "use strict";
3
-
4
- var consentCookie = window.GOVUK.getConsentCookie();
5
-
6
- var dummyAnalytics = {
7
- addLinkedTrackerDomain: function(){},
8
- setDimension: function(){},
9
- setOptionsForNextPageView: function(){},
10
- trackEvent: function(){},
11
- trackPageview: function(){},
12
- trackShare: function(){},
13
- };
14
-
15
- // Disable analytics by default
16
- // This will be reversed below, if the consent cookie says usage cookies are allowed
17
- window['ga-disable-UA-26179049-1'] = true;
18
-
19
- if (consentCookie && consentCookie["usage"]) {
20
- window['ga-disable-UA-26179049-1'] = false;
21
-
22
- // Load Google Analytics libraries
23
- GOVUK.StaticAnalytics.load();
24
-
25
- // Use document.domain in dev, preview and staging so that tracking works
26
- // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
27
- var cookieDomain = (document.domain == 'www.gov.uk') ? '.www.gov.uk' : document.domain;
28
-
29
- var universalId = "UA-26179049-1";
30
- var secondaryId = "UA-145652997-1";
31
-
32
- // Configure profiles, setup custom vars, track initial pageview
33
- var analytics = new GOVUK.StaticAnalytics({
34
- universalId: universalId,
35
- cookieDomain: cookieDomain,
36
- allowLinker: true
37
- });
38
-
39
- // Make interface public for virtual pageviews and events
40
- GOVUK.analytics = analytics;
41
-
42
- if (linkedDomains && linkedDomains.length > 0) {
43
- GOVUK.analytics.addLinkedTrackerDomain(secondaryId, 'govuk', linkedDomains);
44
- }
45
- } else {
46
- GOVUK.analytics = dummyAnalytics
47
- }
48
- }
49
-
50
- window.GOVUK.analyticsInit = analyticsInit