ng-easycommerce 0.0.478 → 0.0.479
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 +2 -0
- package/bundles/ng-easycommerce.umd.js +15 -3
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/interfaces/analytics/event-key.model.js +1 -1
- package/esm2015/lib/utils/analytics/gtm.service.js +16 -4
- package/esm5/lib/interfaces/analytics/event-key.model.js +1 -1
- package/esm5/lib/utils/analytics/gtm.service.js +16 -4
- package/fesm2015/ng-easycommerce.js +15 -3
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +15 -3
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/interfaces/analytics/event-key.model.d.ts +1 -1
- package/lib/utils/analytics/gtm.service.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2486,6 +2486,7 @@
|
|
|
2486
2486
|
case 'add_to_cart': return 'add_to_cart_gtm';
|
|
2487
2487
|
case 'remove_from_cart': return 'remove_from_cart_gtm';
|
|
2488
2488
|
case 'sign_up': return 'sign_up_gtm';
|
|
2489
|
+
case 'view_promotion': return 'view_promotion_gtm';
|
|
2489
2490
|
default: return null;
|
|
2490
2491
|
}
|
|
2491
2492
|
};
|
|
@@ -2500,6 +2501,7 @@
|
|
|
2500
2501
|
case 'add_to_cart_gtm': return _this.toAddToCart(data);
|
|
2501
2502
|
case 'remove_from_cart_gtm': return _this.toRemoveToCart(data);
|
|
2502
2503
|
case 'sign_up_gtm': return _this.toSignUp(data);
|
|
2504
|
+
case 'view_promotion_gtm': return _this.toViewPromotion(data);
|
|
2503
2505
|
default: return data;
|
|
2504
2506
|
}
|
|
2505
2507
|
};
|
|
@@ -2566,6 +2568,11 @@
|
|
|
2566
2568
|
item_list_name: data.item_list_name || 'Collection',
|
|
2567
2569
|
item_list_id: data.item_list_id || 'collection'
|
|
2568
2570
|
};
|
|
2571
|
+
console.log('toViewItemList ', {
|
|
2572
|
+
items: data.products.map(function (product) { return _this.toItem(product); }),
|
|
2573
|
+
item_list_name: data.item_list_name || 'Collection',
|
|
2574
|
+
item_list_id: data.item_list_id || 'collection'
|
|
2575
|
+
});
|
|
2569
2576
|
};
|
|
2570
2577
|
this.toRemoveToCart = function (product) {
|
|
2571
2578
|
var _a, _b;
|
|
@@ -2577,13 +2584,13 @@
|
|
|
2577
2584
|
};
|
|
2578
2585
|
};
|
|
2579
2586
|
this.toItem = function (product) {
|
|
2580
|
-
var _a, _b
|
|
2587
|
+
var _a, _b;
|
|
2581
2588
|
return ({
|
|
2582
2589
|
item_name: product.name,
|
|
2583
2590
|
item_id: product.id,
|
|
2584
|
-
item_brand:
|
|
2591
|
+
// item_brand: product.attributes?.length ? product.attributes[0].name : '',
|
|
2585
2592
|
item_category: product.category,
|
|
2586
|
-
price: ((
|
|
2593
|
+
price: ((_a = product.variants[0]) === null || _a === void 0 ? void 0 : _a.saleprice) || ((_b = product.variants[0]) === null || _b === void 0 ? void 0 : _b.price),
|
|
2587
2594
|
quantity: product.quantity || 1,
|
|
2588
2595
|
});
|
|
2589
2596
|
};
|
|
@@ -2622,6 +2629,11 @@
|
|
|
2622
2629
|
this.toSignUp = function (data) {
|
|
2623
2630
|
return __assign$5({}, data);
|
|
2624
2631
|
};
|
|
2632
|
+
this.toViewPromotion = function (data) {
|
|
2633
|
+
return {
|
|
2634
|
+
data: data
|
|
2635
|
+
};
|
|
2636
|
+
};
|
|
2625
2637
|
}
|
|
2626
2638
|
GTMService.prototype.getDataLayer = function () {
|
|
2627
2639
|
var window = this.browserGlobals.windowRef();
|