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

Update/recaptcha script #1680

Merged
merged 3 commits into from
Oct 30, 2023
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 apps/web/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@

export const GAUZY_API_SERVER_URL = process.env.GAUZY_API_SERVER_URL || 'https://api.gauzy.co/api';
export const INVITE_CALLBACK_URL = process.env.INVITE_CALLBACK_URL;
export const INVITE_CALLBACK_PATH = '/auth/passcode';

Check warning on line 36 in apps/web/app/constants.ts

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (passcode)
export const VERIFY_EMAIL_CALLBACK_URL = process.env.VERIFY_EMAIL_CALLBACK_URL;
export const VERIFY_EMAIL_CALLBACK_PATH = '/verify-email';
export const GA_MEASUREMENT_ID = process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID

export const SMTP_FROM_ADDRESS = process.env.SMTP_FROM_ADDRESS || '[email protected]';
export const SMTP_HOST = process.env.SMTP_HOST || '';
Expand Down
30 changes: 18 additions & 12 deletions apps/web/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint-disable no-mixed-spaces-and-tabs */
import 'react-loading-skeleton/dist/skeleton.css';
import '../styles/globals.css';

import { jitsuConfiguration } from '@app/constants';
import { GA_MEASUREMENT_ID, RECAPTCHA_SITE_KEY, jitsuConfiguration } from '@app/constants';
import { JitsuProvider } from '@jitsu/jitsu-react';
import { Analytics } from '@vercel/analytics/react';
import { AppState } from 'lib/app/init-state';
import ChatwootWidget from 'lib/features/integrations/chatwoot';

Check warning on line 8 in apps/web/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Chatwoot)

Check warning on line 8 in apps/web/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (chatwoot)
import { ThemeProvider } from 'next-themes';
import type { AppProps } from 'next/app';
import Head from 'next/head';
Expand All @@ -16,20 +15,27 @@
import { RecoilRoot } from 'recoil';
import { JitsuAnalytics } from '../lib/components/services/jitsu-analytics';
import i18n from '../ni18n.config';

const MyApp = ({ Component, pageProps }: AppProps) => {
const isJitsuEnvsPresent = jitsuConfiguration.host && jitsuConfiguration.writeKey;
return (
<>
<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>

{GA_MEASUREMENT_ID && (
<>
<Script
strategy="lazyOnload"
src={`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`}
/>
<Script strategy="lazyOnload" id="google-analytic-script">
{` window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

Check warning on line 32 in apps/web/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (gtag)
gtag('js', new Date());

Check warning on line 33 in apps/web/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (gtag)
gtag('config', '${GA_MEASUREMENT_ID}');`}

Check warning on line 34 in apps/web/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (gtag)
</Script>
</>
)}

<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
Expand All @@ -49,7 +55,7 @@
<I18nextProvider i18n={i18n}>
<AppState />
<JitsuAnalytics user={pageProps?.user} />
<ChatwootWidget />

Check warning on line 58 in apps/web/pages/_app.tsx

View workflow job for this annotation

GitHub Actions / Cspell

Unknown word (Chatwoot)
<Component {...pageProps} />
</I18nextProvider>
</SkeletonTheme>
Expand Down
Loading