Skip to content

Commit

Permalink
adds support for deprecated setEcommerceView method
Browse files Browse the repository at this point in the history
  • Loading branch information
lysy-vlc committed Jan 24, 2024
1 parent a0bc27c commit 858dd46
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants/track-event.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export enum TRACK_EVENT {
ECOMMERCE_PRODUCT_DETAIL_VIEW = 'ecommerceProductDetailView',
UPDATE_ECOMMERCE_CART = 'ecommerceCartUpdate',
ORDER_ECOMMERCE = 'ecommerceOrder',
SET_ECOMMERCE_VIEW = 'setEcommerceView',
SET_CUSTOM_VARIABLE = 'setCustomVariable',
DELETE_CUSTOM_VARIABLE = 'deleteCustomVariable',
STORE_CUSTOM_VARIABLES_IN_COOKIE = 'storeCustomVariablesInCookie',
Expand Down
18 changes: 18 additions & 0 deletions src/services/e-commerce/e-commerce.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,21 @@ export function updateEcommerceCart(
export function ecommerceProductDetailView(products: Product[]) {
PaqService.push([TRACK_EVENT.ECOMMERCE_PRODUCT_DETAIL_VIEW, products])
}

/**
* @deprecated since version 1.3.1.
*/
export function setEcommerceView(
productSKU: string,
productName?: string,
productCategory?: string[],
productPrice?: string
) {
PaqService.push([
TRACK_EVENT.SET_ECOMMERCE_VIEW,
productSKU,
productName,
productCategory,
productPrice
])
}

0 comments on commit 858dd46

Please sign in to comment.