shopkit-analytics 1.0.2 → 1.0.3
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/README.md +35 -100
- package/dist/adapters/index.d.mts +2 -1
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.js +230 -64
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +3 -1
- package/dist/chunk-4RDPDMGW.mjs +68 -0
- package/dist/chunk-4RDPDMGW.mjs.map +1 -0
- package/dist/chunk-NC25KOAF.mjs +156 -0
- package/dist/chunk-NC25KOAF.mjs.map +1 -0
- package/dist/chunk-NGPUKV7E.mjs +46 -0
- package/dist/chunk-NGPUKV7E.mjs.map +1 -0
- package/dist/{chunk-U3UOXFS4.mjs → chunk-NJQ2MOM2.mjs} +206 -116
- package/dist/chunk-NJQ2MOM2.mjs.map +1 -0
- package/dist/chunk-NKDB4KX2.mjs +2 -0
- package/dist/chunk-NKDB4KX2.mjs.map +1 -0
- package/dist/{chunk-BNV3EVHH.mjs → chunk-QCS5UARA.mjs} +2 -2
- package/dist/events/index.js +218 -54
- package/dist/events/index.js.map +1 -1
- package/dist/events/index.mjs +9 -7
- package/dist/experiment/index.d.mts +25 -0
- package/dist/experiment/index.d.ts +25 -0
- package/dist/experiment/index.js +74 -0
- package/dist/experiment/index.js.map +1 -0
- package/dist/experiment/index.mjs +15 -0
- package/dist/experiment/index.mjs.map +1 -0
- package/dist/{index-DS9OI5Mz.d.ts → index-D_8w5bL_.d.ts} +13 -0
- package/dist/{index-Bym1_EAp.d.mts → index-th6sBtE3.d.mts} +13 -0
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +400 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -7
- package/dist/index.mjs.map +1 -1
- package/dist/services/index.d.mts +51 -0
- package/dist/services/index.d.ts +51 -0
- package/dist/services/index.js +180 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/index.mjs +11 -0
- package/dist/services/index.mjs.map +1 -0
- package/dist/types-C__2IBCj.d.mts +7 -0
- package/dist/types-C__2IBCj.d.ts +7 -0
- package/dist/utils/index.d.mts +19 -0
- package/dist/utils/index.d.ts +19 -0
- package/dist/utils/index.js +93 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +12 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +19 -1
- package/templates/nextjs/README.md +206 -0
- package/templates/nextjs/api-events-route.ts +62 -0
- package/dist/chunk-U3UOXFS4.mjs.map +0 -1
- /package/dist/{chunk-BNV3EVHH.mjs.map → chunk-QCS5UARA.mjs.map} +0 -0
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getExperimentParams
|
|
4
|
+
} from "./chunk-NGPUKV7E.mjs";
|
|
5
|
+
import {
|
|
6
|
+
generateEventId,
|
|
7
|
+
getBrowserInfo
|
|
8
|
+
} from "./chunk-4RDPDMGW.mjs";
|
|
2
9
|
|
|
3
10
|
// src/logger/index.ts
|
|
4
11
|
var LOG_LEVELS = {
|
|
@@ -225,6 +232,21 @@ var BaseAdapter = class {
|
|
|
225
232
|
getAffiliateParams() {
|
|
226
233
|
return null;
|
|
227
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Get experiment parameters from cookies
|
|
237
|
+
* @returns Experiment parameters
|
|
238
|
+
*/
|
|
239
|
+
getExperimentParams() {
|
|
240
|
+
try {
|
|
241
|
+
return getExperimentParams();
|
|
242
|
+
} catch (error) {
|
|
243
|
+
return {
|
|
244
|
+
_prima_pr_ab_home: null,
|
|
245
|
+
_prima_pr_ab_collection: null,
|
|
246
|
+
_prima_pr_ab_product: null
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}
|
|
228
250
|
/**
|
|
229
251
|
* Enhance event parameters with affiliate data
|
|
230
252
|
* @param params The original parameters
|
|
@@ -239,58 +261,19 @@ var BaseAdapter = class {
|
|
|
239
261
|
...affiliateParams
|
|
240
262
|
};
|
|
241
263
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
const userAgent = navigator.userAgent;
|
|
255
|
-
const fbc = getFacebookClickId();
|
|
256
|
-
const fbp = getFacebookBrowserId();
|
|
257
|
-
return {
|
|
258
|
-
clientUserAgent: userAgent,
|
|
259
|
-
fbc,
|
|
260
|
-
fbp
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
function getFacebookClickId() {
|
|
264
|
-
if (typeof window === "undefined") {
|
|
265
|
-
return void 0;
|
|
266
|
-
}
|
|
267
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
268
|
-
const fbclid = urlParams.get("fbclid");
|
|
269
|
-
if (fbclid) {
|
|
270
|
-
return `fb.1.${Date.now()}.${fbclid}`;
|
|
271
|
-
}
|
|
272
|
-
const cookies = document.cookie.split(";");
|
|
273
|
-
for (const cookie of cookies) {
|
|
274
|
-
const [name, value] = cookie.trim().split("=");
|
|
275
|
-
if (name === "_fbc") {
|
|
276
|
-
return value;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return void 0;
|
|
280
|
-
}
|
|
281
|
-
function getFacebookBrowserId() {
|
|
282
|
-
if (typeof window === "undefined") {
|
|
283
|
-
return void 0;
|
|
284
|
-
}
|
|
285
|
-
const cookies = document.cookie.split(";");
|
|
286
|
-
for (const cookie of cookies) {
|
|
287
|
-
const [name, value] = cookie.trim().split("=");
|
|
288
|
-
if (name === "_fbp") {
|
|
289
|
-
return value;
|
|
290
|
-
}
|
|
264
|
+
/**
|
|
265
|
+
* Enhance event parameters with experiment data
|
|
266
|
+
* @param params The original parameters
|
|
267
|
+
* @returns Parameters enhanced with experiment data
|
|
268
|
+
*/
|
|
269
|
+
enhanceWithExperimentParams(params) {
|
|
270
|
+
const experimentParams = this.getExperimentParams();
|
|
271
|
+
return {
|
|
272
|
+
...params,
|
|
273
|
+
experiment: experimentParams
|
|
274
|
+
};
|
|
291
275
|
}
|
|
292
|
-
|
|
293
|
-
}
|
|
276
|
+
};
|
|
294
277
|
|
|
295
278
|
// src/adapters/pixel-adapter.ts
|
|
296
279
|
var PixelAdapter = class extends BaseAdapter {
|
|
@@ -422,8 +405,9 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
422
405
|
*/
|
|
423
406
|
trackPageView(event, adapterParams) {
|
|
424
407
|
const eventName = this.getEventName(adapterParams, "PageView");
|
|
425
|
-
const
|
|
426
|
-
const
|
|
408
|
+
const affiliateParams = this.enhanceWithAffiliateParams({});
|
|
409
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
410
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
427
411
|
if (event.eventId) {
|
|
428
412
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
429
413
|
eventID: event.eventId
|
|
@@ -451,7 +435,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
451
435
|
currency: event.currency || "INR"
|
|
452
436
|
};
|
|
453
437
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
454
|
-
const
|
|
438
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
439
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
455
440
|
if (event.eventId) {
|
|
456
441
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
457
442
|
eventID: event.eventId
|
|
@@ -478,7 +463,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
478
463
|
currency: event.currency || "INR"
|
|
479
464
|
};
|
|
480
465
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
481
|
-
const
|
|
466
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
467
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
482
468
|
if (event.eventId) {
|
|
483
469
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
484
470
|
eventID: event.eventId
|
|
@@ -510,7 +496,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
510
496
|
}))
|
|
511
497
|
};
|
|
512
498
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
513
|
-
const
|
|
499
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
500
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
514
501
|
if (event.eventId) {
|
|
515
502
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
516
503
|
eventID: event.eventId
|
|
@@ -542,7 +529,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
542
529
|
}))
|
|
543
530
|
};
|
|
544
531
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
545
|
-
const
|
|
532
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
533
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
546
534
|
if (event.eventId) {
|
|
547
535
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
548
536
|
eventID: event.eventId
|
|
@@ -567,7 +555,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
567
555
|
content_ids: event.content_ids || []
|
|
568
556
|
};
|
|
569
557
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
570
|
-
const
|
|
558
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
559
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
571
560
|
if (event.eventId) {
|
|
572
561
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
573
562
|
eventID: event.eventId
|
|
@@ -599,7 +588,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
599
588
|
payment_type: event.paymentType || ""
|
|
600
589
|
};
|
|
601
590
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
602
|
-
const
|
|
591
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
592
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
603
593
|
if (event.eventId) {
|
|
604
594
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
605
595
|
eventID: event.eventId
|
|
@@ -627,7 +617,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
627
617
|
currency: event.currency || "INR"
|
|
628
618
|
};
|
|
629
619
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
630
|
-
const
|
|
620
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
621
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
631
622
|
if (event.eventId) {
|
|
632
623
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
633
624
|
eventID: event.eventId
|
|
@@ -655,7 +646,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
655
646
|
contents: event.contents || []
|
|
656
647
|
};
|
|
657
648
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
658
|
-
const
|
|
649
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
650
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
659
651
|
if (event.eventId) {
|
|
660
652
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
661
653
|
eventID: event.eventId
|
|
@@ -825,8 +817,9 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
825
817
|
const eventName = this.getEventName(adapterParams, event.type);
|
|
826
818
|
const baseParams = this.eventToParams(event);
|
|
827
819
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
820
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
828
821
|
const enhancedParams = this.mergeEventData(
|
|
829
|
-
|
|
822
|
+
experimentParams,
|
|
830
823
|
adapterParams
|
|
831
824
|
);
|
|
832
825
|
window.gtag("event", eventName, enhancedParams);
|
|
@@ -865,7 +858,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
865
858
|
session_engaged: event.session_engaged
|
|
866
859
|
};
|
|
867
860
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
868
|
-
const
|
|
861
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
862
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
869
863
|
window.gtag?.("event", eventName, enhancedParams);
|
|
870
864
|
}
|
|
871
865
|
trackUserEngagement(adapterParams) {
|
|
@@ -888,7 +882,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
888
882
|
term: ""
|
|
889
883
|
};
|
|
890
884
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
891
|
-
const
|
|
885
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
886
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
892
887
|
window.gtag?.("event", eventName, enhancedParams);
|
|
893
888
|
}
|
|
894
889
|
trackSessionStart(adapterParams) {
|
|
@@ -913,7 +908,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
913
908
|
term: ""
|
|
914
909
|
};
|
|
915
910
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
916
|
-
const
|
|
911
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
912
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
917
913
|
window.gtag?.("event", eventName, enhancedParams);
|
|
918
914
|
}
|
|
919
915
|
trackFirstVisit(adapterParams) {
|
|
@@ -940,7 +936,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
940
936
|
page_term: ""
|
|
941
937
|
};
|
|
942
938
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
943
|
-
const
|
|
939
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
940
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
944
941
|
window.gtag?.("event", eventName, enhancedParams);
|
|
945
942
|
}
|
|
946
943
|
trackViewItem(event, adapterParams) {
|
|
@@ -951,7 +948,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
951
948
|
items: event.items
|
|
952
949
|
};
|
|
953
950
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
954
|
-
const
|
|
951
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
952
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
955
953
|
window.gtag?.("event", eventName, enhancedParams);
|
|
956
954
|
}
|
|
957
955
|
trackScroll(adapterParams) {
|
|
@@ -971,7 +969,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
971
969
|
// or dynamically captured
|
|
972
970
|
};
|
|
973
971
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
974
|
-
const
|
|
972
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
973
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
975
974
|
window.gtag?.("event", eventName, enhancedParams);
|
|
976
975
|
}
|
|
977
976
|
trackCheckoutPayment(event, adapterParams) {
|
|
@@ -987,7 +986,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
987
986
|
}))
|
|
988
987
|
};
|
|
989
988
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
990
|
-
const
|
|
989
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
990
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
991
991
|
window.gtag?.("event", eventName, enhancedParams);
|
|
992
992
|
}
|
|
993
993
|
trackViewedProduct(event, adapterParams) {
|
|
@@ -1006,7 +1006,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1006
1006
|
view_duration: event.viewDuration
|
|
1007
1007
|
};
|
|
1008
1008
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1009
|
-
const
|
|
1009
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1010
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1010
1011
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1011
1012
|
}
|
|
1012
1013
|
trackAddToCart(event, adapterParams) {
|
|
@@ -1039,7 +1040,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1039
1040
|
user_properties: event.user_properties
|
|
1040
1041
|
};
|
|
1041
1042
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1042
|
-
const
|
|
1043
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1044
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1043
1045
|
this.logger.debug("Sending add_to_cart event to gtag", {
|
|
1044
1046
|
eventName,
|
|
1045
1047
|
params: enhancedParams
|
|
@@ -1067,7 +1069,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1067
1069
|
page_title: document.title
|
|
1068
1070
|
};
|
|
1069
1071
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1070
|
-
const
|
|
1072
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1073
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1071
1074
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1072
1075
|
}
|
|
1073
1076
|
trackCheckoutStarted(event, adapterParams) {
|
|
@@ -1096,7 +1099,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1096
1099
|
}))
|
|
1097
1100
|
};
|
|
1098
1101
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1099
|
-
const
|
|
1102
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1103
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1100
1104
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1101
1105
|
}
|
|
1102
1106
|
trackFormSubmission(event, adapterParams) {
|
|
@@ -1116,7 +1120,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1116
1120
|
page_title: document.title
|
|
1117
1121
|
};
|
|
1118
1122
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1119
|
-
const
|
|
1123
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1124
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1120
1125
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1121
1126
|
}
|
|
1122
1127
|
trackSearch(event, adapterParams) {
|
|
@@ -1134,7 +1139,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1134
1139
|
search_term: event.searchTerm
|
|
1135
1140
|
};
|
|
1136
1141
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1137
|
-
const
|
|
1142
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1143
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1138
1144
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1139
1145
|
}
|
|
1140
1146
|
/**
|
|
@@ -1156,7 +1162,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1156
1162
|
}))
|
|
1157
1163
|
};
|
|
1158
1164
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1159
|
-
const
|
|
1165
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1166
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1160
1167
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1161
1168
|
}
|
|
1162
1169
|
/**
|
|
@@ -1167,7 +1174,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1167
1174
|
const eventName = this.getEventName(adapterParams, event.name);
|
|
1168
1175
|
const baseParams = event.properties || {};
|
|
1169
1176
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1170
|
-
const
|
|
1177
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1178
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1171
1179
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1172
1180
|
}
|
|
1173
1181
|
/**
|
|
@@ -1189,7 +1197,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1189
1197
|
}))
|
|
1190
1198
|
};
|
|
1191
1199
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1192
|
-
const
|
|
1200
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1201
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1193
1202
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1194
1203
|
}
|
|
1195
1204
|
/**
|
|
@@ -1228,7 +1237,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1228
1237
|
user_properties: event.user_properties
|
|
1229
1238
|
};
|
|
1230
1239
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1231
|
-
const
|
|
1240
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1241
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1232
1242
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1233
1243
|
}
|
|
1234
1244
|
/**
|
|
@@ -1271,7 +1281,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1271
1281
|
user_properties: event.user_properties
|
|
1272
1282
|
};
|
|
1273
1283
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1274
|
-
const
|
|
1284
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1285
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1275
1286
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1276
1287
|
}
|
|
1277
1288
|
/**
|
|
@@ -1296,7 +1307,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1296
1307
|
user_properties: event.user_properties
|
|
1297
1308
|
};
|
|
1298
1309
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1299
|
-
const
|
|
1310
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1311
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1300
1312
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1301
1313
|
}
|
|
1302
1314
|
/**
|
|
@@ -1332,7 +1344,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1332
1344
|
user_properties: event.user_properties
|
|
1333
1345
|
};
|
|
1334
1346
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1335
|
-
const
|
|
1347
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1348
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1336
1349
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1337
1350
|
}
|
|
1338
1351
|
/**
|
|
@@ -1372,7 +1385,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1372
1385
|
user_properties: event.user_properties
|
|
1373
1386
|
};
|
|
1374
1387
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1375
|
-
const
|
|
1388
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1389
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1376
1390
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1377
1391
|
}
|
|
1378
1392
|
/**
|
|
@@ -1381,7 +1395,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1381
1395
|
*/
|
|
1382
1396
|
eventToParams(event) {
|
|
1383
1397
|
const { type, timestamp, ...params } = event;
|
|
1384
|
-
|
|
1398
|
+
const affiliateParams = this.enhanceWithAffiliateParams(params);
|
|
1399
|
+
return this.enhanceWithExperimentParams(affiliateParams);
|
|
1385
1400
|
}
|
|
1386
1401
|
};
|
|
1387
1402
|
|
|
@@ -1519,7 +1534,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1519
1534
|
default:
|
|
1520
1535
|
const eventName = this.getEventName(adapterParams, event.type);
|
|
1521
1536
|
const baseParams = this.eventToParams(event);
|
|
1522
|
-
const
|
|
1537
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1538
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1539
|
+
const enhancedParams = this.mergeEventData(
|
|
1540
|
+
experimentParams,
|
|
1541
|
+
adapterParams
|
|
1542
|
+
);
|
|
1523
1543
|
this.sdk.track_event(eventName, enhancedParams);
|
|
1524
1544
|
break;
|
|
1525
1545
|
}
|
|
@@ -1541,7 +1561,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1541
1561
|
page_url: window.location.href,
|
|
1542
1562
|
referrer: event.referrer || document.referrer
|
|
1543
1563
|
};
|
|
1544
|
-
const
|
|
1564
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1565
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1566
|
+
const enhancedEventData = this.mergeEventData(
|
|
1567
|
+
experimentParams,
|
|
1568
|
+
adapterParams
|
|
1569
|
+
);
|
|
1545
1570
|
this.sdk.track_event(eventName, enhancedEventData);
|
|
1546
1571
|
this.logger.debug("PageView event tracked", {
|
|
1547
1572
|
eventName,
|
|
@@ -1563,7 +1588,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1563
1588
|
button_text: event.buttonText,
|
|
1564
1589
|
location: event.location
|
|
1565
1590
|
};
|
|
1566
|
-
const
|
|
1591
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1592
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1593
|
+
const enhancedEventData = this.mergeEventData(
|
|
1594
|
+
experimentParams,
|
|
1595
|
+
adapterParams
|
|
1596
|
+
);
|
|
1567
1597
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1568
1598
|
}
|
|
1569
1599
|
/**
|
|
@@ -1581,7 +1611,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1581
1611
|
form_name: event.formName,
|
|
1582
1612
|
success: event.success
|
|
1583
1613
|
};
|
|
1584
|
-
const
|
|
1614
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1615
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1616
|
+
const enhancedEventData = this.mergeEventData(
|
|
1617
|
+
experimentParams,
|
|
1618
|
+
adapterParams
|
|
1619
|
+
);
|
|
1585
1620
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1586
1621
|
}
|
|
1587
1622
|
/**
|
|
@@ -1601,7 +1636,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1601
1636
|
currency: event.currency || DEFAULT_CURRENCY,
|
|
1602
1637
|
category: event.category
|
|
1603
1638
|
};
|
|
1604
|
-
const
|
|
1639
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1640
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1641
|
+
const enhancedEventData = this.mergeEventData(
|
|
1642
|
+
experimentParams,
|
|
1643
|
+
adapterParams
|
|
1644
|
+
);
|
|
1605
1645
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1606
1646
|
}
|
|
1607
1647
|
/**
|
|
@@ -1624,7 +1664,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1624
1664
|
variant: event.variant,
|
|
1625
1665
|
total_value: event.price * quantity
|
|
1626
1666
|
};
|
|
1627
|
-
const
|
|
1667
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1668
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1669
|
+
const enhancedEventData = this.mergeEventData(
|
|
1670
|
+
experimentParams,
|
|
1671
|
+
adapterParams
|
|
1672
|
+
);
|
|
1628
1673
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1629
1674
|
}
|
|
1630
1675
|
/**
|
|
@@ -1646,7 +1691,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1646
1691
|
variant: event.variant,
|
|
1647
1692
|
total_value: event.price * event.quantity
|
|
1648
1693
|
};
|
|
1649
|
-
const
|
|
1694
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1695
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1696
|
+
const enhancedEventData = this.mergeEventData(
|
|
1697
|
+
experimentParams,
|
|
1698
|
+
adapterParams
|
|
1699
|
+
);
|
|
1650
1700
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1651
1701
|
}
|
|
1652
1702
|
/**
|
|
@@ -1671,7 +1721,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1671
1721
|
variant: item.variant
|
|
1672
1722
|
}))
|
|
1673
1723
|
};
|
|
1674
|
-
const
|
|
1724
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1725
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1726
|
+
const enhancedEventData = this.mergeEventData(
|
|
1727
|
+
experimentParams,
|
|
1728
|
+
adapterParams
|
|
1729
|
+
);
|
|
1675
1730
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1676
1731
|
}
|
|
1677
1732
|
/**
|
|
@@ -1697,7 +1752,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1697
1752
|
variant: item.variant
|
|
1698
1753
|
}))
|
|
1699
1754
|
};
|
|
1700
|
-
const
|
|
1755
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1756
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1757
|
+
const enhancedEventData = this.mergeEventData(
|
|
1758
|
+
experimentParams,
|
|
1759
|
+
adapterParams
|
|
1760
|
+
);
|
|
1701
1761
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1702
1762
|
}
|
|
1703
1763
|
/**
|
|
@@ -1711,7 +1771,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1711
1771
|
search_term: event.searchTerm,
|
|
1712
1772
|
results_count: event.resultsCount
|
|
1713
1773
|
};
|
|
1714
|
-
const
|
|
1774
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1775
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1776
|
+
const enhancedEventData = this.mergeEventData(
|
|
1777
|
+
experimentParams,
|
|
1778
|
+
adapterParams
|
|
1779
|
+
);
|
|
1715
1780
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1716
1781
|
}
|
|
1717
1782
|
/**
|
|
@@ -1729,7 +1794,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1729
1794
|
method: event.method,
|
|
1730
1795
|
success: event.success
|
|
1731
1796
|
};
|
|
1732
|
-
const
|
|
1797
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1798
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1799
|
+
const enhancedEventData = this.mergeEventData(
|
|
1800
|
+
experimentParams,
|
|
1801
|
+
adapterParams
|
|
1802
|
+
);
|
|
1733
1803
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1734
1804
|
if (event.userId && this.getConfig("enableUserIdentification", true)) {
|
|
1735
1805
|
this.sdk?.add_unique_user_id(event.userId);
|
|
@@ -1750,7 +1820,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1750
1820
|
method: event.method,
|
|
1751
1821
|
success: event.success
|
|
1752
1822
|
};
|
|
1753
|
-
const
|
|
1823
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1824
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1825
|
+
const enhancedEventData = this.mergeEventData(
|
|
1826
|
+
experimentParams,
|
|
1827
|
+
adapterParams
|
|
1828
|
+
);
|
|
1754
1829
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1755
1830
|
if (event.userId && this.getConfig("enableUserIdentification", true)) {
|
|
1756
1831
|
this.sdk?.add_unique_user_id(event.userId);
|
|
@@ -1764,7 +1839,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1764
1839
|
trackCustomEvent(event, adapterParams) {
|
|
1765
1840
|
const eventName = this.getEventName(adapterParams, event.name);
|
|
1766
1841
|
const baseEventData = event.properties || {};
|
|
1767
|
-
const
|
|
1842
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1843
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1844
|
+
const enhancedEventData = this.mergeEventData(
|
|
1845
|
+
experimentParams,
|
|
1846
|
+
adapterParams
|
|
1847
|
+
);
|
|
1768
1848
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1769
1849
|
}
|
|
1770
1850
|
/**
|
|
@@ -1894,8 +1974,9 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1894
1974
|
const eventName = this.getEventName(adapterParams, event.type);
|
|
1895
1975
|
const baseParams = this.eventToParams(event);
|
|
1896
1976
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1977
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1897
1978
|
const enhancedParams = this.mergeEventData(
|
|
1898
|
-
|
|
1979
|
+
experimentParams,
|
|
1899
1980
|
adapterParams
|
|
1900
1981
|
);
|
|
1901
1982
|
window.posthog?.capture(eventName, enhancedParams);
|
|
@@ -1915,7 +1996,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1915
1996
|
referrer: event.referrer
|
|
1916
1997
|
};
|
|
1917
1998
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1918
|
-
const
|
|
1999
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2000
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1919
2001
|
window.posthog?.capture(eventName, enhancedParams);
|
|
1920
2002
|
}
|
|
1921
2003
|
/**
|
|
@@ -1933,7 +2015,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1933
2015
|
currency: event.currency || "INR"
|
|
1934
2016
|
};
|
|
1935
2017
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1936
|
-
const
|
|
2018
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2019
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1937
2020
|
window.posthog?.capture(eventName, enhancedParams);
|
|
1938
2021
|
}
|
|
1939
2022
|
/**
|
|
@@ -1953,7 +2036,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1953
2036
|
variant: event.variant
|
|
1954
2037
|
};
|
|
1955
2038
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1956
|
-
const
|
|
2039
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2040
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1957
2041
|
this.logger.debug("Sending to PostHog with params", {
|
|
1958
2042
|
eventName,
|
|
1959
2043
|
params: enhancedParams
|
|
@@ -1985,7 +2069,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1985
2069
|
}))
|
|
1986
2070
|
};
|
|
1987
2071
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1988
|
-
const
|
|
2072
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2073
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1989
2074
|
window.posthog?.capture(eventName, enhancedParams);
|
|
1990
2075
|
}
|
|
1991
2076
|
/**
|
|
@@ -2009,7 +2094,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2009
2094
|
}))
|
|
2010
2095
|
};
|
|
2011
2096
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2012
|
-
const
|
|
2097
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2098
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2013
2099
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2014
2100
|
}
|
|
2015
2101
|
/**
|
|
@@ -2025,7 +2111,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2025
2111
|
content_ids: event.content_ids
|
|
2026
2112
|
};
|
|
2027
2113
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2028
|
-
const
|
|
2114
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2115
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2029
2116
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2030
2117
|
}
|
|
2031
2118
|
/**
|
|
@@ -2049,7 +2136,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2049
2136
|
}))
|
|
2050
2137
|
};
|
|
2051
2138
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2052
|
-
const
|
|
2139
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2140
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2053
2141
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2054
2142
|
}
|
|
2055
2143
|
/**
|
|
@@ -2174,7 +2262,7 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2174
2262
|
shopId: `gid://shopify/Shop/${this.shopId}`,
|
|
2175
2263
|
currency: this.currency,
|
|
2176
2264
|
acceptedLanguage: DEFAULT_LANGUAGE,
|
|
2177
|
-
...this.enhanceWithAffiliateParams({})
|
|
2265
|
+
...this.enhanceWithExperimentParams(this.enhanceWithAffiliateParams({}))
|
|
2178
2266
|
};
|
|
2179
2267
|
}
|
|
2180
2268
|
/**
|
|
@@ -2195,17 +2283,19 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2195
2283
|
eventData: event,
|
|
2196
2284
|
adapterParams: params
|
|
2197
2285
|
});
|
|
2286
|
+
const affiliateParams = this.enhanceWithAffiliateParams(event);
|
|
2287
|
+
const enhancedEvent = this.enhanceWithExperimentParams(affiliateParams);
|
|
2198
2288
|
try {
|
|
2199
2289
|
switch (event.type) {
|
|
2200
2290
|
case "page_view" /* PAGE_VIEW */:
|
|
2201
|
-
const pageViewPayload = this.mergeEventData(
|
|
2291
|
+
const pageViewPayload = this.mergeEventData(enhancedEvent, params);
|
|
2202
2292
|
this.sendPageView(AnalyticsEventName.PAGE_VIEW, pageViewPayload);
|
|
2203
2293
|
this.logger.debug("Sent PAGE_VIEW event to Shopify Analytics", {
|
|
2204
2294
|
payload: pageViewPayload
|
|
2205
2295
|
});
|
|
2206
2296
|
break;
|
|
2207
2297
|
case "view_content" /* VIEW_CONTENT */:
|
|
2208
|
-
const viewContentPayload = this.mergeEventData(
|
|
2298
|
+
const viewContentPayload = this.mergeEventData(enhancedEvent, params);
|
|
2209
2299
|
this.sendPageView(
|
|
2210
2300
|
AnalyticsEventName.PRODUCT_VIEW,
|
|
2211
2301
|
viewContentPayload
|
|
@@ -2215,15 +2305,13 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2215
2305
|
});
|
|
2216
2306
|
break;
|
|
2217
2307
|
case "add_to_cart" /* ADD_TO_CART */:
|
|
2218
|
-
const
|
|
2219
|
-
this.trackAddToCart(
|
|
2308
|
+
const addToCartPayload = this.mergeEventData(enhancedEvent, params);
|
|
2309
|
+
this.trackAddToCart(addToCartPayload);
|
|
2220
2310
|
break;
|
|
2221
2311
|
case "checkout_started" /* CHECKOUT_STARTED */:
|
|
2222
2312
|
case "begin_checkout" /* BEGIN_CHECKOUT */:
|
|
2223
2313
|
const checkoutPayload = this.mergeEventData(
|
|
2224
|
-
{
|
|
2225
|
-
pageType: "checkout"
|
|
2226
|
-
},
|
|
2314
|
+
{ ...enhancedEvent, pageType: "checkout" },
|
|
2227
2315
|
params
|
|
2228
2316
|
);
|
|
2229
2317
|
this.sendPageView(AnalyticsEventName.PAGE_VIEW, checkoutPayload);
|
|
@@ -2371,9 +2459,10 @@ var KwikPassAdapter = class extends BaseAdapter {
|
|
|
2371
2459
|
});
|
|
2372
2460
|
return;
|
|
2373
2461
|
}
|
|
2462
|
+
const affiliateParams = this.enhanceWithAffiliateParams(event);
|
|
2463
|
+
const enhancedEvent = this.enhanceWithExperimentParams(affiliateParams);
|
|
2374
2464
|
try {
|
|
2375
2465
|
this.logger.debug("Processing event", { eventType: event.type });
|
|
2376
|
-
const enhancedEvent = this.enhanceWithAffiliateParams(event);
|
|
2377
2466
|
switch (event.type) {
|
|
2378
2467
|
case "product_view" /* PRODUCT_VIEW */:
|
|
2379
2468
|
this.trackProductView(enhancedEvent, adapterParams);
|
|
@@ -2507,7 +2596,8 @@ var KwikCheckoutAdapter = class extends BaseAdapter {
|
|
|
2507
2596
|
}
|
|
2508
2597
|
try {
|
|
2509
2598
|
this.logger.debug("Processing event", { eventType: event.type });
|
|
2510
|
-
const
|
|
2599
|
+
const affiliateEnhanced = this.enhanceWithAffiliateParams(event);
|
|
2600
|
+
const enhancedEvent = this.enhanceWithExperimentParams(affiliateEnhanced);
|
|
2511
2601
|
switch (event.type) {
|
|
2512
2602
|
case "started_checkout_gk" /* STARTED_CHECKOUT_GK */:
|
|
2513
2603
|
this.trackStartedCheckoutGK(enhancedEvent, adapterParams);
|
|
@@ -2809,4 +2899,4 @@ export {
|
|
|
2809
2899
|
KwikPassAdapter,
|
|
2810
2900
|
KwikCheckoutAdapter
|
|
2811
2901
|
};
|
|
2812
|
-
//# sourceMappingURL=chunk-
|
|
2902
|
+
//# sourceMappingURL=chunk-NJQ2MOM2.mjs.map
|