Skip to content

Commit

Permalink
added google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
leonacostaok committed Nov 8, 2023
1 parent ad0a4cf commit 1ef50d1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
28 changes: 25 additions & 3 deletions example/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Web3ReactHooks, Web3ReactProvider } from "@web3-react/core";
import { MetaMask } from "@web3-react/metamask";
import { AppProps } from "next/app";
import React, { useEffect } from "react";
import Script from 'next/script'

import { hooks as metaMaskHooks, metaMask } from "../connectors/metaMask";

Expand Down Expand Up @@ -30,8 +31,29 @@ export default function App({ Component, pageProps }: AppProps) {
};
}, []);
return (
<Web3ReactProvider connectors={connectors}>
<Component {...pageProps} />
</Web3ReactProvider>
<>

<head>
<title>MetaMask Encrypt/Decrypt</title>
<meta name="description" content="MetaMask Encrypt and decrypt tools" />
<meta property="og:title" content="MetaMask Encrypt/Decrypt" />
<meta property="og:description" content="MetaMask Encrypt and decrypt tools" />
<meta property="og:url" content="https://metamask-encrypt-decrypt.dandelionlabs.io/" />
<meta property="og:type" content="website" />
<Script src="https://www.googletagmanager.com/gtag/js?id=G-YVFR36G469" />
<Script id="google-analytics">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-YVFR36G469');
`}
</Script>
</head>
<Web3ReactProvider connectors={connectors}>
<Component {...pageProps} />
</Web3ReactProvider>
</>
);
}
8 changes: 0 additions & 8 deletions example/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ export default function Home() {
const [activeTab, setActiveTab] = useState(TabOptions.ENCRYPT);
return (
<>
<head>
<title>MetaMask Encrypt/Decrypt</title>
<meta name="description" content="MetaMask Encrypt and decrypt tools" />
<meta property="og:title" content="MetaMask Encrypt/Decrypt" />
<meta property="og:description" content="MetaMask Encrypt and decrypt tools" />
<meta property="og:url" content="https://metamask-encrypt-decrypt.dandelionlabs.io/" />
<meta property="og:type" content="website" />
</head>
{account ? (
<Tabs>
<p>Connected with account: {account}</p>
Expand Down

0 comments on commit 1ef50d1

Please sign in to comment.