1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 12:30:32 +09:00

fix: event name

This commit is contained in:
uetchy 2020-03-07 12:24:59 +09:00
parent 095895f7cf
commit 7a1d8c738f
2 changed files with 8 additions and 10 deletions

View File

@ -23,7 +23,7 @@ import {DiRust, DiHeroku} from 'react-icons/di';
import {SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon} from './Icons'; import {SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon} from './Icons';
import {mobile} from '../util/css'; import {mobile} from '../util/css';
import {sendExampleQueryEvent} from '../util/analytics'; import {sendGettingStartedEvent} from '../util/analytics';
const Welcome: React.FC = () => { const Welcome: React.FC = () => {
const {t} = useTranslation(); const {t} = useTranslation();
@ -36,9 +36,7 @@ const Welcome: React.FC = () => {
<ButtonContainer> <ButtonContainer>
<List> <List>
<ListButton> <ListButton>
<Link <Link to="/s/namae" onClick={() => sendGettingStartedEvent()}>
to="/s/namae"
onClick={() => sendExampleQueryEvent('namae')}>
{t('gettingStarted')} {t('gettingStarted')}
</Link> </Link>
</ListButton> </ListButton>

View File

@ -38,23 +38,23 @@ export function trackEvent({
} }
export function sendQueryEvent(query: string): void { export function sendQueryEvent(query: string): void {
trackEvent({category: 'Search', action: 'search', label: query}); trackEvent({category: 'Search', action: 'Search New Word', label: query});
} }
export function sendExampleQueryEvent(query: string): void { export function sendGettingStartedEvent(): void {
trackEvent({category: 'Search', action: 'tryExampleQuery', label: query}); trackEvent({category: 'Search', action: 'Getting Started'});
} }
export function sendExpandEvent(): void { export function sendExpandEvent(): void {
trackEvent({category: 'Result', action: 'expand'}); trackEvent({category: 'Result', action: 'Expand Card'});
} }
export function sendAcceptSuggestionEvent(): void { export function sendAcceptSuggestionEvent(): void {
trackEvent({category: 'Suggestion', action: 'accept'}); trackEvent({category: 'Suggestion', action: 'Accept'});
} }
export function sendShuffleSuggestionEvent(): void { export function sendShuffleSuggestionEvent(): void {
trackEvent({category: 'Suggestion', action: 'shuffle'}); trackEvent({category: 'Suggestion', action: 'Shuffle'});
} }
export function initSentry(): void { export function initSentry(): void {