Skip to content

Commit 27472f3

Browse files
committed
Added gTag
1 parent dc6cfab commit 27472f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/languages.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Locale } from 'i18n';
22
import styled from 'styled-components';
33
import { useRouter } from 'next/dist/client/router';
44

5+
import * as gtag from 'lib/gtag';
6+
57
const Container = styled.div`
68
top: 0;
79
right: 1rem;
@@ -29,6 +31,11 @@ export function Languages() {
2931
const { locales, push } = useRouter();
3032

3133
const handleLocaleClick = (locale: Locale) => () => {
34+
gtag.event({
35+
action: 'i18n_click',
36+
category: 'Locale',
37+
label: locale,
38+
});
3239
push('/', '/', { locale });
3340
};
3441

0 commit comments

Comments
 (0)