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, ]); }