pb-sxp-ui 1.15.34 → 1.15.36
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 +21 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -19
- 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 +21 -19
- 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 +21 -19
- package/lib/core/context/SxpDataSourceProvider.js +21 -19
- package/package.json +1 -1
@@ -357,6 +357,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
357
357
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
358
358
|
return;
|
359
359
|
}
|
360
|
+
let isPushState = false;
|
360
361
|
const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
|
361
362
|
if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
362
363
|
function updateQueryStringParameter(uri, key, value) {
|
@@ -372,32 +373,33 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
372
373
|
if (eventName === 'PageView' && (pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) === 'PageView') {
|
373
374
|
if (!pixelPvStatusRef.current) {
|
374
375
|
pixelPvStatusRef.current = true;
|
375
|
-
return;
|
376
376
|
}
|
377
|
-
|
378
|
-
|
379
|
-
|
377
|
+
else {
|
378
|
+
const currentUrl = window.location.href;
|
379
|
+
const newUrl = updateQueryStringParameter(currentUrl, 'timestamp', Date.now());
|
380
|
+
history.pushState({ path: newUrl }, '', newUrl);
|
381
|
+
isPushState = true;
|
382
|
+
}
|
380
383
|
}
|
381
384
|
else {
|
382
385
|
const body = getEventParamsByJson(pixelEventParamsJson);
|
383
386
|
window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, body);
|
384
|
-
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
385
|
-
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
386
|
-
}
|
387
387
|
}
|
388
388
|
}
|
389
|
-
|
390
|
-
window === null || window === void 0 ? void 0 : window.gtag
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
389
|
+
if (!isPushState) {
|
390
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
391
|
+
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
392
|
+
}
|
393
|
+
const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
|
394
|
+
if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
|
395
|
+
typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
|
396
|
+
typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
|
397
|
+
(_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, tiktokPixelEventParamsJson);
|
398
|
+
}
|
399
|
+
const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
|
400
|
+
if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
|
401
|
+
window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, snapchatPixelEventParamsJson);
|
402
|
+
}
|
401
403
|
}
|
402
404
|
const converApiEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _f === void 0 ? void 0 : _f[eventName];
|
403
405
|
if (enabledMetaConversionApi && converApiEventParamsJson) {
|
@@ -360,6 +360,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
360
360
|
if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
|
361
361
|
return;
|
362
362
|
}
|
363
|
+
let isPushState = false;
|
363
364
|
const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
|
364
365
|
if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
365
366
|
function updateQueryStringParameter(uri, key, value) {
|
@@ -375,32 +376,33 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
375
376
|
if (eventName === 'PageView' && (pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) === 'PageView') {
|
376
377
|
if (!pixelPvStatusRef.current) {
|
377
378
|
pixelPvStatusRef.current = true;
|
378
|
-
return;
|
379
379
|
}
|
380
|
-
|
381
|
-
|
382
|
-
|
380
|
+
else {
|
381
|
+
const currentUrl = window.location.href;
|
382
|
+
const newUrl = updateQueryStringParameter(currentUrl, 'timestamp', Date.now());
|
383
|
+
history.pushState({ path: newUrl }, '', newUrl);
|
384
|
+
isPushState = true;
|
385
|
+
}
|
383
386
|
}
|
384
387
|
else {
|
385
388
|
const body = getEventParamsByJson(pixelEventParamsJson);
|
386
389
|
window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, body);
|
387
|
-
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
388
|
-
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
389
|
-
}
|
390
390
|
}
|
391
391
|
}
|
392
|
-
|
393
|
-
window === null || window === void 0 ? void 0 : window.gtag
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
392
|
+
if (!isPushState) {
|
393
|
+
if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
|
394
|
+
window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
|
395
|
+
}
|
396
|
+
const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
|
397
|
+
if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
|
398
|
+
typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
|
399
|
+
typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
|
400
|
+
(_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, tiktokPixelEventParamsJson);
|
401
|
+
}
|
402
|
+
const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
|
403
|
+
if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
|
404
|
+
window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, snapchatPixelEventParamsJson);
|
405
|
+
}
|
404
406
|
}
|
405
407
|
const converApiEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _f === void 0 ? void 0 : _f[eventName];
|
406
408
|
if (enabledMetaConversionApi && converApiEventParamsJson) {
|