Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2580 google analytics #2681

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/.env-example.env
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=YOUR_WALLET_CONNECT_PROJECT_ID
NEXT_PUBLIC_WEB3_ONBOARD_EXPLORE_URL=http://localhost:3000/
NEXT_PUBLIC_FF_CERAMIC_CLIENT=off
NEXT_PUBLIC_ONBOARD_RESET_INDEX=1
NEXT_PUBLIC_GA_ID=id
12 changes: 12 additions & 0 deletions app/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ import hash from "object-hash";
import TagManager from "react-gtm-module";
import { useDatastoreConnectionContext } from "../context/datastoreConnectionContext";
import { useWeb3ModalError } from "@web3modal/ethers/react";
import Script from "next/script";

const success = "../../assets/check-icon2.svg";
const fail = "../assets/verification-failed-bright.svg";

const GA_ID = process.env.NEXT_PUBLIC_GA_ID;

export default function Dashboard() {
const customization = useCustomization();
const { useCustomDashboardPanel } = customization;
Expand Down Expand Up @@ -258,6 +261,15 @@ export default function Dashboard() {

return (
<PageRoot className="text-color-1">
<Script src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`} strategy="afterInteractive" />
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${GA_ID}');
`}
</Script>
{modals}
<HeaderContentFooterGrid>
<Header />
Expand Down
5 changes: 4 additions & 1 deletion infra/aws/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ const stakingEnvVars = Object({
NEXT_PUBLIC_ENABLE_ARBITRUM_MAINNET: "on",
NEXT_PUBLIC_ARBITRUM_RPC_URL: arbitrumRpcUrl,
NEXT_PUBLIC_GET_GTC_STAKE_API: "https://api.scorer.gitcoin.co/registry/gtc-stake/",
NEXT_PUBLIC_MAX_LEGACY_ROUND_ID: 7,
NEXT_PUBLIC_MAX_LEGACY_ROUND_ID: 7,
NEXT_PUBLIC_GA_ID: "",
},
staging: {
NEXT_PUBLIC_CERAMIC_CACHE_ENDPOINT: "https://api.staging.scorer.gitcoin.co/ceramic-cache",
Expand All @@ -128,6 +129,7 @@ const stakingEnvVars = Object({
NEXT_PUBLIC_ARBITRUM_RPC_URL: arbitrumRpcUrl,
NEXT_PUBLIC_GET_GTC_STAKE_API: "https://api.scorer.gitcoin.co/registry/gtc-stake/",
NEXT_PUBLIC_MAX_LEGACY_ROUND_ID: 7,
NEXT_PUBLIC_GA_ID: "",
},
production: {
NEXT_PUBLIC_CERAMIC_CACHE_ENDPOINT: "https://api.scorer.gitcoin.co/ceramic-cache",
Expand All @@ -147,6 +149,7 @@ const stakingEnvVars = Object({
NEXT_PUBLIC_ARBITRUM_RPC_URL: arbitrumRpcUrl,
NEXT_PUBLIC_GET_GTC_STAKE_API: "https://api.scorer.gitcoin.co/registry/gtc-stake/",
NEXT_PUBLIC_MAX_LEGACY_ROUND_ID: 7,
NEXT_PUBLIC_GA_ID: "G-XHXGR14F2B",
},
});

Expand Down
Loading