search 상품 검색 클릭 정보수집

This commit is contained in:
Dev TWIN0906
2025-05-20 17:32:40 +09:00
parent b102da39d1
commit 81f212f5ec
5 changed files with 85 additions and 21 deletions

View File

@@ -616,4 +616,5 @@ export const LOG_MESSAGE_ID = {
MYPAGE_CLICK: "AL_MYPAGE_CLICK", MYPAGE_CLICK: "AL_MYPAGE_CLICK",
HOTPICKS_SHOWN: "AL_HOTPCIKS_SHOWN", HOTPICKS_SHOWN: "AL_HOTPCIKS_SHOWN",
HOTPICKS_CLICK: "AL_HOTPICKS_CLICK", HOTPICKS_CLICK: "AL_HOTPICKS_CLICK",
SEARCH_RESULT_CLICK: "AL_SEARCH_RESULT_CLICK",
}; };

View File

@@ -325,7 +325,7 @@ const CategoryPanel = ({ panelInfo, isOnTop, spotlightId }) => {
const params = { const params = {
tabTitle: tabRef.current === 0 ? "ITEM" : "SHOWS", tabTitle: tabRef.current === 0 ? "ITEM" : "SHOWS",
sortType: dropDownTabRef.current === 0 ? "NEW" : "POPULAR", sortType: dropDownTabRef.current === 0 ? "NEW" : "MOST POPULAR",
contextName: LOG_CONTEXT_NAME.CATEGORY, contextName: LOG_CONTEXT_NAME.CATEGORY,
messageId: LOG_MESSAGE_ID.CONTENTCLICK, messageId: LOG_MESSAGE_ID.CONTENTCLICK,
}; };

View File

@@ -6,10 +6,17 @@ import Spotlight from "@enact/spotlight";
import Spottable from "@enact/spotlight/Spottable"; import Spottable from "@enact/spotlight/Spottable";
import defaultImageItem from "../../../../../assets/images/img-thumb-empty-product@3x.png"; import defaultImageItem from "../../../../../assets/images/img-thumb-empty-product@3x.png";
import { sendLogSearchClick } from "../../../../actions/logActions"; import {
sendLogSearchClick,
sendLogTotalRecommend,
} from "../../../../actions/logActions";
import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import { pushPanel, updatePanel } from "../../../../actions/panelActions";
import CustomImage from "../../../../components/CustomImage/CustomImage"; import CustomImage from "../../../../components/CustomImage/CustomImage";
import { panel_names } from "../../../../utils/Config"; import {
LOG_CONTEXT_NAME,
LOG_MESSAGE_ID,
panel_names,
} from "../../../../utils/Config";
import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods";
import { SpotlightIds } from "../../../../utils/SpotlightIds"; import { SpotlightIds } from "../../../../utils/SpotlightIds";
import css from "./SearchItemCard.module.less"; import css from "./SearchItemCard.module.less";
@@ -47,6 +54,18 @@ export default memo(function SearchItemCard({
...rest ...rest
}) { }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const sendLog = (newParams) => {
const logParams = {
...newParams,
productId: contentId,
productTitle: title,
partner: patncNm,
price: dcPrice ? dcPrice : price,
contextName: LOG_CONTEXT_NAME.SEARCH,
messageId: LOG_MESSAGE_ID.SEARCH_RESULT_CLICK,
};
dispatch(sendLogTotalRecommend(logParams));
};
const [firstChk, setFirstChk] = useState(0); const [firstChk, setFirstChk] = useState(0);
@@ -55,6 +74,9 @@ export default memo(function SearchItemCard({
const handleItemClick = useCallback( const handleItemClick = useCallback(
(e) => { (e) => {
sendLog({
resultType: "item",
});
const tokkens = contentId && contentId.split("_"); const tokkens = contentId && contentId.split("_");
const patnrId = tokkens[4] || ""; const patnrId = tokkens[4] || "";
const prdtId = tokkens[5] || ""; const prdtId = tokkens[5] || "";

View File

@@ -7,10 +7,18 @@ import Spottable from "@enact/spotlight/Spottable";
import defaultShowImage from "../../../../../assets/images/img-thumb-empty-product@3x.png"; import defaultShowImage from "../../../../../assets/images/img-thumb-empty-product@3x.png";
import IcLiveShow from "../../../../../assets/images/tag/tag-liveshow.svg"; import IcLiveShow from "../../../../../assets/images/tag/tag-liveshow.svg";
import { sendLogSearchClick } from "../../../../actions/logActions"; import {
sendLogSearchClick,
sendLogTotalRecommend,
} from "../../../../actions/logActions";
import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import { pushPanel, updatePanel } from "../../../../actions/panelActions";
import CustomImage from "../../../../components/CustomImage/CustomImage"; import CustomImage from "../../../../components/CustomImage/CustomImage";
import { LOG_TP_NO, panel_names } from "../../../../utils/Config"; import {
LOG_CONTEXT_NAME,
LOG_MESSAGE_ID,
LOG_TP_NO,
panel_names,
} from "../../../../utils/Config";
import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods";
import { SpotlightIds } from "../../../../utils/SpotlightIds"; import { SpotlightIds } from "../../../../utils/SpotlightIds";
import css from "./SearchShowCard.module.less"; import css from "./SearchShowCard.module.less";
@@ -32,8 +40,23 @@ export default memo(function SearchShowCard({
const dispatch = useDispatch(); const dispatch = useDispatch();
const sendLog = (newParams) => {
const logParams = {
...newParams,
contentId: contentId,
contentTitle: title,
partner: patncNm,
contextName: LOG_CONTEXT_NAME.SEARCH,
messageId: LOG_MESSAGE_ID.SEARCH_RESULT_CLICK,
};
dispatch(sendLogTotalRecommend(logParams));
};
const handleShowClick = useCallback( const handleShowClick = useCallback(
(e) => { (e) => {
sendLog({
resultType: "show",
});
const tokkens = contentId && contentId.split("_"); const tokkens = contentId && contentId.split("_");
const linkTpCd = tokkens[1] || ""; const linkTpCd = tokkens[1] || "";
const patnrId = tokkens[4] || ""; const patnrId = tokkens[4] || "";

View File

@@ -6,11 +6,18 @@ import Spotlight from "@enact/spotlight";
import Spottable from "@enact/spotlight/Spottable"; import Spottable from "@enact/spotlight/Spottable";
import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import { pushPanel, updatePanel } from "../../../../actions/panelActions";
import { panel_names } from "../../../../utils/Config"; import {
LOG_CONTEXT_NAME,
LOG_MESSAGE_ID,
panel_names,
} from "../../../../utils/Config";
import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods";
import { SpotlightIds } from "../../../../utils/SpotlightIds"; import { SpotlightIds } from "../../../../utils/SpotlightIds";
import css from "./SearchThemeCard.module.less"; import css from "./SearchThemeCard.module.less";
import { sendLogSearchClick } from "../../../../actions/logActions"; import {
sendLogSearchClick,
sendLogTotalRecommend,
} from "../../../../actions/logActions";
const ThemeContainer = Spottable("div"); const ThemeContainer = Spottable("div");
@@ -27,6 +34,17 @@ export default memo(function SearchThemeCard({
}) { }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const sendLog = (newParams) => {
const logParams = {
...newParams,
contentId: contentId,
contentTitle: title,
partner: patncNm,
contextName: LOG_CONTEXT_NAME.SEARCH,
messageId: LOG_MESSAGE_ID.SEARCH_RESULT_CLICK,
};
dispatch(sendLogTotalRecommend(logParams));
};
const [firstChk, setFirstChk] = useState(0); const [firstChk, setFirstChk] = useState(0);
const handleThemeClick = useCallback( const handleThemeClick = useCallback(
@@ -43,6 +61,10 @@ export default memo(function SearchThemeCard({
const xContainer = tItemCard?.parentNode?.parentNode; const xContainer = tItemCard?.parentNode?.parentNode;
const yContainer = tBody?.children[0]?.children[0]?.children[0]; const yContainer = tBody?.children[0]?.children[0]?.children[0];
sendLog({
resultType: type,
});
if (xContainer && yContainer) { if (xContainer && yContainer) {
const section = "search-theme"; const section = "search-theme";
const x = getTranslate3dValueByDirection(xContainer); const x = getTranslate3dValueByDirection(xContainer);
@@ -79,21 +101,17 @@ export default memo(function SearchThemeCard({
}) })
); );
dispatch(sendLogSearchClick({ dispatch(
curationId, sendLogSearchClick({
curationNm: title, curationId,
keyword: searchQueryRef.current, curationNm: title,
patncNm, keyword: searchQueryRef.current,
patnrId, patncNm,
})); patnrId,
})
);
}, },
[ [contentId, dispatch, idx, patncNm, title]
contentId,
dispatch,
idx,
patncNm,
title,
]
); );
const keywordText = (keyword) => { const keywordText = (keyword) => {
let text = ""; let text = "";