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

[Feature] disable GA if no env var set #1678

Open
evereq opened this issue Oct 29, 2023 · 2 comments
Open

[Feature] disable GA if no env var set #1678

evereq opened this issue Oct 29, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request Gauzy GitHub
Milestone

Comments

@evereq
Copy link
Member

evereq commented Oct 29, 2023

See code below from apps\web\pages\_app.tsx:

<Script
				strategy="lazyOnload"
				src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID}`}
			/>
			<Script strategy="lazyOnload" id="google-analytic-script">
				{` window.dataLayer = window.dataLayer || [];
  				function gtag(){dataLayer.push(arguments);}
  				gtag('js', new Date());
  				gtag('config', '${process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID}');`}
			</Script>

We need to disable loading that code if env var is NOT set (empty or undefined value)

@evereq evereq added the enhancement New feature or request label Oct 29, 2023
@evereq evereq added this to the v0.1.0 milestone Oct 29, 2023
@maceteligolden
Copy link
Contributor

@evereq noted, i'll create a PR and make the changes

@maceteligolden
Copy link
Contributor

@evereq here is the PR #1680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Gauzy GitHub
Projects
Status: No status
Development

No branches or pull requests

2 participants