|
2 | 2 | import { useEffect, type FC } from "react"; |
3 | 3 | import "vanilla-cookieconsent/dist/cookieconsent.css"; |
4 | 4 | import * as CookieConsent from "vanilla-cookieconsent"; |
5 | | -import getConfig from "@azure-fundamentals/utils/CookieConfig"; |
6 | | -import addCookieConsentListeners from "@azure-fundamentals/utils/CookieListeners"; |
| 5 | +import getConfig from "@practice-tests-exams-platform/utils/CookieConfig"; |
| 6 | +import addCookieConsentListeners from "@practice-tests-exams-platform/utils/CookieListeners"; |
7 | 7 | import { useTheme } from "../contexts/ThemeContext"; |
8 | | -import Script from "next/script"; |
9 | 8 |
|
10 | 9 | const Cookie: FC = () => { |
11 | | - const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_TRACKING_ID; |
12 | 10 | const { theme } = useTheme(); |
13 | 11 |
|
14 | 12 | useEffect(() => { |
@@ -42,20 +40,6 @@ const Cookie: FC = () => { |
42 | 40 | <path d="M8 0a7.96 7.96 0 0 0-4.075 1.114q-.245.102-.437.28A8 8 0 1 0 8 0m3.25 14.201a1.5 1.5 0 0 0-2.13.71A7 7 0 0 1 8 15a6.97 6.97 0 0 1-3.845-1.15 1.5 1.5 0 1 0-2.005-2.005A6.97 6.97 0 0 1 1 8c0-1.953.8-3.719 2.09-4.989a1.5 1.5 0 1 0 2.469-1.574A7 7 0 0 1 8 1c1.42 0 2.742.423 3.845 1.15a1.5 1.5 0 1 0 2.005 2.005A6.97 6.97 0 0 1 15 8c0 .596-.074 1.174-.214 1.727a1.5 1.5 0 1 0-1.025 2.25 7 7 0 0 1-2.51 2.224Z" /> |
43 | 41 | </svg> |
44 | 42 | </button> |
45 | | - <Script |
46 | | - src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`} |
47 | | - /> |
48 | | - <Script id="google-analytics"> |
49 | | - {` |
50 | | - window.dataLayer = window.dataLayer || []; |
51 | | - function gtag(){dataLayer.push(arguments);} |
52 | | - gtag('js', new Date()); |
53 | | - gtag('consent', 'default', {'analytics_storage':'denied'}) |
54 | | - gtag('config', '${GA_TRACKING_ID}', { |
55 | | - page_path: window.location.pathname, |
56 | | - }); |
57 | | - `} |
58 | | - </Script> |
59 | 43 | </> |
60 | 44 | ); |
61 | 45 | }; |
|
0 commit comments