121116 updated to Ga4
This commit is contained in:
+3
-1
@@ -6,7 +6,8 @@ import { useStore, Provider } from "react-redux";
|
|||||||
import { persistStore } from "redux-persist";
|
import { persistStore } from "redux-persist";
|
||||||
import { PersistGate } from "redux-persist/integration/react";
|
import { PersistGate } from "redux-persist/integration/react";
|
||||||
import { SessionProvider as AuthProvider } from "next-auth/react";
|
import { SessionProvider as AuthProvider } from "next-auth/react";
|
||||||
|
import { Tracking } from "../components/tracking";
|
||||||
|
import { GoogleAnalytics } from "@next/third-parties/google";
|
||||||
const MyApp = ({ Component, pageProps: { session, ...pageProps } }) => {
|
const MyApp = ({ Component, pageProps: { session, ...pageProps } }) => {
|
||||||
const store = useStore((state) => state);
|
const store = useStore((state) => state);
|
||||||
const persistor = persistStore(store, {}, function () {
|
const persistor = persistStore(store, {}, function () {
|
||||||
@@ -21,6 +22,7 @@ const MyApp = ({ Component, pageProps: { session, ...pageProps } }) => {
|
|||||||
loading={<Loading />}
|
loading={<Loading />}
|
||||||
>
|
>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
|
<GoogleAnalytics gaId="G-GTWW3JT03Z" />
|
||||||
</PersistGate>
|
</PersistGate>
|
||||||
</Provider>
|
</Provider>
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
|
|||||||
+8
-6
@@ -38,11 +38,12 @@ class MyDocument extends Document {
|
|||||||
csp += `base-uri 'self';`;
|
csp += `base-uri 'self';`;
|
||||||
csp += `form-action 'self' ` + process.env.NEXTAUTH_URL + ` ;`;
|
csp += `form-action 'self' ` + process.env.NEXTAUTH_URL + ` ;`;
|
||||||
csp += `object-src 'self' data:;`;
|
csp += `object-src 'self' data:;`;
|
||||||
csp +=
|
csp += `default-src 'self' https://www.google-analytics.com;`;
|
||||||
`script-src 'self' ` +
|
csp += `connect-src 'self' https://region1.google-analytics.com;`;
|
||||||
process.env.NEXTAUTH_URL +
|
csp += `script-src 'self' 'unsafe-eval' 'unsafe-inline' https://region1.google-analytics.com https://www.google-analytics.com/ https://tagmanager.google.com/ https://www.googletagmanager.com/;`;
|
||||||
` 'unsafe-inline' https://www.googletagmanager.com https://maps.googleapis.com 'nonce-${generatedNonce}' 'unsafe-eval';`;
|
csp += `style-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://www.google-analytics.com https://tagmanager.google.com/ https://www.googletagmanager.com/ https://fonts.googleapis.com/;`;
|
||||||
csp += `style-src 'self' https://fonts.googleapis.com 'unsafe-inline' data:;`;
|
csp += `img-src 'self' 'unsafe-inline' https://fonts.gstatic.com https://www.googletagmanager.com https://www.google-analytics.com https://ssl.gstatic.com/ data:;`;
|
||||||
|
csp += `font-src 'self' 'unsafe-inline' https://pro.fontawesome.com/ https://fonts.gstatic.com/ data:;`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Html lang={locale}>
|
<Html lang={locale}>
|
||||||
@@ -50,10 +51,11 @@ class MyDocument extends Document {
|
|||||||
<meta httpEquiv="Content-Security-Policy" content={csp} />
|
<meta httpEquiv="Content-Security-Policy" content={csp} />
|
||||||
{useGATracking && (
|
{useGATracking && (
|
||||||
<Tracking
|
<Tracking
|
||||||
googleTagManagerID={googleTagManagerID}
|
googleTagManagerID="G-GTWW3JT03Z"
|
||||||
nonce={generatedNonce}
|
nonce={generatedNonce}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{/* <GoogleAnalytics gaId={googleTagManagerID} /> */}
|
||||||
</Head>
|
</Head>
|
||||||
<body className="js-enabled">
|
<body className="js-enabled">
|
||||||
{useGATracking && (
|
{useGATracking && (
|
||||||
|
|||||||
Reference in New Issue
Block a user