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 (