[통합로그 No.5] onsale 상품 클릭시 로그 정보 수집

This commit is contained in:
dongyoungKo
2025-05-16 16:58:23 +09:00
parent e5739f3ab2
commit e9749091f8
5 changed files with 51 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ export default memo(function TItemCard({
lastLabel,
contextName,
messageId,
location,
order,
patnerName,
brandName,
shelfId,
@@ -125,7 +125,7 @@ export default memo(function TItemCard({
brand: brandName,
price: originalPrice,
discount: discountRate,
locaiton: location,
locaiton: order,
category: catNm,
};
dispatch(sendLogTotalRecommend(params));

View File

@@ -202,7 +202,7 @@ const BestSeller = ({
key={"subItem" + itemIndex}
contextName={LOG_CONTEXT_NAME.HOME}
messageId={LOG_MESSAGE_ID.SHELF_CLICK}
location={itemIndex + 1}
order={itemIndex + 1}
shelfId={spotlightId}
shelfLocation={shelfLocation}
shelfTitle={shelfTitle}

View File

@@ -12,6 +12,7 @@ import useScrollTo from "../../../hooks/useScrollTo";
import { $L, scaleW } from "../../../utils/helperMethods";
import css from "./HomeOnSale.module.less";
import HomeOnSaleItem from "./HomeOnSaleItem/HomeOnSaleItem";
import { LOG_CONTEXT_NAME, LOG_MESSAGE_ID } from "../../../utils/Config";
const Container = SpotlightContainerDecorator(
{ enterTo: "last-focused" },
@@ -24,6 +25,8 @@ const HomeOnSale = ({
handleItemFocus,
handleShelfFocus,
spotlightId,
shelfLocation,
shelfTitle,
...rest
}) => {
const [firstChk, setFirstChk] = useState(0);
@@ -120,6 +123,7 @@ const HomeOnSale = ({
}
}, [handleShelfFocus]);
// console.log("#homeOnSaleInfos", homeOnSaleInfos);
return (
<Container
{...rest}
@@ -156,6 +160,17 @@ const HomeOnSale = ({
onBlur={handleBlur(index)}
label={index * 1 + 1 + " of " + homeOnSaleInfos.length}
lastLabel=" go to detail, button"
contextName={LOG_CONTEXT_NAME.HOME}
messageId={LOG_MESSAGE_ID.SHELF_CLICK}
shelfLocation={shelfLocation}
shelfId={spotlightId}
shelfTitle={shelfTitle}
productId={itemData.prdtId}
productName={itemData.prdtNm}
order={itemData.expsOrd}
catNm={itemData.catNm}
partner={itemData.patncNm}
brandName={itemData.brndNm}
/>
);
})}

View File

@@ -11,6 +11,7 @@ import usePriceInfo from "../../../../hooks/usePriceInfo";
import { panel_names } from "../../../../utils/Config";
import { $L } from "../../../../utils/helperMethods";
import css from "./HomeOnSaleItem.module.less";
import { sendLogTotalRecommend } from "../../../../actions/logActions";
const SpottableComponent = Spottable("div");
@@ -19,6 +20,17 @@ export default function HomeOnSaleItem({
itemData,
label,
lastLabel,
contextName,
messageId,
shelfLocation,
shelfId,
shelfTitle,
productId,
productName,
patnerName,
brandName,
catNm,
order,
...rest
}) {
const { originalPrice, discountedPrice, discountRate } =
@@ -39,8 +51,27 @@ export default function HomeOnSaleItem({
},
})
);
if (contextName && messageId) {
const params = {
contextName: contextName,
messageId: messageId,
shelfLocation: shelfLocation,
shelfId: shelfId,
shelfTitle: shelfTitle,
productId: productId,
productTitle: productName,
partner: patnerName,
brand: brandName,
price: originalPrice,
discount: discountRate,
locaiton: order,
category: catNm,
};
dispatch(sendLogTotalRecommend(params));
}
},
[dispatch, itemData]
[dispatch, itemData, contextName, messageId]
);
const prdtNum = label ? label : "";
const discountLabel = discountRate ? discountRate + " discount," : "";

View File

@@ -252,7 +252,7 @@ export default memo(function SubCategory({
contextName={LOG_CONTEXT_NAME.HOME}
messageId={LOG_MESSAGE_ID.SHELF_CLICK}
catNm={categoryItemInfos.catNm}
location={itemIndex + 1}
order={itemIndex + 1}
shelfId={spotlightId}
shelfLocation={shelfLocation}
shelfTitle={shelfTitle}