govuk_frontend_toolkit 4.0.1 → 4.1.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.
data/app/assets/CHANGELOG.md
CHANGED
data/app/assets/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.0
|
1
|
+
4.1.0
|
@@ -90,6 +90,7 @@ Argument | Description
|
|
90
90
|
|
91
91
|
Option | Description
|
92
92
|
-------|------------
|
93
|
+
`page` | Useful for sending the URL when `window.location` has been updated using JavaScript since the Analytics tracking object was created
|
93
94
|
`label` | Useful for categorising events, eg Javascript error source
|
94
95
|
`value` | Values must be non-negative. Useful to pass counts, eg error happened 5 times
|
95
96
|
`nonInteraction` | Defaults to false. When set the event will not affect bounce rate
|
@@ -98,8 +99,9 @@ Option | Description
|
|
98
99
|
// Track a custom event with required category and action fields
|
99
100
|
GOVUK.analytics.trackEvent('category', 'action');
|
100
101
|
|
101
|
-
// Track a custom event with optional label, value and nonInteraction options
|
102
|
+
// Track a custom event with optional page, label, value and nonInteraction options
|
102
103
|
GOVUK.analytics.trackEvent('category', 'action', {
|
104
|
+
page: '/path/to/page',
|
103
105
|
label: 'label',
|
104
106
|
value: 1,
|
105
107
|
nonInteraction: true // event will not affect bounce rate
|
@@ -54,6 +54,11 @@
|
|
54
54
|
evt.eventLabel = options.label;
|
55
55
|
}
|
56
56
|
|
57
|
+
// Page is optional
|
58
|
+
if (typeof options.page === "string") {
|
59
|
+
evt.page = options.page;
|
60
|
+
}
|
61
|
+
|
57
62
|
// Value is optional, but when used must be an
|
58
63
|
// integer, otherwise the event will be invalid
|
59
64
|
// and not logged
|
@@ -94,6 +94,13 @@ describe("GOVUK.GoogleAnalyticsUniversalTracker", function() {
|
|
94
94
|
}]
|
95
95
|
);
|
96
96
|
});
|
97
|
+
|
98
|
+
it('sends the page if supplied', function() {
|
99
|
+
universal.trackEvent('category', 'action', {page: '/path/to/page'});
|
100
|
+
expect(window.ga.calls.mostRecent().args).toEqual(
|
101
|
+
['send', {hitType: 'event', eventCategory: 'category', eventAction: 'action', page: '/path/to/page'}]
|
102
|
+
);
|
103
|
+
});
|
97
104
|
});
|
98
105
|
|
99
106
|
describe('when social events are tracked', function() {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_frontend_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -286,7 +286,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
286
286
|
version: '0'
|
287
287
|
segments:
|
288
288
|
- 0
|
289
|
-
hash:
|
289
|
+
hash: 4509289467583034213
|
290
290
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
291
|
none: false
|
292
292
|
requirements:
|
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
295
|
version: '0'
|
296
296
|
segments:
|
297
297
|
- 0
|
298
|
-
hash:
|
298
|
+
hash: 4509289467583034213
|
299
299
|
requirements: []
|
300
300
|
rubyforge_project:
|
301
301
|
rubygems_version: 1.8.23
|