backend-manager 3.2.98 → 3.2.99
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.
package/package.json
CHANGED
|
@@ -195,10 +195,11 @@ Analytics.prototype.event = function (payload) {
|
|
|
195
195
|
// https://support.google.com/analytics/answer/13316687?hl=en#zippy=%2Cweb
|
|
196
196
|
// https://support.google.com/analytics/answer/9268042?sjid=4476481583372132143-NC
|
|
197
197
|
// https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#screen_view
|
|
198
|
+
|
|
198
199
|
payload = payload || {};
|
|
199
200
|
payload.name = (payload.name || '')
|
|
200
|
-
// Replace
|
|
201
|
-
.replace(
|
|
201
|
+
// Replace anything not a letter, number, or underscore with an underscore
|
|
202
|
+
.replace(/[^a-zA-Z0-9_]/g, '_')
|
|
202
203
|
// Remove leading and trailing underscores
|
|
203
204
|
.replace(/^_+|_+$/g, '')
|
|
204
205
|
// Remove multiple underscores
|