ublo-lib 1.19.30 → 1.19.31
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.
|
@@ -3,7 +3,7 @@ import Script from "next/script";
|
|
|
3
3
|
import getConfig from "next/config";
|
|
4
4
|
const { publicRuntimeConfig } = getConfig();
|
|
5
5
|
const { plausibleDomain } = publicRuntimeConfig;
|
|
6
|
-
const DEFAULT_SOURCE = "https://plausible.io/js/script.file-downloads.outbound-links.js";
|
|
6
|
+
const DEFAULT_SOURCE = "https://plausible.io/js/script.revenue.file-downloads.outbound-links.js";
|
|
7
7
|
export default function PlausibleScript({ lang, source = DEFAULT_SOURCE, }) {
|
|
8
8
|
const hasI18n = typeof plausibleDomain === "object";
|
|
9
9
|
if (hasI18n && !lang) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,QAiFP"}
|
|
@@ -14,6 +14,7 @@ const EVENT_NAMES = {
|
|
|
14
14
|
};
|
|
15
15
|
export function MseM({ event, payment_type: paymentType, execcode, items = [], orderId, cartId, currency = "EUR", }) {
|
|
16
16
|
const hoteId = getBusinessProvider();
|
|
17
|
+
const stay = getStay();
|
|
17
18
|
const amount = items.reduce((acc, item) => {
|
|
18
19
|
return acc + item.gtmData.price * item.gtmData.quantity;
|
|
19
20
|
}, 0);
|
|
@@ -30,19 +31,19 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
30
31
|
switch (event) {
|
|
31
32
|
case "view_item": {
|
|
32
33
|
const formatedItems = formatPeekPerformancesItem(items);
|
|
33
|
-
const rawData = JSON.stringify({ products: formatedItems, hoteId });
|
|
34
|
+
const rawData = JSON.stringify({ products: formatedItems, hoteId, stay });
|
|
34
35
|
sendGoal(name, { ...firstProductProps, rawData });
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
37
38
|
case "add_to_cart": {
|
|
38
39
|
const formatedItems = formatPeekPerformancesItem(items);
|
|
39
|
-
const rawData = JSON.stringify({ products: formatedItems, hoteId });
|
|
40
|
+
const rawData = JSON.stringify({ products: formatedItems, hoteId, stay });
|
|
40
41
|
sendGoal(name, { ...firstProductProps, rawData }, revenue);
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
43
44
|
case "checkout": {
|
|
44
45
|
const formatedItems = formatPeekPerformancesItem(items);
|
|
45
|
-
const rawData = JSON.stringify({ products: formatedItems, hoteId });
|
|
46
|
+
const rawData = JSON.stringify({ products: formatedItems, hoteId, stay });
|
|
46
47
|
sendGoal(name, { cartId, rawData }, revenue);
|
|
47
48
|
break;
|
|
48
49
|
}
|
|
@@ -51,6 +52,7 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
51
52
|
const rawData = JSON.stringify({
|
|
52
53
|
products: formatedItems,
|
|
53
54
|
hoteId,
|
|
55
|
+
stay,
|
|
54
56
|
paymentMethod: paymentType,
|
|
55
57
|
});
|
|
56
58
|
sendGoal(name, { cartId, "Payment type": paymentType, rawData }, revenue);
|
|
@@ -63,6 +65,7 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
63
65
|
const rawData = JSON.stringify({
|
|
64
66
|
products: formatedItems,
|
|
65
67
|
hoteId,
|
|
68
|
+
stay,
|
|
66
69
|
attempts,
|
|
67
70
|
paymentMethod: paymentType,
|
|
68
71
|
execCode: execcode,
|
|
@@ -107,6 +110,12 @@ function formatPeekPerformancesItem(items) {
|
|
|
107
110
|
};
|
|
108
111
|
});
|
|
109
112
|
}
|
|
113
|
+
function getStay() {
|
|
114
|
+
const stay = window.localStorage.getItem("stay");
|
|
115
|
+
if (stay) {
|
|
116
|
+
return stay;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
110
119
|
function getBusinessProvider() {
|
|
111
120
|
const businessProvider = window.localStorage.getItem("businessProvider");
|
|
112
121
|
if (businessProvider) {
|