pb-sxp-ui 1.15.18 → 1.15.20-alpha.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/dist/index.cjs +27 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -12
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +27 -12
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.js +8 -12
- package/lib/core/context/SxpDataSourceProvider.js +8 -12
- package/package.json +1 -1
@@ -112,15 +112,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
112
112
|
const queryString = qs.stringify(options.query);
|
113
113
|
path = `${path}?${queryString}`;
|
114
114
|
}
|
115
|
-
if (options.type === 'beacon' && navigator.sendBeacon) {
|
116
|
-
return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
|
117
|
-
JSON.stringify({
|
118
|
-
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
119
|
-
})
|
120
|
-
], {
|
121
|
-
type: 'application/json;charset=UTF-8'
|
122
|
-
}));
|
123
|
-
}
|
124
115
|
return window
|
125
116
|
.fetch(`${url}/api/${path}`, {
|
126
117
|
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|
@@ -366,13 +357,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
366
357
|
return uri + separator + key + '=' + value;
|
367
358
|
}
|
368
359
|
}
|
369
|
-
if (eventName === 'PageView') {
|
360
|
+
if (eventName === 'PageView' && (pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) === 'PageView') {
|
370
361
|
const currentUrl = window.location.href;
|
371
362
|
const newUrl = updateQueryStringParameter(currentUrl, 'timestamp', Date.now());
|
372
363
|
history.pushState({ path: newUrl }, '', newUrl);
|
373
364
|
}
|
374
|
-
|
375
|
-
|
365
|
+
else {
|
366
|
+
const body = getEventParamsByJson(pixelEventParamsJson);
|
367
|
+
window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, body);
|
368
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
369
|
+
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
370
|
+
}
|
371
|
+
}
|
376
372
|
}
|
377
373
|
else if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
378
374
|
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
@@ -115,15 +115,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
115
115
|
const queryString = qs_1.default.stringify(options.query);
|
116
116
|
path = `${path}?${queryString}`;
|
117
117
|
}
|
118
|
-
if (options.type === 'beacon' && navigator.sendBeacon) {
|
119
|
-
return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
|
120
|
-
JSON.stringify({
|
121
|
-
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
122
|
-
})
|
123
|
-
], {
|
124
|
-
type: 'application/json;charset=UTF-8'
|
125
|
-
}));
|
126
|
-
}
|
127
118
|
return window
|
128
119
|
.fetch(`${url}/api/${path}`, {
|
129
120
|
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|
@@ -369,13 +360,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
369
360
|
return uri + separator + key + '=' + value;
|
370
361
|
}
|
371
362
|
}
|
372
|
-
if (eventName === 'PageView') {
|
363
|
+
if (eventName === 'PageView' && (pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) === 'PageView') {
|
373
364
|
const currentUrl = window.location.href;
|
374
365
|
const newUrl = updateQueryStringParameter(currentUrl, 'timestamp', Date.now());
|
375
366
|
history.pushState({ path: newUrl }, '', newUrl);
|
376
367
|
}
|
377
|
-
|
378
|
-
|
368
|
+
else {
|
369
|
+
const body = getEventParamsByJson(pixelEventParamsJson);
|
370
|
+
window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, body);
|
371
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
372
|
+
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
373
|
+
}
|
374
|
+
}
|
379
375
|
}
|
380
376
|
else if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
381
377
|
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|