@ikas/storefront 0.0.147 → 0.0.148
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/build/analytics/googleTagManager.d.ts +6 -12
- package/build/index.es.js +9 -6
- package/build/index.js +9 -6
- package/package.json +1 -1
|
@@ -12,11 +12,7 @@ export declare class GoogleTagManager {
|
|
|
12
12
|
items: {
|
|
13
13
|
item_name: string;
|
|
14
14
|
item_id: string;
|
|
15
|
-
parent_id: string;
|
|
16
15
|
price: number;
|
|
17
|
-
currency: string;
|
|
18
|
-
url: string;
|
|
19
|
-
item_image: string;
|
|
20
16
|
item_brand: string;
|
|
21
17
|
item_category: string;
|
|
22
18
|
item_category_2: string;
|
|
@@ -28,6 +24,12 @@ export declare class GoogleTagManager {
|
|
|
28
24
|
index: number;
|
|
29
25
|
quantity: number;
|
|
30
26
|
}[];
|
|
27
|
+
extraParams: {
|
|
28
|
+
parent_id: string;
|
|
29
|
+
currency: string;
|
|
30
|
+
url: string;
|
|
31
|
+
item_image: string;
|
|
32
|
+
};
|
|
31
33
|
};
|
|
32
34
|
} | undefined;
|
|
33
35
|
static addToCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): {
|
|
@@ -36,11 +38,7 @@ export declare class GoogleTagManager {
|
|
|
36
38
|
items: ({
|
|
37
39
|
item_name: string;
|
|
38
40
|
item_id: string;
|
|
39
|
-
parent_id: string;
|
|
40
41
|
price: number;
|
|
41
|
-
currency: string;
|
|
42
|
-
url: string;
|
|
43
|
-
item_image: string;
|
|
44
42
|
item_brand: string;
|
|
45
43
|
item_category: string;
|
|
46
44
|
item_category_2: string;
|
|
@@ -74,11 +72,7 @@ export declare class GoogleTagManager {
|
|
|
74
72
|
items: ({
|
|
75
73
|
item_name: string;
|
|
76
74
|
item_id: string;
|
|
77
|
-
parent_id: string;
|
|
78
75
|
price: number;
|
|
79
|
-
currency: string;
|
|
80
|
-
url: string;
|
|
81
|
-
item_image: string;
|
|
82
76
|
item_brand: string;
|
|
83
77
|
item_category: string;
|
|
84
78
|
item_category_2: string;
|
package/build/index.es.js
CHANGED
|
@@ -16983,11 +16983,18 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
16983
16983
|
}
|
|
16984
16984
|
};
|
|
16985
16985
|
GoogleTagManager.productView = function (productDetail) {
|
|
16986
|
+
var _a;
|
|
16986
16987
|
try {
|
|
16987
16988
|
var event_2 = {
|
|
16988
16989
|
event: "view_item",
|
|
16989
16990
|
ecommerce: {
|
|
16990
16991
|
items: [productToGTMItem(productDetail)],
|
|
16992
|
+
extraParams: {
|
|
16993
|
+
parent_id: productDetail.product.id,
|
|
16994
|
+
currency: productDetail.selectedVariant.price.currency,
|
|
16995
|
+
url: "https://" + window.location.hostname + productDetail.href,
|
|
16996
|
+
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
16997
|
+
},
|
|
16991
16998
|
},
|
|
16992
16999
|
};
|
|
16993
17000
|
//@ts-ignore
|
|
@@ -17213,17 +17220,13 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
17213
17220
|
return GoogleTagManager;
|
|
17214
17221
|
}());
|
|
17215
17222
|
function productToGTMItem(productDetail, quantity) {
|
|
17216
|
-
var _a
|
|
17223
|
+
var _a;
|
|
17217
17224
|
if (quantity === void 0) { quantity = 1; }
|
|
17218
17225
|
return {
|
|
17219
17226
|
item_name: productDetail.product.name,
|
|
17220
17227
|
item_id: productDetail.selectedVariant.id,
|
|
17221
|
-
parent_id: productDetail.product.id,
|
|
17222
17228
|
price: productDetail.selectedVariant.price.finalPrice,
|
|
17223
|
-
|
|
17224
|
-
url: "https://" + window.location.hostname + productDetail.href,
|
|
17225
|
-
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
17226
|
-
item_brand: ((_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name) || "",
|
|
17229
|
+
item_brand: ((_a = productDetail.product.brand) === null || _a === void 0 ? void 0 : _a.name) || "",
|
|
17227
17230
|
item_category: productDetail.product.categories.length
|
|
17228
17231
|
? productDetail.product.categories[0].name
|
|
17229
17232
|
: "",
|
package/build/index.js
CHANGED
|
@@ -16989,11 +16989,18 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
16989
16989
|
}
|
|
16990
16990
|
};
|
|
16991
16991
|
GoogleTagManager.productView = function (productDetail) {
|
|
16992
|
+
var _a;
|
|
16992
16993
|
try {
|
|
16993
16994
|
var event_2 = {
|
|
16994
16995
|
event: "view_item",
|
|
16995
16996
|
ecommerce: {
|
|
16996
16997
|
items: [productToGTMItem(productDetail)],
|
|
16998
|
+
extraParams: {
|
|
16999
|
+
parent_id: productDetail.product.id,
|
|
17000
|
+
currency: productDetail.selectedVariant.price.currency,
|
|
17001
|
+
url: "https://" + window.location.hostname + productDetail.href,
|
|
17002
|
+
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
17003
|
+
},
|
|
16997
17004
|
},
|
|
16998
17005
|
};
|
|
16999
17006
|
//@ts-ignore
|
|
@@ -17219,17 +17226,13 @@ var GoogleTagManager = /** @class */ (function () {
|
|
|
17219
17226
|
return GoogleTagManager;
|
|
17220
17227
|
}());
|
|
17221
17228
|
function productToGTMItem(productDetail, quantity) {
|
|
17222
|
-
var _a
|
|
17229
|
+
var _a;
|
|
17223
17230
|
if (quantity === void 0) { quantity = 1; }
|
|
17224
17231
|
return {
|
|
17225
17232
|
item_name: productDetail.product.name,
|
|
17226
17233
|
item_id: productDetail.selectedVariant.id,
|
|
17227
|
-
parent_id: productDetail.product.id,
|
|
17228
17234
|
price: productDetail.selectedVariant.price.finalPrice,
|
|
17229
|
-
|
|
17230
|
-
url: "https://" + window.location.hostname + productDetail.href,
|
|
17231
|
-
item_image: ((_a = productDetail.selectedVariant.mainImage) === null || _a === void 0 ? void 0 : _a.src) || "",
|
|
17232
|
-
item_brand: ((_b = productDetail.product.brand) === null || _b === void 0 ? void 0 : _b.name) || "",
|
|
17235
|
+
item_brand: ((_a = productDetail.product.brand) === null || _a === void 0 ? void 0 : _a.name) || "",
|
|
17233
17236
|
item_category: productDetail.product.categories.length
|
|
17234
17237
|
? productDetail.product.categories[0].name
|
|
17235
17238
|
: "",
|