govuk_admin_template 1.4.1 → 1.4.2
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/CHANGELOG.md +4 -0
- data/app/assets/javascripts/govuk-admin-template/govuk-admin.js +22 -10
- data/lib/govuk_admin_template/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8877a7d38ebb9d4f4651d722563d085628f049c6
|
4
|
+
data.tar.gz: ab9b72c6a03035a3e5c640853a041b403d377d2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0727631827f8e1f18ba6c534a0d8663fa50096608d4698418ab1dd3a1a15f702b484b57d0c65ece49dafd91a7703175e8f7764e94e3e69baccdad4997ab4560
|
7
|
+
data.tar.gz: b9808b52be5304be1609e76b0d24074bea38ea8ea392158856a48291f4fff74d3e6f9110f2f7451946e6a04bb71c7dbc556d71b907e72c03e1222d521f298f6c
|
data/CHANGELOG.md
CHANGED
@@ -71,23 +71,26 @@
|
|
71
71
|
}
|
72
72
|
|
73
73
|
// Google Analytics event tracking
|
74
|
-
// https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
|
75
74
|
// Label and value are optional
|
76
75
|
GOVUKAdmin.track = function(action, label, value) {
|
77
76
|
|
78
77
|
// Default category to the page an event occurs on
|
79
78
|
var category = root.location.pathname,
|
80
|
-
event;
|
81
79
|
|
82
|
-
|
83
|
-
|
84
|
-
root._gaq = root._gaq || [];
|
80
|
+
// https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
|
81
|
+
eventGa = ["_trackEvent", category, action],
|
85
82
|
|
86
|
-
|
83
|
+
// https://developers.google.com/analytics/devguides/collection/analyticsjs/events
|
84
|
+
eventAnalytics = {
|
85
|
+
hitType: 'event',
|
86
|
+
eventCategory: category,
|
87
|
+
eventAction: action
|
88
|
+
};
|
87
89
|
|
88
90
|
// Label is optional
|
89
91
|
if (typeof label === "string") {
|
90
|
-
|
92
|
+
eventGa.push(label);
|
93
|
+
eventAnalytics.eventLabel = label;
|
91
94
|
}
|
92
95
|
|
93
96
|
// Value is optional, but when used must be an
|
@@ -96,12 +99,21 @@
|
|
96
99
|
if (value) {
|
97
100
|
value = parseInt(value, 10);
|
98
101
|
if (typeof value === "number" && !isNaN(value)) {
|
99
|
-
|
102
|
+
eventGa.push(value);
|
103
|
+
eventAnalytics.eventValue = value;
|
100
104
|
}
|
101
105
|
}
|
102
106
|
|
103
|
-
//
|
104
|
-
|
107
|
+
// _gaq is the Google Analytics tracking object we
|
108
|
+
// push events to when using the old tracking code
|
109
|
+
root._gaq = root._gaq || [];
|
110
|
+
|
111
|
+
// Useful for debugging:
|
112
|
+
// console.log(eventGa, eventAnalytics);
|
113
|
+
root._gaq.push(eventGa);
|
114
|
+
if (typeof root.ga === "function") {
|
115
|
+
root.ga('send', eventAnalytics);
|
116
|
+
}
|
105
117
|
}
|
106
118
|
|
107
119
|
})(jQuery, window);
|