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
package/dist/adapters/index.js
CHANGED
|
@@ -182,6 +182,38 @@ function createAdapterLogger(adapterName, config = {}) {
|
|
|
182
182
|
return baseLogger.child({ adapter: adapterName });
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
// src/experiment/constants.ts
|
|
186
|
+
var PRIMA_EXPERIMENT_COOKIES = {
|
|
187
|
+
HOME: "_prima_pr_ab_home",
|
|
188
|
+
COLLECTION: "_prima_pr_ab_collection",
|
|
189
|
+
PRODUCT: "_prima_pr_ab_product"
|
|
190
|
+
};
|
|
191
|
+
var PRIMA_EXPERIMENT_COOKIE_NAMES = Object.values(
|
|
192
|
+
PRIMA_EXPERIMENT_COOKIES
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
// src/experiment/experiment-tracker.ts
|
|
196
|
+
function getCookie(name) {
|
|
197
|
+
if (typeof document === "undefined") return null;
|
|
198
|
+
const value = `; ${document.cookie}`;
|
|
199
|
+
const parts = value.split(`; ${name}=`);
|
|
200
|
+
if (parts.length === 2) {
|
|
201
|
+
return parts.pop()?.split(";").shift() || null;
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
function getExperimentParams() {
|
|
206
|
+
return {
|
|
207
|
+
[PRIMA_EXPERIMENT_COOKIES.HOME]: getCookie(PRIMA_EXPERIMENT_COOKIES.HOME),
|
|
208
|
+
[PRIMA_EXPERIMENT_COOKIES.COLLECTION]: getCookie(
|
|
209
|
+
PRIMA_EXPERIMENT_COOKIES.COLLECTION
|
|
210
|
+
),
|
|
211
|
+
[PRIMA_EXPERIMENT_COOKIES.PRODUCT]: getCookie(
|
|
212
|
+
PRIMA_EXPERIMENT_COOKIES.PRODUCT
|
|
213
|
+
)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
185
217
|
// src/adapters/base-adapter.ts
|
|
186
218
|
var BaseAdapter = class {
|
|
187
219
|
/**
|
|
@@ -267,6 +299,21 @@ var BaseAdapter = class {
|
|
|
267
299
|
getAffiliateParams() {
|
|
268
300
|
return null;
|
|
269
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* Get experiment parameters from cookies
|
|
304
|
+
* @returns Experiment parameters
|
|
305
|
+
*/
|
|
306
|
+
getExperimentParams() {
|
|
307
|
+
try {
|
|
308
|
+
return getExperimentParams();
|
|
309
|
+
} catch (error) {
|
|
310
|
+
return {
|
|
311
|
+
_prima_pr_ab_home: null,
|
|
312
|
+
_prima_pr_ab_collection: null,
|
|
313
|
+
_prima_pr_ab_product: null
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
270
317
|
/**
|
|
271
318
|
* Enhance event parameters with affiliate data
|
|
272
319
|
* @param params The original parameters
|
|
@@ -281,6 +328,18 @@ var BaseAdapter = class {
|
|
|
281
328
|
...affiliateParams
|
|
282
329
|
};
|
|
283
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Enhance event parameters with experiment data
|
|
333
|
+
* @param params The original parameters
|
|
334
|
+
* @returns Parameters enhanced with experiment data
|
|
335
|
+
*/
|
|
336
|
+
enhanceWithExperimentParams(params) {
|
|
337
|
+
const experimentParams = this.getExperimentParams();
|
|
338
|
+
return {
|
|
339
|
+
...params,
|
|
340
|
+
experiment: experimentParams
|
|
341
|
+
};
|
|
342
|
+
}
|
|
284
343
|
};
|
|
285
344
|
|
|
286
345
|
// src/utils/event-id.ts
|
|
@@ -464,8 +523,9 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
464
523
|
*/
|
|
465
524
|
trackPageView(event, adapterParams) {
|
|
466
525
|
const eventName = this.getEventName(adapterParams, "PageView");
|
|
467
|
-
const
|
|
468
|
-
const
|
|
526
|
+
const affiliateParams = this.enhanceWithAffiliateParams({});
|
|
527
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
528
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
469
529
|
if (event.eventId) {
|
|
470
530
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
471
531
|
eventID: event.eventId
|
|
@@ -493,7 +553,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
493
553
|
currency: event.currency || "INR"
|
|
494
554
|
};
|
|
495
555
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
496
|
-
const
|
|
556
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
557
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
497
558
|
if (event.eventId) {
|
|
498
559
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
499
560
|
eventID: event.eventId
|
|
@@ -520,7 +581,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
520
581
|
currency: event.currency || "INR"
|
|
521
582
|
};
|
|
522
583
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
523
|
-
const
|
|
584
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
585
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
524
586
|
if (event.eventId) {
|
|
525
587
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
526
588
|
eventID: event.eventId
|
|
@@ -552,7 +614,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
552
614
|
}))
|
|
553
615
|
};
|
|
554
616
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
555
|
-
const
|
|
617
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
618
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
556
619
|
if (event.eventId) {
|
|
557
620
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
558
621
|
eventID: event.eventId
|
|
@@ -584,7 +647,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
584
647
|
}))
|
|
585
648
|
};
|
|
586
649
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
587
|
-
const
|
|
650
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
651
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
588
652
|
if (event.eventId) {
|
|
589
653
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
590
654
|
eventID: event.eventId
|
|
@@ -609,7 +673,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
609
673
|
content_ids: event.content_ids || []
|
|
610
674
|
};
|
|
611
675
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
612
|
-
const
|
|
676
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
677
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
613
678
|
if (event.eventId) {
|
|
614
679
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
615
680
|
eventID: event.eventId
|
|
@@ -641,7 +706,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
641
706
|
payment_type: event.paymentType || ""
|
|
642
707
|
};
|
|
643
708
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
644
|
-
const
|
|
709
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
710
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
645
711
|
if (event.eventId) {
|
|
646
712
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
647
713
|
eventID: event.eventId
|
|
@@ -669,7 +735,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
669
735
|
currency: event.currency || "INR"
|
|
670
736
|
};
|
|
671
737
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
672
|
-
const
|
|
738
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
739
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
673
740
|
if (event.eventId) {
|
|
674
741
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
675
742
|
eventID: event.eventId
|
|
@@ -697,7 +764,8 @@ var PixelAdapter = class extends BaseAdapter {
|
|
|
697
764
|
contents: event.contents || []
|
|
698
765
|
};
|
|
699
766
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
700
|
-
const
|
|
767
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
768
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
701
769
|
if (event.eventId) {
|
|
702
770
|
window.fbq?.("track", eventName, enhancedParams, {
|
|
703
771
|
eventID: event.eventId
|
|
@@ -867,8 +935,9 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
867
935
|
const eventName = this.getEventName(adapterParams, event.type);
|
|
868
936
|
const baseParams = this.eventToParams(event);
|
|
869
937
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
938
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
870
939
|
const enhancedParams = this.mergeEventData(
|
|
871
|
-
|
|
940
|
+
experimentParams,
|
|
872
941
|
adapterParams
|
|
873
942
|
);
|
|
874
943
|
window.gtag("event", eventName, enhancedParams);
|
|
@@ -907,7 +976,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
907
976
|
session_engaged: event.session_engaged
|
|
908
977
|
};
|
|
909
978
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
910
|
-
const
|
|
979
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
980
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
911
981
|
window.gtag?.("event", eventName, enhancedParams);
|
|
912
982
|
}
|
|
913
983
|
trackUserEngagement(adapterParams) {
|
|
@@ -930,7 +1000,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
930
1000
|
term: ""
|
|
931
1001
|
};
|
|
932
1002
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
933
|
-
const
|
|
1003
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1004
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
934
1005
|
window.gtag?.("event", eventName, enhancedParams);
|
|
935
1006
|
}
|
|
936
1007
|
trackSessionStart(adapterParams) {
|
|
@@ -955,7 +1026,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
955
1026
|
term: ""
|
|
956
1027
|
};
|
|
957
1028
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
958
|
-
const
|
|
1029
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1030
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
959
1031
|
window.gtag?.("event", eventName, enhancedParams);
|
|
960
1032
|
}
|
|
961
1033
|
trackFirstVisit(adapterParams) {
|
|
@@ -982,7 +1054,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
982
1054
|
page_term: ""
|
|
983
1055
|
};
|
|
984
1056
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
985
|
-
const
|
|
1057
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1058
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
986
1059
|
window.gtag?.("event", eventName, enhancedParams);
|
|
987
1060
|
}
|
|
988
1061
|
trackViewItem(event, adapterParams) {
|
|
@@ -993,7 +1066,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
993
1066
|
items: event.items
|
|
994
1067
|
};
|
|
995
1068
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
996
|
-
const
|
|
1069
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1070
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
997
1071
|
window.gtag?.("event", eventName, enhancedParams);
|
|
998
1072
|
}
|
|
999
1073
|
trackScroll(adapterParams) {
|
|
@@ -1013,7 +1087,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1013
1087
|
// or dynamically captured
|
|
1014
1088
|
};
|
|
1015
1089
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1016
|
-
const
|
|
1090
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1091
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1017
1092
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1018
1093
|
}
|
|
1019
1094
|
trackCheckoutPayment(event, adapterParams) {
|
|
@@ -1029,7 +1104,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1029
1104
|
}))
|
|
1030
1105
|
};
|
|
1031
1106
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1032
|
-
const
|
|
1107
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1108
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1033
1109
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1034
1110
|
}
|
|
1035
1111
|
trackViewedProduct(event, adapterParams) {
|
|
@@ -1048,7 +1124,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1048
1124
|
view_duration: event.viewDuration
|
|
1049
1125
|
};
|
|
1050
1126
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1051
|
-
const
|
|
1127
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1128
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1052
1129
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1053
1130
|
}
|
|
1054
1131
|
trackAddToCart(event, adapterParams) {
|
|
@@ -1081,7 +1158,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1081
1158
|
user_properties: event.user_properties
|
|
1082
1159
|
};
|
|
1083
1160
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1084
|
-
const
|
|
1161
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1162
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1085
1163
|
this.logger.debug("Sending add_to_cart event to gtag", {
|
|
1086
1164
|
eventName,
|
|
1087
1165
|
params: enhancedParams
|
|
@@ -1109,7 +1187,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1109
1187
|
page_title: document.title
|
|
1110
1188
|
};
|
|
1111
1189
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1112
|
-
const
|
|
1190
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1191
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1113
1192
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1114
1193
|
}
|
|
1115
1194
|
trackCheckoutStarted(event, adapterParams) {
|
|
@@ -1138,7 +1217,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1138
1217
|
}))
|
|
1139
1218
|
};
|
|
1140
1219
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1141
|
-
const
|
|
1220
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1221
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1142
1222
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1143
1223
|
}
|
|
1144
1224
|
trackFormSubmission(event, adapterParams) {
|
|
@@ -1158,7 +1238,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1158
1238
|
page_title: document.title
|
|
1159
1239
|
};
|
|
1160
1240
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1161
|
-
const
|
|
1241
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1242
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1162
1243
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1163
1244
|
}
|
|
1164
1245
|
trackSearch(event, adapterParams) {
|
|
@@ -1176,7 +1257,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1176
1257
|
search_term: event.searchTerm
|
|
1177
1258
|
};
|
|
1178
1259
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1179
|
-
const
|
|
1260
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1261
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1180
1262
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1181
1263
|
}
|
|
1182
1264
|
/**
|
|
@@ -1198,7 +1280,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1198
1280
|
}))
|
|
1199
1281
|
};
|
|
1200
1282
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1201
|
-
const
|
|
1283
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1284
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1202
1285
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1203
1286
|
}
|
|
1204
1287
|
/**
|
|
@@ -1209,7 +1292,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1209
1292
|
const eventName = this.getEventName(adapterParams, event.name);
|
|
1210
1293
|
const baseParams = event.properties || {};
|
|
1211
1294
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1212
|
-
const
|
|
1295
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1296
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1213
1297
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1214
1298
|
}
|
|
1215
1299
|
/**
|
|
@@ -1231,7 +1315,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1231
1315
|
}))
|
|
1232
1316
|
};
|
|
1233
1317
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1234
|
-
const
|
|
1318
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1319
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1235
1320
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1236
1321
|
}
|
|
1237
1322
|
/**
|
|
@@ -1270,7 +1355,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1270
1355
|
user_properties: event.user_properties
|
|
1271
1356
|
};
|
|
1272
1357
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1273
|
-
const
|
|
1358
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1359
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1274
1360
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1275
1361
|
}
|
|
1276
1362
|
/**
|
|
@@ -1313,7 +1399,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1313
1399
|
user_properties: event.user_properties
|
|
1314
1400
|
};
|
|
1315
1401
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1316
|
-
const
|
|
1402
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1403
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1317
1404
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1318
1405
|
}
|
|
1319
1406
|
/**
|
|
@@ -1338,7 +1425,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1338
1425
|
user_properties: event.user_properties
|
|
1339
1426
|
};
|
|
1340
1427
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1341
|
-
const
|
|
1428
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1429
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1342
1430
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1343
1431
|
}
|
|
1344
1432
|
/**
|
|
@@ -1374,7 +1462,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1374
1462
|
user_properties: event.user_properties
|
|
1375
1463
|
};
|
|
1376
1464
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1377
|
-
const
|
|
1465
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1466
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1378
1467
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1379
1468
|
}
|
|
1380
1469
|
/**
|
|
@@ -1414,7 +1503,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1414
1503
|
user_properties: event.user_properties
|
|
1415
1504
|
};
|
|
1416
1505
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1417
|
-
const
|
|
1506
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1507
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1418
1508
|
window.gtag?.("event", eventName, enhancedParams);
|
|
1419
1509
|
}
|
|
1420
1510
|
/**
|
|
@@ -1423,7 +1513,8 @@ var GoogleAdapter = class extends BaseAdapter {
|
|
|
1423
1513
|
*/
|
|
1424
1514
|
eventToParams(event) {
|
|
1425
1515
|
const { type, timestamp, ...params } = event;
|
|
1426
|
-
|
|
1516
|
+
const affiliateParams = this.enhanceWithAffiliateParams(params);
|
|
1517
|
+
return this.enhanceWithExperimentParams(affiliateParams);
|
|
1427
1518
|
}
|
|
1428
1519
|
};
|
|
1429
1520
|
|
|
@@ -1561,7 +1652,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1561
1652
|
default:
|
|
1562
1653
|
const eventName = this.getEventName(adapterParams, event.type);
|
|
1563
1654
|
const baseParams = this.eventToParams(event);
|
|
1564
|
-
const
|
|
1655
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1656
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1657
|
+
const enhancedParams = this.mergeEventData(
|
|
1658
|
+
experimentParams,
|
|
1659
|
+
adapterParams
|
|
1660
|
+
);
|
|
1565
1661
|
this.sdk.track_event(eventName, enhancedParams);
|
|
1566
1662
|
break;
|
|
1567
1663
|
}
|
|
@@ -1583,7 +1679,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1583
1679
|
page_url: window.location.href,
|
|
1584
1680
|
referrer: event.referrer || document.referrer
|
|
1585
1681
|
};
|
|
1586
|
-
const
|
|
1682
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1683
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1684
|
+
const enhancedEventData = this.mergeEventData(
|
|
1685
|
+
experimentParams,
|
|
1686
|
+
adapterParams
|
|
1687
|
+
);
|
|
1587
1688
|
this.sdk.track_event(eventName, enhancedEventData);
|
|
1588
1689
|
this.logger.debug("PageView event tracked", {
|
|
1589
1690
|
eventName,
|
|
@@ -1605,7 +1706,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1605
1706
|
button_text: event.buttonText,
|
|
1606
1707
|
location: event.location
|
|
1607
1708
|
};
|
|
1608
|
-
const
|
|
1709
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1710
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1711
|
+
const enhancedEventData = this.mergeEventData(
|
|
1712
|
+
experimentParams,
|
|
1713
|
+
adapterParams
|
|
1714
|
+
);
|
|
1609
1715
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1610
1716
|
}
|
|
1611
1717
|
/**
|
|
@@ -1623,7 +1729,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1623
1729
|
form_name: event.formName,
|
|
1624
1730
|
success: event.success
|
|
1625
1731
|
};
|
|
1626
|
-
const
|
|
1732
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1733
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1734
|
+
const enhancedEventData = this.mergeEventData(
|
|
1735
|
+
experimentParams,
|
|
1736
|
+
adapterParams
|
|
1737
|
+
);
|
|
1627
1738
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1628
1739
|
}
|
|
1629
1740
|
/**
|
|
@@ -1643,7 +1754,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1643
1754
|
currency: event.currency || DEFAULT_CURRENCY,
|
|
1644
1755
|
category: event.category
|
|
1645
1756
|
};
|
|
1646
|
-
const
|
|
1757
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1758
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1759
|
+
const enhancedEventData = this.mergeEventData(
|
|
1760
|
+
experimentParams,
|
|
1761
|
+
adapterParams
|
|
1762
|
+
);
|
|
1647
1763
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1648
1764
|
}
|
|
1649
1765
|
/**
|
|
@@ -1666,7 +1782,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1666
1782
|
variant: event.variant,
|
|
1667
1783
|
total_value: event.price * quantity
|
|
1668
1784
|
};
|
|
1669
|
-
const
|
|
1785
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1786
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1787
|
+
const enhancedEventData = this.mergeEventData(
|
|
1788
|
+
experimentParams,
|
|
1789
|
+
adapterParams
|
|
1790
|
+
);
|
|
1670
1791
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1671
1792
|
}
|
|
1672
1793
|
/**
|
|
@@ -1688,7 +1809,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1688
1809
|
variant: event.variant,
|
|
1689
1810
|
total_value: event.price * event.quantity
|
|
1690
1811
|
};
|
|
1691
|
-
const
|
|
1812
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1813
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1814
|
+
const enhancedEventData = this.mergeEventData(
|
|
1815
|
+
experimentParams,
|
|
1816
|
+
adapterParams
|
|
1817
|
+
);
|
|
1692
1818
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1693
1819
|
}
|
|
1694
1820
|
/**
|
|
@@ -1713,7 +1839,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1713
1839
|
variant: item.variant
|
|
1714
1840
|
}))
|
|
1715
1841
|
};
|
|
1716
|
-
const
|
|
1842
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1843
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1844
|
+
const enhancedEventData = this.mergeEventData(
|
|
1845
|
+
experimentParams,
|
|
1846
|
+
adapterParams
|
|
1847
|
+
);
|
|
1717
1848
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1718
1849
|
}
|
|
1719
1850
|
/**
|
|
@@ -1739,7 +1870,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1739
1870
|
variant: item.variant
|
|
1740
1871
|
}))
|
|
1741
1872
|
};
|
|
1742
|
-
const
|
|
1873
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1874
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1875
|
+
const enhancedEventData = this.mergeEventData(
|
|
1876
|
+
experimentParams,
|
|
1877
|
+
adapterParams
|
|
1878
|
+
);
|
|
1743
1879
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1744
1880
|
}
|
|
1745
1881
|
/**
|
|
@@ -1753,7 +1889,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1753
1889
|
search_term: event.searchTerm,
|
|
1754
1890
|
results_count: event.resultsCount
|
|
1755
1891
|
};
|
|
1756
|
-
const
|
|
1892
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1893
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1894
|
+
const enhancedEventData = this.mergeEventData(
|
|
1895
|
+
experimentParams,
|
|
1896
|
+
adapterParams
|
|
1897
|
+
);
|
|
1757
1898
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1758
1899
|
}
|
|
1759
1900
|
/**
|
|
@@ -1771,7 +1912,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1771
1912
|
method: event.method,
|
|
1772
1913
|
success: event.success
|
|
1773
1914
|
};
|
|
1774
|
-
const
|
|
1915
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1916
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1917
|
+
const enhancedEventData = this.mergeEventData(
|
|
1918
|
+
experimentParams,
|
|
1919
|
+
adapterParams
|
|
1920
|
+
);
|
|
1775
1921
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1776
1922
|
if (event.userId && this.getConfig("enableUserIdentification", true)) {
|
|
1777
1923
|
this.sdk?.add_unique_user_id(event.userId);
|
|
@@ -1792,7 +1938,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1792
1938
|
method: event.method,
|
|
1793
1939
|
success: event.success
|
|
1794
1940
|
};
|
|
1795
|
-
const
|
|
1941
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1942
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1943
|
+
const enhancedEventData = this.mergeEventData(
|
|
1944
|
+
experimentParams,
|
|
1945
|
+
adapterParams
|
|
1946
|
+
);
|
|
1796
1947
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1797
1948
|
if (event.userId && this.getConfig("enableUserIdentification", true)) {
|
|
1798
1949
|
this.sdk?.add_unique_user_id(event.userId);
|
|
@@ -1806,7 +1957,12 @@ var MoengageAdapter = class extends BaseAdapter {
|
|
|
1806
1957
|
trackCustomEvent(event, adapterParams) {
|
|
1807
1958
|
const eventName = this.getEventName(adapterParams, event.name);
|
|
1808
1959
|
const baseEventData = event.properties || {};
|
|
1809
|
-
const
|
|
1960
|
+
const affiliateParams = this.enhanceWithAffiliateParams(baseEventData);
|
|
1961
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1962
|
+
const enhancedEventData = this.mergeEventData(
|
|
1963
|
+
experimentParams,
|
|
1964
|
+
adapterParams
|
|
1965
|
+
);
|
|
1810
1966
|
this.sdk?.track_event(eventName, enhancedEventData);
|
|
1811
1967
|
}
|
|
1812
1968
|
/**
|
|
@@ -1936,8 +2092,9 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1936
2092
|
const eventName = this.getEventName(adapterParams, event.type);
|
|
1937
2093
|
const baseParams = this.eventToParams(event);
|
|
1938
2094
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2095
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
1939
2096
|
const enhancedParams = this.mergeEventData(
|
|
1940
|
-
|
|
2097
|
+
experimentParams,
|
|
1941
2098
|
adapterParams
|
|
1942
2099
|
);
|
|
1943
2100
|
window.posthog?.capture(eventName, enhancedParams);
|
|
@@ -1957,7 +2114,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1957
2114
|
referrer: event.referrer
|
|
1958
2115
|
};
|
|
1959
2116
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1960
|
-
const
|
|
2117
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2118
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1961
2119
|
window.posthog?.capture(eventName, enhancedParams);
|
|
1962
2120
|
}
|
|
1963
2121
|
/**
|
|
@@ -1975,7 +2133,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1975
2133
|
currency: event.currency || "INR"
|
|
1976
2134
|
};
|
|
1977
2135
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1978
|
-
const
|
|
2136
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2137
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1979
2138
|
window.posthog?.capture(eventName, enhancedParams);
|
|
1980
2139
|
}
|
|
1981
2140
|
/**
|
|
@@ -1995,7 +2154,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
1995
2154
|
variant: event.variant
|
|
1996
2155
|
};
|
|
1997
2156
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
1998
|
-
const
|
|
2157
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2158
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
1999
2159
|
this.logger.debug("Sending to PostHog with params", {
|
|
2000
2160
|
eventName,
|
|
2001
2161
|
params: enhancedParams
|
|
@@ -2027,7 +2187,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2027
2187
|
}))
|
|
2028
2188
|
};
|
|
2029
2189
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2030
|
-
const
|
|
2190
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2191
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2031
2192
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2032
2193
|
}
|
|
2033
2194
|
/**
|
|
@@ -2051,7 +2212,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2051
2212
|
}))
|
|
2052
2213
|
};
|
|
2053
2214
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2054
|
-
const
|
|
2215
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2216
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2055
2217
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2056
2218
|
}
|
|
2057
2219
|
/**
|
|
@@ -2067,7 +2229,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2067
2229
|
content_ids: event.content_ids
|
|
2068
2230
|
};
|
|
2069
2231
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2070
|
-
const
|
|
2232
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2233
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2071
2234
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2072
2235
|
}
|
|
2073
2236
|
/**
|
|
@@ -2091,7 +2254,8 @@ var PostHogAdapter = class extends BaseAdapter {
|
|
|
2091
2254
|
}))
|
|
2092
2255
|
};
|
|
2093
2256
|
const affiliateParams = this.enhanceWithAffiliateParams(baseParams);
|
|
2094
|
-
const
|
|
2257
|
+
const experimentParams = this.enhanceWithExperimentParams(affiliateParams);
|
|
2258
|
+
const enhancedParams = this.mergeEventData(experimentParams, adapterParams);
|
|
2095
2259
|
window.posthog?.capture(eventName, enhancedParams);
|
|
2096
2260
|
}
|
|
2097
2261
|
/**
|
|
@@ -2211,7 +2375,7 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2211
2375
|
shopId: `gid://shopify/Shop/${this.shopId}`,
|
|
2212
2376
|
currency: this.currency,
|
|
2213
2377
|
acceptedLanguage: DEFAULT_LANGUAGE,
|
|
2214
|
-
...this.enhanceWithAffiliateParams({})
|
|
2378
|
+
...this.enhanceWithExperimentParams(this.enhanceWithAffiliateParams({}))
|
|
2215
2379
|
};
|
|
2216
2380
|
}
|
|
2217
2381
|
/**
|
|
@@ -2232,17 +2396,19 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2232
2396
|
eventData: event,
|
|
2233
2397
|
adapterParams: params
|
|
2234
2398
|
});
|
|
2399
|
+
const affiliateParams = this.enhanceWithAffiliateParams(event);
|
|
2400
|
+
const enhancedEvent = this.enhanceWithExperimentParams(affiliateParams);
|
|
2235
2401
|
try {
|
|
2236
2402
|
switch (event.type) {
|
|
2237
2403
|
case "page_view" /* PAGE_VIEW */:
|
|
2238
|
-
const pageViewPayload = this.mergeEventData(
|
|
2404
|
+
const pageViewPayload = this.mergeEventData(enhancedEvent, params);
|
|
2239
2405
|
this.sendPageView(import_hydrogen_react.AnalyticsEventName.PAGE_VIEW, pageViewPayload);
|
|
2240
2406
|
this.logger.debug("Sent PAGE_VIEW event to Shopify Analytics", {
|
|
2241
2407
|
payload: pageViewPayload
|
|
2242
2408
|
});
|
|
2243
2409
|
break;
|
|
2244
2410
|
case "view_content" /* VIEW_CONTENT */:
|
|
2245
|
-
const viewContentPayload = this.mergeEventData(
|
|
2411
|
+
const viewContentPayload = this.mergeEventData(enhancedEvent, params);
|
|
2246
2412
|
this.sendPageView(
|
|
2247
2413
|
import_hydrogen_react.AnalyticsEventName.PRODUCT_VIEW,
|
|
2248
2414
|
viewContentPayload
|
|
@@ -2252,15 +2418,13 @@ var ShopifyAdapter = class extends BaseAdapter {
|
|
|
2252
2418
|
});
|
|
2253
2419
|
break;
|
|
2254
2420
|
case "add_to_cart" /* ADD_TO_CART */:
|
|
2255
|
-
const
|
|
2256
|
-
this.trackAddToCart(
|
|
2421
|
+
const addToCartPayload = this.mergeEventData(enhancedEvent, params);
|
|
2422
|
+
this.trackAddToCart(addToCartPayload);
|
|
2257
2423
|
break;
|
|
2258
2424
|
case "checkout_started" /* CHECKOUT_STARTED */:
|
|
2259
2425
|
case "begin_checkout" /* BEGIN_CHECKOUT */:
|
|
2260
2426
|
const checkoutPayload = this.mergeEventData(
|
|
2261
|
-
{
|
|
2262
|
-
pageType: "checkout"
|
|
2263
|
-
},
|
|
2427
|
+
{ ...enhancedEvent, pageType: "checkout" },
|
|
2264
2428
|
params
|
|
2265
2429
|
);
|
|
2266
2430
|
this.sendPageView(import_hydrogen_react.AnalyticsEventName.PAGE_VIEW, checkoutPayload);
|
|
@@ -2408,9 +2572,10 @@ var KwikPassAdapter = class extends BaseAdapter {
|
|
|
2408
2572
|
});
|
|
2409
2573
|
return;
|
|
2410
2574
|
}
|
|
2575
|
+
const affiliateParams = this.enhanceWithAffiliateParams(event);
|
|
2576
|
+
const enhancedEvent = this.enhanceWithExperimentParams(affiliateParams);
|
|
2411
2577
|
try {
|
|
2412
2578
|
this.logger.debug("Processing event", { eventType: event.type });
|
|
2413
|
-
const enhancedEvent = this.enhanceWithAffiliateParams(event);
|
|
2414
2579
|
switch (event.type) {
|
|
2415
2580
|
case "product_view" /* PRODUCT_VIEW */:
|
|
2416
2581
|
this.trackProductView(enhancedEvent, adapterParams);
|
|
@@ -2544,7 +2709,8 @@ var KwikCheckoutAdapter = class extends BaseAdapter {
|
|
|
2544
2709
|
}
|
|
2545
2710
|
try {
|
|
2546
2711
|
this.logger.debug("Processing event", { eventType: event.type });
|
|
2547
|
-
const
|
|
2712
|
+
const affiliateEnhanced = this.enhanceWithAffiliateParams(event);
|
|
2713
|
+
const enhancedEvent = this.enhanceWithExperimentParams(affiliateEnhanced);
|
|
2548
2714
|
switch (event.type) {
|
|
2549
2715
|
case "started_checkout_gk" /* STARTED_CHECKOUT_GK */:
|
|
2550
2716
|
this.trackStartedCheckoutGK(enhancedEvent, adapterParams);
|