From 4e475b368f64e8b4b2a73971c12aaa6f40252928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Grz=C4=85ba?= Date: Mon, 11 Dec 2023 18:31:50 +0100 Subject: [PATCH] [PPI-976] ecommerce product detail view --- src/constants/track-event.constant.ts | 3 +-- src/services/e-commerce/e-commerce.service.ts | 15 +++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/constants/track-event.constant.ts b/src/constants/track-event.constant.ts index 6f01831..889aecc 100644 --- a/src/constants/track-event.constant.ts +++ b/src/constants/track-event.constant.ts @@ -5,8 +5,7 @@ export enum TRACK_EVENT { SEARCH = 'trackSiteSearch', ADD_ECOMMERCE_ITEM = 'ecommerceAddToCart', REMOVE_ECOMMERCE_ITEM = 'ecommerceAddToCart', - CLEAR_ECOMMERCE_CART = 'clearEcommerceCart', - SET_ECOMMERCE_VIEW = 'setEcommerceView', + ECOMMERCE_PRODUCT_DETAIL_VIEW = 'ecommerceProductDetailView', UPDATE_ECOMMERCE_CART = 'ecommerceCartUpdate', ORDER_ECOMMERCE = 'ecommerceOrder', SET_CUSTOM_VARIABLE = 'setCustomVariable', diff --git a/src/services/e-commerce/e-commerce.service.ts b/src/services/e-commerce/e-commerce.service.ts index 7106315..929ef19 100644 --- a/src/services/e-commerce/e-commerce.service.ts +++ b/src/services/e-commerce/e-commerce.service.ts @@ -17,12 +17,6 @@ export function removeEcommerceItem(products: Product) { ]) } -export function clearEcommerceCart() { - PaqService.push([ - TRACK_EVENT.CLEAR_ECOMMERCE_CART, - ]) -} - export function getEcommerceItems(): Promise { return new Promise((resolve, reject) => { try { @@ -55,12 +49,9 @@ export function updateEcommerceCart(products: Product[], grandTotal: number | st ]); } -export function setEcommerceView(productSKU: string, productName?: string, productCategory?: string[], productPrice?: string) { +export function ecommerceProductDetailView(products: Product[]) { PaqService.push([ - TRACK_EVENT.SET_ECOMMERCE_VIEW, - productSKU, - productName, - productCategory, - productPrice + TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW, + products, ]); }