From af4f4ae942882d4d3835236a8c06447a65da3b2f Mon Sep 17 00:00:00 2001 From: jacob-moore-cb Date: Mon, 29 Jan 2024 15:36:56 -0800 Subject: [PATCH] Revert "Add Cookie Manager and Add CCA Device Tracking" (#286) --- apps/base-docs/docs/cookie-policy.mdx | 95 ----- apps/base-docs/package.json | 2 - apps/base-docs/sidebars.js | 1 - .../src/components/CookieManager/index.tsx | 21 - .../CookieManager/styles.module.css | 18 - apps/base-docs/src/components/Icon/index.tsx | 3 +- apps/base-docs/src/theme/Root.jsx | 96 +---- apps/base-docs/src/utils/cookieManagement.ts | 42 -- .../src/utils/cookieManagerConfig.ts | 42 -- apps/base-docs/src/utils/initCCA.ts | 48 +-- apps/web/package.json | 5 +- apps/web/pages/_app.tsx | 78 +--- apps/web/pages/cookie-policy.tsx | 161 -------- apps/web/pages/global.css | 1 - .../ClientAnalyticsScript.tsx | 23 -- .../src/components/Layout/Footer/Footer.tsx | 16 - apps/web/src/components/Layout/Layout.tsx | 48 +-- apps/web/src/utils/cookieManagerConfig.ts | 42 -- apps/web/src/utils/initCCA.ts | 25 +- yarn.lock | 379 +----------------- 20 files changed, 46 insertions(+), 1100 deletions(-) delete mode 100644 apps/base-docs/docs/cookie-policy.mdx delete mode 100644 apps/base-docs/src/components/CookieManager/index.tsx delete mode 100644 apps/base-docs/src/components/CookieManager/styles.module.css delete mode 100644 apps/base-docs/src/utils/cookieManagement.ts delete mode 100644 apps/base-docs/src/utils/cookieManagerConfig.ts delete mode 100644 apps/web/pages/cookie-policy.tsx delete mode 100644 apps/web/src/components/ClientAnalyticsScript/ClientAnalyticsScript.tsx delete mode 100644 apps/web/src/utils/cookieManagerConfig.ts diff --git a/apps/base-docs/docs/cookie-policy.mdx b/apps/base-docs/docs/cookie-policy.mdx deleted file mode 100644 index 11df476411..0000000000 --- a/apps/base-docs/docs/cookie-policy.mdx +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Cookie Policy -slug: /cookie-policy -description: Policy explaining how Base uses cookies on our website. ---- - -# Base Cookie Policy - -Last updated: January 17, 2024 - ---- - -import CookieManager from '../src/components/CookieManager'; - -This Cookie Policy explains how Base (referred to here as **"we"**, **"us"** and **"our"**) -uses cookies and similar technologies when you visit [base.org](https://base.org) (the -**"Site"**) and/or when you explore and use Base through the Base protocol or any other -applications, tools, and features we operate (collectively referred to as the **"Services"**). -It explains what these technologies are and why we use them, as well as your rights to -control our use of them. - -In some cases, we may use cookies and similar technologies to collect personal information, -or information that becomes personal information if we combine it with other information. -In such cases, the [Base Privacy Policy](/privacy-policy) will apply -in addition to this Cookie Policy. - -## 1. What Are Cookies? - -Browser cookies are text files with small pieces of data downloaded onto your computer or -mobile device. Browser cookies and other similar technologies enable websites and apps to -store information or facilitate access to information stored on your device to enable -certain features and distinguish you from other visitors. These technologies are used by -most website and app providers to let users navigate between pages efficiently, ensure -security of the webpage or application, understand how their websites are used, remember -user preferences and generally improve the user experience. More information on cookies -and their use can be found at [aboutcookies.org](https://www.aboutcookies.org) or -[allaboutcookies.org](https://www.allaboutcookies.org). Cookies set by the website operator -are called **"first party cookies"** and Cookies set by parties other than the website -operator are called **"third party cookies"**. You should check the third-party's website -for more information on how they use cookies. - -## 2. What Do We Use Cookies For? - -When you access our Site and Services, we, or companies we work with, may place cookies -(collectively called **"cookies"** in this Cookie Policy) and similar technologies (such as -web beacons, software development kits (**"SDKs"**), APIs, tags and local storage) on your -computer or other device for the following purposes: - -### Strictly Necessary purposes - -Strictly Necessary cookies are essential for our Services to function and therefore -cannot be switched off. They are usually only set in response to actions made by you -which amount to a request for services, such as setting your privacy preferences, -logging in, or filling in forms. These also include cookies we may rely on for security -purposes, such as to prevent unauthorised access attempts. You can set your browser to -block or alert you about these cookies at any time, but some features of our Services -may not work. - -### Performance purposes - -We use these cookies to count visits and traffic sources so we can measure and improve -the performance of our Services. These cookies help us to know which pages are the most -and least popular and see how visitors move around the Site, and to resolve any errors -that occur on the Services quickly to provide you with a better experience. For example, -our first party base_device_id cookie is used to provide analytics on how our Site and -Services perform. This cookie lasts for 3 months. - -## 3. How to Manage Cookies, Similar Technologies and Targeted Online Mobile Advertising - -You have the right to decide whether to accept or reject cookies (except strictly necessary -cookies). You can enable or disable categories of cookies by visiting our . -This includes both first party and third party cookies. You can use the browser with which you -are viewing this website to enable, disable or delete cookies. To do this, follow the instructions -provided by your browser (usually located within the "Help", "Tools" or "Edit" settings). However, -please note, if you set your browser to disable cookies, you may not be able to access secure areas -of our Services. Also, if you disable cookies, other parts of our Services may not function properly. - -There are also additional tools available to manage third party cookies. You can visit the DAA's -opt-out portal available at [optout.aboutads.info](http://optout.aboutads.info/), the DAA of Canada's -opt-out portal available at [youradchoices.ca/en/tools](https://youradchoices.ca/en/tools), or visit -the NAI's opt-out portal available at [optout.networkadvertising.org](http://optout.networkadvertising.org/?c=1). -Residents of the European Union may opt-out of online behavioural advertising served by the European -Interactive Digital Advertising Alliance's participating member organizations by visiting -[youronlinechoices.eu](https://www.youronlinechoices.eu/) or through your mobile device settings, -where available and the DAA's AppChoices mobile application opt-out offering here: -[youradchoices.com/appchoices](https://youradchoices.com/appchoices). - -If you have any questions about our use of cookies or other technologies, please submit -your request to privacy@base.org. - -## 4. Will This Cookie Policy Be Updated? - -We may update this Cookie Policy from time to time to reflect, for example, changes to -the cookies we use or for other operational, legal or regulatory reasons. You can also -revisit this page if you wish to keep yourself informed. diff --git a/apps/base-docs/package.json b/apps/base-docs/package.json index 554bdf2fd7..f82b3838c0 100644 --- a/apps/base-docs/package.json +++ b/apps/base-docs/package.json @@ -16,8 +16,6 @@ "typecheck": "tsc" }, "dependencies": { - "@coinbase/cookie-banner": "^1.0.3", - "@coinbase/cookie-manager": "^1.1.1", "@docusaurus/core": "2.4.1", "@docusaurus/preset-classic": "2.4.1", "@mdx-js/react": "^1.6.22", diff --git a/apps/base-docs/sidebars.js b/apps/base-docs/sidebars.js index 639dde3ab6..7b632ce2a6 100644 --- a/apps/base-docs/sidebars.js +++ b/apps/base-docs/sidebars.js @@ -274,6 +274,5 @@ module.exports = { }, ['terms-of-service'], ['privacy-policy'], - ['cookie-policy'], ], }; diff --git a/apps/base-docs/src/components/CookieManager/index.tsx b/apps/base-docs/src/components/CookieManager/index.tsx deleted file mode 100644 index 3d3548185b..0000000000 --- a/apps/base-docs/src/components/CookieManager/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React, { useState, useCallback } from 'react'; -import { CookiePreferencesModal } from '@coinbase/cookie-banner'; - -import styles from './styles.module.css'; - -export default function CookieManager() { - const [isOpen, setIsOpen] = useState(false); - - const handleOpenModal = useCallback(() => setIsOpen(true), []); - - const handleCloseModal = useCallback(() => setIsOpen(false), []); - - return ( - <> - - {isOpen && } - - ); -} diff --git a/apps/base-docs/src/components/CookieManager/styles.module.css b/apps/base-docs/src/components/CookieManager/styles.module.css deleted file mode 100644 index d9c082ec60..0000000000 --- a/apps/base-docs/src/components/CookieManager/styles.module.css +++ /dev/null @@ -1,18 +0,0 @@ -.cookieManagerButton { - color: #3773f5; - background-color: transparent; - font-size: 1rem; - padding: 0; - appearance: none; - cursor: pointer; - display: inline-block; -} -[data-theme='dark'] .cookieManagerButton { - color: #3773f5; -} -[data-theme='light'] .cookieManagerButton { - color: #0052ff; -} -.cookieManagerButton:hover { - text-decoration: underline; -} diff --git a/apps/base-docs/src/components/Icon/index.tsx b/apps/base-docs/src/components/Icon/index.tsx index 03586e294f..38c06d0f23 100644 --- a/apps/base-docs/src/components/Icon/index.tsx +++ b/apps/base-docs/src/components/Icon/index.tsx @@ -1,10 +1,11 @@ type IconProps = { name: 'thumbs-up' | 'thumbs-up-filled' | 'thumbs-down' | 'thumbs-down-filled' | 'caret-down'; + color?: 'white' | 'black'; width?: string; height?: string; }; -export default function Icon({ name, width = '24', height = '24' }: IconProps) { +export default function Icon({ name, color = 'white', width = '24', height = '24' }: IconProps) { if (name === 'thumbs-up') { return ( { - const priorConsent = trackingPreference.current?.consent; - trackingPreference.current = newPreference; - - if (!priorConsent) { - // The first time the modal appears, this function is called with nothing present in - // trackingPreference.current. To avoid an infinite refresh loop, we return early on - // the first call. - return; - } - - const newConsent = newPreference.consent; - - // Check if the preferences have changed. - const diff = [ - ...priorConsent.filter((elem) => !newConsent.includes(elem)), - ...newConsent.filter((elem) => !priorConsent.includes(elem)), - ]; - - // Reload if the preferences have changed. - if (diff.length > 0) { - window.location.reload(); - } - }, []); - - const handleLogError = useCallback((err) => console.error(err), []); - useEffect(() => setMounted(true), []); - - if (!mounted) return null; - return ( - - - {children} - - - + {children} ); } diff --git a/apps/base-docs/src/utils/cookieManagement.ts b/apps/base-docs/src/utils/cookieManagement.ts deleted file mode 100644 index 97e2ebbfa7..0000000000 --- a/apps/base-docs/src/utils/cookieManagement.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - Coinbase Client Analytics Lite is currently loaded via a Docusaurus script tag configured in docusaurus.config.js - and initialized via a Docusaurus client module in ./initCCA.ts. @coinbase/cookie-manager hooks cannot be used in - a Docusaurus client module, so we are temporarily using the below cookie management functions. This implementation - will be adjusted once CCA becomes open source, as we'll then be able to cease use of the CCA Lite script and move - the CCA implementation out of a client module so @coinbase/cookie-manager hooks can be used. -*/ - -export function setCookie(cookieName: string, cookieValue: string, expiryDays: number) { - const d = new Date(); - d.setTime(d.getTime() + expiryDays * 24 * 60 * 60 * 1000); - let expires = 'expires=' + d.toUTCString(); - document.cookie = cookieName + '=' + cookieValue + ';' + expires + ';path=/'; -} - -export function getCookie(cookieName: string): string | undefined { - let name = cookieName + '='; - let decodedCookie = decodeURIComponent(document.cookie); - let ca = decodedCookie.split(';'); - for (const el of ca) { - let c = el; - while (c.startsWith(' ')) { - c = c.substring(1); - } - if (c.startsWith(name)) { - return c.substring(name.length, c.length); - } - } - return undefined; -} - -export function deserializeCookie(cookie: string): string | undefined { - let parsedCookie: string | undefined; - - try { - parsedCookie = JSON.parse(cookie) as string; - } catch (e) { - parsedCookie = cookie; - } - - return parsedCookie; -} diff --git a/apps/base-docs/src/utils/cookieManagerConfig.ts b/apps/base-docs/src/utils/cookieManagerConfig.ts deleted file mode 100644 index 881b944b9b..0000000000 --- a/apps/base-docs/src/utils/cookieManagerConfig.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Framework, Region, TrackerType, TrackingCategory } from '@coinbase/cookie-manager'; - -export const cookieManagerConfig = { - categories: [ - { - id: TrackingCategory.NECESSARY, - expiry: 365, - required: true, - trackers: [ - { - id: 'ip_country', - type: TrackerType.COOKIE, - expiry: 10, - }, - { - id: 'locale', - type: TrackerType.COOKIE, - }, - ], - }, - { - id: TrackingCategory.PERFORMANCE, - expiry: 365, - trackers: [ - { - id: 'base_device_id', - type: TrackerType.COOKIE, - }, - ], - }, - ], - geolocationRules: [ - { - region: Region.DEFAULT, - framework: Framework.OPT_OUT, - }, - { - region: Region.EU, - framework: Framework.OPT_IN, - }, - ], -}; diff --git a/apps/base-docs/src/utils/initCCA.ts b/apps/base-docs/src/utils/initCCA.ts index b6e94dec46..65e42dbcb3 100644 --- a/apps/base-docs/src/utils/initCCA.ts +++ b/apps/base-docs/src/utils/initCCA.ts @@ -4,46 +4,28 @@ // @ts-nocheck const docusaurusConfig = require('@generated/docusaurus.config'); import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; -import { setCookie, getCookie, deserializeCookie } from './cookieManagement'; -import { TrackingPreference } from '@coinbase/cookie-manager'; const { customFields } = docusaurusConfig.default; const isDevelopment = customFields.nodeEnv === 'development'; // Initialize Client Analytics const initCCA = () => { - if (ExecutionEnvironment.canUseDOM) { - let deviceId: string | undefined = deserializeCookie(getCookie('base_device_id')); - - const trackingPreference: TrackingPreference | undefined = deserializeCookie( - getCookie('cm_default_preferences'), - ); - const trackingAllowed = trackingPreference?.consent.includes('performance'); - - if (!trackingAllowed) { - deviceId = 'base_docs_device_id'; - } else if (!deviceId) { - deviceId = crypto?.randomUUID(); - setCookie('base_device_id', deviceId, 365); - } - - if (window.ClientAnalytics) { - const { init, identify, PlatformName } = window.ClientAnalytics; - - init({ - isProd: !isDevelopment, - amplitudeApiKey: isDevelopment - ? 'ca92bbcb548f7ec4b8ebe9194b8eda81' - : '2b38c7ac93c0dccc83ebf9acc5107413', - platform: PlatformName.web, - projectName: 'base_docs', - showDebugLogging: isDevelopment, - version: '1.0.0', - apiEndpoint: 'https://cca-lite.coinbase.com', - }); + if (ExecutionEnvironment.canUseDOM && window.ClientAnalytics) { + const { init, identify, PlatformName } = window.ClientAnalytics; + + init({ + isProd: !isDevelopment, + amplitudeApiKey: isDevelopment + ? 'ca92bbcb548f7ec4b8ebe9194b8eda81' + : '2b38c7ac93c0dccc83ebf9acc5107413', + platform: PlatformName.web, + projectName: 'base_docs', + showDebugLogging: isDevelopment, + version: '1.0.0', + apiEndpoint: 'https://cca-lite.coinbase.com', + }); - identify({ deviceId: deviceId }); - } + identify({ deviceId: 'base_docs_device_id' }); } }; diff --git a/apps/web/package.json b/apps/web/package.json index ed11fe3607..cbc7473bc9 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -10,8 +10,6 @@ "update-contributors": "node ./scripts/updateContributors.js && npx prettier ./src/components/CoreContributors/CoreContributors.json -w" }, "dependencies": { - "@coinbase/cookie-banner": "^1.0.3", - "@coinbase/cookie-manager": "^1.1.1", "@heroicons/react": "^2.0.18", "@next/font": "^13.1.5", "ethers": "5.7.2", @@ -20,8 +18,7 @@ "react": "^18.2.0", "react-blockies": "^1.4.1", "react-dom": "^18.2.0", - "react-intl": "^6.2.1", - "uuidv4": "^6.2.13" + "react-intl": "^6.2.1" }, "devDependencies": { "@types/node": "18.11.18", diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index e11ac107a2..9e2b5012f3 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -1,19 +1,13 @@ import './global.css'; -import { useState, useEffect, useCallback, useRef } from 'react'; -import App, { AppContext, AppProps } from 'next/app'; +import Script from 'next/script'; +import { useRouter } from 'next/router'; +import { useCallback } from 'react'; +import initCCA from '../src/utils/initCCA'; import { MotionConfig } from 'framer-motion'; -import { - Provider as CookieManagerProvider, - Region, - TrackingCategory, - TrackingPreference, -} from '@coinbase/cookie-manager'; +import App, { AppContext, AppProps } from 'next/app'; import { Layout } from '../src/components/Layout/Layout'; -import ClientAnalyticsScript from '../src/components/ClientAnalyticsScript/ClientAnalyticsScript'; - -import { cookieManagerConfig } from '../src/utils/cookieManagerConfig'; /* Adding this to force NextJS to render the app on the server at runtime instead of statically which allows us to use ENV vars in the way we expect (Codeflow does not insert ENV vars at Dockerfile build time, so statically rendered pages don't have access) */ @@ -23,60 +17,18 @@ export async function getInitialProps(context: AppContext) { } export default function StaticApp({ Component, pageProps }: AppProps) { - // Cookie Manager Provider Configuration - const [isMounted, setIsMounted] = useState(false); - const trackingPreference = useRef(); - - const setTrackingPreference = useCallback((newPreference: TrackingPreference) => { - const priorConsent = trackingPreference.current?.consent; - trackingPreference.current = newPreference; - - if (!priorConsent) { - // The first time the modal appears, this function is called with nothing present in - // trackingPreference.current. To avoid an infinite refresh loop, we return early on - // the first call. - return; - } - - const newConsent = newPreference.consent; - - // Check if the preferences have changed. - const diff = [ - ...priorConsent.filter((elem: TrackingCategory) => !newConsent.includes(elem)), - ...newConsent.filter((elem: TrackingCategory) => !priorConsent.includes(elem)), - ]; - - // Reload if the preferences have changed. - if (diff.length > 0) { - window.location.reload(); - } - }, []); - - const handleLogError = useCallback((err: Error) => console.error(err), []); - - useEffect(() => { - setIsMounted(true); - }, []); - - if (!isMounted) return null; + const router = useRouter(); return ( - - - - - - - - + + ); } diff --git a/apps/web/pages/cookie-policy.tsx b/apps/web/pages/cookie-policy.tsx deleted file mode 100644 index 98b3509966..0000000000 --- a/apps/web/pages/cookie-policy.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import { useState, useCallback } from 'react'; -import { CookiePreferencesModal } from '@coinbase/cookie-banner'; -import Head from 'next/head'; - -export default function CookiePolicy() { - const [isOpen, setIsOpen] = useState(false); - - const handleOpenModal = useCallback(() => setIsOpen(true), []); - - const handleCloseModal = useCallback(() => setIsOpen(false), []); - - return ( - <> - - Base | Cookie Policy - - -
-
-

Base Cookie Policy

-

- This Cookie Policy explains how Base (referred to here as{' '} - "we", "us" and{' '} - "our") uses cookies and similar technologies when you visit{' '} - - base.org - {' '} - (the "Site") and/or when you explore and use Base through the - Base protocol or any other applications, tools, and features we operate (collectively - referred to as the "Services"). It explains what these - technologies are and why we use them, as well as your rights to control our use of them. -

-

- In some cases, we may use cookies and similar technologies to collect personal - information, or information that becomes personal information if we combine it with - other information. In such cases, the{' '} - - Base Privacy Policy - {' '} - will apply in addition to this Cookie Policy. -

-

1. What Are Cookies?

-

- Browser cookies are text files with small pieces of data downloaded onto your computer - or mobile device. Browser cookies and other similar technologies enable websites and - apps to store information or facilitate access to information stored on your device to - enable certain features and distinguish you from other visitors. These technologies are - used by most website and app providers to let users navigate between pages efficiently, - ensure security of the webpage or application, understand how their websites are used, - remember user preferences and generally improve the user experience. More information on - cookies and their use can be found at{' '} - - aboutcookies.org - {' '} - or{' '} - - allaboutcookies.org - - . -

-

- Cookies set by the website operator are called{' '} - "first party cookies" and Cookies set by parties other than - the website operator are called "third party cookies". You - should check the third-party's website for more information on how they use - cookies. -

-

2. What Do We Use Cookies For?

-

- When you access our Site and Services, we, or companies we work with, may place cookies - (collectively called "cookies" in this Cookie Policy) and - similar technologies (such as web beacons, software development kits ( - "SDKs"), APIs, tags and local storage) on your computer or - other device for the following purposes: -

-

Strictly Necessary purposes

-

- Strictly Necessary cookies are essential for our Services to function and therefore - cannot be switched off. They are usually only set in response to actions made by you - which amount to a request for services, such as setting your privacy preferences, - logging in, or filling in forms. These also include cookies we may rely on for security - purposes, such as to prevent unauthorised access attempts. You can set your browser to - block or alert you about these cookies at any time, but some features of our Services - may not work. -

-

Performance purposes

-

- We use these cookies to count visits and traffic sources so we can measure and improve - the performance of our Services. These cookies help us to know which pages are the most - and least popular and see how visitors move around the Site, and to resolve any errors - that occur on the Services quickly to provide you with a better experience. For example, - our first party base_device_id cookie is used to provide analytics on how our Site and - Services perform. This cookie lasts for 3 months. -

-

- 3. How to Manage Cookies, Similar Technologies and Targeted Online Mobile Advertising -

-

- You have the right to decide whether to accept or reject cookies (except strictly - necessary cookies). You can enable or disable categories of cookies by visiting our{' '} - - . This includes both first party and third party cookies. You can use the browser with - which you are viewing this website to enable, disable or delete cookies. To do this, - follow the instructions provided by your browser (usually located within the - "Help", "Tools" or "Edit" settings). However, please note, - if you set your browser to disable cookies, you may not be able to access secure areas - of our Services. Also, if you disable cookies, other parts of our Services may not - function properly. -

-

- There are also additional tools available to manage third party cookies. You can visit - the DAA's opt-out portal available at{' '} - - optout.aboutads.info - - , the DAA of Canada's opt-out portal available at{' '} - - youradchoices.ca/en/tools - - , or visit the NAI's opt-out portal available at{' '} - - optout.networkadvertising.org/?c=1 - - . Residents of the European Union may opt-out of online behavioural advertising served - by the European Interactive Digital Advertising Alliance's participating member - organizations by visiting{' '} - - youronlinechoices.eu - {' '} - or through your mobile device settings, where available and the DAA's AppChoices - mobile application opt-out offering here:{' '} - - youradchoices.com/appchoices - - . -

-

- If you have any questions about our use of cookies or other technologies, please submit - your request to privacy@base.org. -

-

4. Will This Cookie Policy Be Updated?

-

- We may update this Cookie Policy from time to time to reflect, for example, changes to - the cookies we use or for other operational, legal or regulatory reasons. You can also - revisit this page if you wish to keep yourself informed. -

-
-
- {isOpen && } - - ); -} diff --git a/apps/web/pages/global.css b/apps/web/pages/global.css index 4b9dcea0ff..3c5be06da4 100644 --- a/apps/web/pages/global.css +++ b/apps/web/pages/global.css @@ -32,7 +32,6 @@ body { height: 100%; margin: 0; min-height: 100vh; - font-family: '__coinbaseDisplay_7118f1'; } *, diff --git a/apps/web/src/components/ClientAnalyticsScript/ClientAnalyticsScript.tsx b/apps/web/src/components/ClientAnalyticsScript/ClientAnalyticsScript.tsx deleted file mode 100644 index dd751a6b8e..0000000000 --- a/apps/web/src/components/ClientAnalyticsScript/ClientAnalyticsScript.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { useCallback } from 'react'; -import { useSavedTrackingPreference, useCookie } from '@coinbase/cookie-manager'; -import { useRouter } from 'next/router'; -import Script from 'next/script'; -import initCCA from '../../utils/initCCA'; - -export default function ClientAnalyticsScript() { - const router = useRouter(); - const trackingPreference = useSavedTrackingPreference(); - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - const [deviceIdCookie, setDeviceIdCookie] = useCookie('base_device_id'); - - return ( -