Skip to content

Commit

Permalink
add GA
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew.zhao committed Jun 13, 2023
1 parent 4a5c8ef commit a58e1ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
12 changes: 6 additions & 6 deletions web/app/components/base/ga/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FC } from 'react'
import type { FC } from 'react'
import React from 'react'
import Script from 'next/script'

export enum GaType {
Expand All @@ -7,17 +8,16 @@ export enum GaType {
}

const gaIdMaps = {
[GaType.admin]: 'G-DM9497FN4V',
[GaType.webapp]: 'G-2MFWXK7WYT',
[GaType.admin]: 'G-9WTD09KFGD',
[GaType.webapp]: 'G-9WTD09KFGD',
}

export interface IGAProps {
export type IGAProps = {
gaType: GaType
}


const GA: FC<IGAProps> = ({
gaType
gaType,
}) => {
return (
<Script
Expand Down
13 changes: 0 additions & 13 deletions web/app/components/i18n-server.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import Script from 'next/script'
import I18N from './i18n'
import { ToastProvider } from './base/toast'
import { getDictionary, getLocaleOnServer } from '@/i18n/server'
Expand All @@ -18,18 +17,6 @@ const I18NServer = async ({

return (
<I18N {...{ locale, dictionary }}>
<Script id="google-analytics" strategy="afterInteractive">
{`
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'G-9WTD09KFGD', 'auto');
ga('send', 'pageview');
`}
</Script>
<Script
src="https://www.google-analytics.com/analytics.js"
strategy="afterInteractive"
/>

<ToastProvider>{children}</ToastProvider>
</I18N>
)
Expand Down

0 comments on commit a58e1ca

Please sign in to comment.