@blotoutio/providers-google-analytics-4-sdk 0.21.0 → 0.22.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.
- package/index.js +10 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -19,7 +19,9 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
const init = ({ manifest, userId }) => {
|
|
22
|
-
if (!window ||
|
|
22
|
+
if (!window ||
|
|
23
|
+
!manifest.variables ||
|
|
24
|
+
manifest.variables['flowType'] === 'server') {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
25
27
|
if (!window.gtag) {
|
|
@@ -215,7 +217,9 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
215
217
|
}
|
|
216
218
|
};
|
|
217
219
|
const handleTag = ({ data = {}, eventName, eventId, manifestVariables, }) => {
|
|
218
|
-
if (!eventName ||
|
|
220
|
+
if (!eventName ||
|
|
221
|
+
!window.gtag ||
|
|
222
|
+
(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['flowType']) === 'server') {
|
|
219
223
|
return;
|
|
220
224
|
}
|
|
221
225
|
const { event, eventData } = getEvent(eventName, data, eventId);
|
|
@@ -227,7 +231,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
227
231
|
eventData['debug_mode'] = true;
|
|
228
232
|
}
|
|
229
233
|
}
|
|
230
|
-
window.gtag('event', event,
|
|
234
|
+
window.gtag('event', event, { ...eventData, app: 'blotout' });
|
|
231
235
|
};
|
|
232
236
|
|
|
233
237
|
const getCookieValue = (key) => {
|
|
@@ -249,7 +253,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
249
253
|
}
|
|
250
254
|
return '';
|
|
251
255
|
}
|
|
252
|
-
catch
|
|
256
|
+
catch {
|
|
253
257
|
return '';
|
|
254
258
|
}
|
|
255
259
|
};
|
|
@@ -261,7 +265,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
261
265
|
}
|
|
262
266
|
return {
|
|
263
267
|
loaded: isLoaded,
|
|
264
|
-
sdkVersion: "0.
|
|
268
|
+
sdkVersion: "0.22.1" ,
|
|
265
269
|
};
|
|
266
270
|
};
|
|
267
271
|
|
|
@@ -278,7 +282,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
278
282
|
window.edgetagProviders.push(data);
|
|
279
283
|
}
|
|
280
284
|
}
|
|
281
|
-
catch
|
|
285
|
+
catch {
|
|
282
286
|
// No window
|
|
283
287
|
}
|
|
284
288
|
|