feat: Refinamiento del tracking de analiticas y actualizacion del dashboard admin

This commit is contained in:
2026-03-04 20:36:31 -05:00
parent c376627d39
commit 4e17613d49
12 changed files with 189 additions and 62 deletions

View File

@ -15,6 +15,7 @@
import { ref, computed, watch } from 'vue'
import { useFavoritesStore } from '@/stores/favorites'
import { useAuthStore } from '@/stores/auth'
import { analyticsService } from '@/services/analyticsService'
const props = defineProps<{
itemType: 'coupon' | 'business' | 'taxi' | 'route' | 'stop' | 'shuttle'
@ -59,6 +60,15 @@ async function handleToggle() {
props.itemName,
props.itemImage
)
const isNowFavorited = favoritesStore.isFavorite(props.itemType, props.itemId)
const entityTypeMap: Record<string, any> = { business: 'business', shuttle: 'shuttle', coupon: 'coupon', stop: 'stop', route: 'route' }
analyticsService.logEvent({
event_name: isNowFavorited ? 'favorite_add' : 'favorite_remove',
entity_type: entityTypeMap[props.itemType] || 'other',
entity_id: props.itemId,
entity_name: props.itemName || 'item'
})
} catch (error) {
console.error('Error toggling favorite:', error)
} finally {