mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-25 06:08:03 -05:00
ga analytics merge to develop (#633)
* added analytics * added analytics snippet * Reworked GA addition implementation Co-authored-by: Alec LaLonde <alec@convergencelabs.com>
This commit is contained in:
@@ -19,4 +19,5 @@ export const CONFIG = {
|
||||
brightIdNodeUrl:
|
||||
process.env.NEXT_BRIGHTID_NODE_URL || 'http:%2f%2fnode.brightid.org',
|
||||
publicUrl: process.env.NEXT_PUBLIC_VERCEL_URL || 'http://localhost:3000',
|
||||
gaId: process.env.NEXT_PUBLIC_GA4_ID || undefined,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* eslint-disable react/no-danger */
|
||||
import { ChakraProvider, CSSReset, MetaTheme } from '@metafam/ds';
|
||||
import { MobileFooter } from 'components/MobileFooter';
|
||||
import { PageHeader } from 'components/PageHeader';
|
||||
import { CONFIG } from 'config';
|
||||
import { Web3ContextProvider } from 'contexts/Web3Context';
|
||||
import Head from 'next/head';
|
||||
import { WithUrqlProps } from 'next-urql';
|
||||
@@ -18,6 +20,25 @@ const App: React.FC<WithUrqlProps> = ({
|
||||
<Head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>MetaGame</title>
|
||||
{CONFIG.gaId != null && (
|
||||
<>
|
||||
<script
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${CONFIG.gaId}`}
|
||||
/>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments)}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '${CONFIG.gaId}');
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Head>
|
||||
<Web3ContextProvider resetUrqlClient={resetUrqlClient}>
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user