diff --git a/app/components/ChooseFood.vue b/app/components/ChooseFood.vue index 9e4a1a7..5a40ca7 100644 --- a/app/components/ChooseFood.vue +++ b/app/components/ChooseFood.vue @@ -12,7 +12,8 @@ const curStuff = computed(() => rStore.selectedStuff) const recipeBtnRef = ref() const { playAnimation } = useEmojiAnimation(recipeBtnRef) -const gtm = useGtm() +const { proxy } = useScriptGoogleTagManager() + const recipePanelRef = ref() const { isVisible, show } = useInvisibleElement(recipePanelRef) @@ -22,13 +23,13 @@ function toggleStuff(item: StuffItem, category = '', _e?: Event) { if (curStuff.value.includes(item.name)) playAnimation(item.emoji) - gtm?.trackEvent({ + proxy.dataLayer.push({ event: 'click', category: `${category}_${item.name}`, action: 'click_stuff', label: '食材', }) - gtm?.trackEvent({ + proxy.dataLayer.push({ event: 'click_stuff', action: item.name, }) diff --git a/app/components/RandomRecipe.vue b/app/components/RandomRecipe.vue index eb0c828..f4e1659 100644 --- a/app/components/RandomRecipe.vue +++ b/app/components/RandomRecipe.vue @@ -5,13 +5,13 @@ const { random, randomRecipes } = useRandomRecipe(count)