adding matomo to hometab lang picker

pull/5279/head
lianahus 1 month ago committed by Aniket
parent 753d2d440a
commit f720cb62b2
  1. 2
      libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx

@ -3,6 +3,7 @@ import { Dropdown, DropdownButton } from 'react-bootstrap'
import DropdownItem from 'react-bootstrap/DropdownItem' import DropdownItem from 'react-bootstrap/DropdownItem'
import { localeLang } from './types/carouselTypes' import { localeLang } from './types/carouselTypes'
import { FormattedMessage } from 'react-intl' import { FormattedMessage } from 'react-intl'
const _paq = (window._paq = window._paq || [])
export function LanguageOptions({ plugin }: { plugin: any }) { export function LanguageOptions({ plugin }: { plugin: any }) {
const [langOptions, setLangOptions] = useState<string>() const [langOptions, setLangOptions] = useState<string>()
@ -39,6 +40,7 @@ export function LanguageOptions({ plugin }: { plugin: any }) {
{ {
changeLanguage(lang.toLowerCase()) changeLanguage(lang.toLowerCase())
setLangOptions(lang) setLangOptions(lang)
_paq.push(['trackEvent', 'hometab', 'switchTo', lang])
}} }}
style={{ color: 'var(--text)', cursor: 'pointer' }} style={{ color: 'var(--text)', cursor: 'pointer' }}
key={index} key={index}

Loading…
Cancel
Save