From 22b616e6d17fce53241e2ad84bfd73c20ce7a69c Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 29 Jan 2024 16:19:04 +0300 Subject: [PATCH] music-stat-event --- src/components/Article/AudioPlayer/PlayerPlaylist.tsx | 11 ++++++++++- src/components/Article/FullArticle.tsx | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/Article/AudioPlayer/PlayerPlaylist.tsx b/src/components/Article/AudioPlayer/PlayerPlaylist.tsx index 57bdaf2f..07cee3bd 100644 --- a/src/components/Article/AudioPlayer/PlayerPlaylist.tsx +++ b/src/components/Article/AudioPlayer/PlayerPlaylist.tsx @@ -1,3 +1,4 @@ +import { gtag } from 'ga-gtag' import { createSignal, For, lazy, Show } from 'solid-js' import { useLocalize } from '../../../context/localize' @@ -34,6 +35,14 @@ export const PlayerPlaylist = (props: Props) => { const handleMediaItemFieldChange = (field: keyof MediaItem, value: string) => { props.onMediaItemFieldChange(activeEditIndex(), field, value) } + + const play = (index) => { + const mi = props.media[index] + gtag('event', 'select_item', { + item_list_id: props.articleSlug, + item_list_name: mi.title || '' + ' - ' + mi.artist || '', + }) + } return (