fix. [SWV-877] GNB 지표 정의 개선
This commit is contained in:
@@ -13,6 +13,7 @@ interface Props {
|
||||
variant?: ButtonVariant
|
||||
backgroundColor?: string
|
||||
textColor?: string
|
||||
useGameFont?: boolean
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
@@ -29,7 +30,7 @@ const gameDataStore = useGameDataStore()
|
||||
const modalStore = useModalStore()
|
||||
const { isProcessing, validateLauncher } = useCheckGameStart()
|
||||
|
||||
const { gameName, platformType, osType, marketJson } =
|
||||
const { gameName, platformType, osType, marketJson, fontFamily } =
|
||||
storeToRefs(gameDataStore)
|
||||
|
||||
const PLATFORM_ICON_MAP: Record<Platform, string> = {
|
||||
@@ -82,6 +83,9 @@ const textStyle = computed<CSSProperties>(() => {
|
||||
if (props.textColor) {
|
||||
style.color = props.textColor
|
||||
}
|
||||
if (props.useGameFont && fontFamily.value) {
|
||||
style.fontFamily = fontFamily.value
|
||||
}
|
||||
|
||||
return style
|
||||
})
|
||||
|
||||
@@ -7,6 +7,7 @@ import type {
|
||||
GameDataResourceGroup,
|
||||
GameDataResourceGroupSet,
|
||||
} from '#layers/types/api/gameData'
|
||||
import type { TrackingObject } from '#layers/types/api/common'
|
||||
|
||||
const MORE_WIDTH = 72
|
||||
const START_MARGIN = 40
|
||||
@@ -20,7 +21,8 @@ const scrollStore = useScrollStore()
|
||||
const breakpoints = useResponsiveBreakpoints()
|
||||
const { sendLog } = useAnalytics()
|
||||
|
||||
const { gameName, imgJson, gnb, eventBanner } = storeToRefs(gameDataStore)
|
||||
const { gameId, gameName, imgJson, gnb, eventBanner } =
|
||||
storeToRefs(gameDataStore)
|
||||
const { pageLayoutType } = storeToRefs(pageDataStore)
|
||||
const { isPassedStoveGnb } = storeToRefs(scrollStore)
|
||||
|
||||
@@ -139,12 +141,16 @@ const handleMenuClose = () => {
|
||||
scrollStore.controlScrollLock(false)
|
||||
}
|
||||
|
||||
const handleSendLog = (item: string) => {
|
||||
const analytics = {
|
||||
action_type: 'click',
|
||||
click_item: item,
|
||||
click_sarea: 'GNB',
|
||||
}
|
||||
const handleSendLog = (item: string | TrackingObject) => {
|
||||
const analytics: TrackingObject =
|
||||
typeof item === 'string'
|
||||
? {
|
||||
action_type: 'click',
|
||||
click_item: item,
|
||||
click_sarea: 'GNB',
|
||||
click_area: gameId.value,
|
||||
}
|
||||
: { ...item, click_area: gameId.value }
|
||||
sendLog(locale.value, analytics)
|
||||
}
|
||||
|
||||
@@ -152,7 +158,7 @@ const handleGnbItemClick = (gnbItem: GameDataMenu) => {
|
||||
if (isNotClickable(gnbItem)) return
|
||||
|
||||
handleMenuClose()
|
||||
sendLog(locale.value, gnbItem.tracking_json)
|
||||
handleSendLog(gnbItem.tracking_json)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -196,10 +202,7 @@ onMounted(() => {
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</AtomsLocaleLink>
|
||||
<button
|
||||
class="btn-open"
|
||||
@click="[handleMenuOpen(), handleSendLog('모바일 메뉴')]"
|
||||
>
|
||||
<button class="btn-open" @click="handleMenuOpen">
|
||||
<AtomsIconsMenuBoldLine class="mx-auto" />
|
||||
<span class="sr-only">menu open</span>
|
||||
</button>
|
||||
@@ -391,7 +394,7 @@ onMounted(() => {
|
||||
:use-game-font="
|
||||
start1depthData?.btn_info?.use_game_font === 1
|
||||
"
|
||||
@click="sendLog(locale, start1depthData.tracking)"
|
||||
@click="handleSendLog(start1depthData.tracking)"
|
||||
>
|
||||
{{ start1depthData?.btn_info?.txt_btn_name }}
|
||||
</BlocksButtonLauncher>
|
||||
@@ -405,7 +408,7 @@ onMounted(() => {
|
||||
type="single"
|
||||
variant="custom"
|
||||
:platform="key"
|
||||
@click="sendLog(locale, item.tracking)"
|
||||
@click="handleSendLog(item.tracking)"
|
||||
>
|
||||
{{ item.btn_info?.txt_btn_name }}
|
||||
</BlocksButtonLauncher>
|
||||
|
||||
@@ -192,6 +192,7 @@ const handleButtonClick = (button: PageDataResourceGroup) => {
|
||||
"
|
||||
type="duplication"
|
||||
:platform="button.btn_info?.detail?.market_type"
|
||||
:use-game-font="usesGameFont(button.btn_info)"
|
||||
@click="handleButtonClick(button)"
|
||||
>
|
||||
{{ button.btn_info?.txt_btn_name }}
|
||||
|
||||
@@ -61,7 +61,7 @@ export const useAnalyticsData = (
|
||||
|
||||
// 객체인 경우
|
||||
if (typeof analytics === 'object') {
|
||||
const { action_type, click_sarea, click_item } = analytics
|
||||
const { action_type, click_area, click_sarea, click_item } = analytics
|
||||
|
||||
logData = {
|
||||
actionType: action_type,
|
||||
@@ -70,7 +70,7 @@ export const useAnalyticsData = (
|
||||
} as AnalyticsDetailType
|
||||
|
||||
if (action_type === 'click') {
|
||||
logData.clickArea = baseViewArea
|
||||
logData.clickArea = click_area ?? baseViewArea
|
||||
logData.clickSarea = click_sarea
|
||||
logData.clickItem = click_item
|
||||
} else if (action_type === 'view') {
|
||||
|
||||
@@ -48,6 +48,7 @@ export interface TrackingObject {
|
||||
action_type: string
|
||||
click_item: string
|
||||
click_sarea: string
|
||||
click_area?: string
|
||||
}
|
||||
|
||||
export interface ColorObject {
|
||||
|
||||
Reference in New Issue
Block a user