1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +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 {mobile} from '../util/css';
import {sendExampleQueryEvent} from '../util/analytics';
import {sendGettingStartedEvent} from '../util/analytics';
const Welcome: React.FC = () => {
const {t} = useTranslation();
@ -36,9 +36,7 @@ const Welcome: React.FC = () => {
<ButtonContainer>
<List>
<ListButton>
<Link
to="/s/namae"
onClick={() => sendExampleQueryEvent('namae')}>
<Link to="/s/namae" onClick={() => sendGettingStartedEvent()}>
{t('gettingStarted')}
</Link>
</ListButton>

View File

@ -38,23 +38,23 @@ export function trackEvent({
}
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 {
trackEvent({category: 'Search', action: 'tryExampleQuery', label: query});
export function sendGettingStartedEvent(): void {
trackEvent({category: 'Search', action: 'Getting Started'});
}
export function sendExpandEvent(): void {
trackEvent({category: 'Result', action: 'expand'});
trackEvent({category: 'Result', action: 'Expand Card'});
}
export function sendAcceptSuggestionEvent(): void {
trackEvent({category: 'Suggestion', action: 'accept'});
trackEvent({category: 'Suggestion', action: 'Accept'});
}
export function sendShuffleSuggestionEvent(): void {
trackEvent({category: 'Suggestion', action: 'shuffle'});
trackEvent({category: 'Suggestion', action: 'Shuffle'});
}
export function initSentry(): void {