From d5308b8531d012a074667286344b8f0bff44173e Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 07:49:06 -0700 Subject: [PATCH 01/10] Remove GA_ID, GTM_ID env vars and references --- packages/manager/.env.example | 6 -- packages/manager/src/IdentifyUser.tsx | 9 --- packages/manager/src/analytics.ts | 82 --------------------------- packages/manager/src/constants.ts | 3 - packages/manager/src/env.d.ts | 2 - packages/manager/src/index.tsx | 9 --- packages/manager/src/utilities/ga.ts | 6 +- 7 files changed, 1 insertion(+), 116 deletions(-) delete mode 100644 packages/manager/src/analytics.ts diff --git a/packages/manager/.env.example b/packages/manager/.env.example index 84539f6edf7..db7042d1212 100644 --- a/packages/manager/.env.example +++ b/packages/manager/.env.example @@ -23,12 +23,6 @@ REACT_APP_LKE_HIGH_AVAILABILITY_PRICE='60' # Adobe Analytics: # REACT_APP_ADOBE_ANALYTICS_URL= -# Google Analytics: -# REACT_APP_GA_ID= - -# Google Tag Manager: -# REACT_APP_GTM_ID= - # Linode Docs search with Algolia: # REACT_APP_ALGOLIA_APPLICATION_ID= # REACT_APP_ALGOLIA_SEARCH_KEY= diff --git a/packages/manager/src/IdentifyUser.tsx b/packages/manager/src/IdentifyUser.tsx index 0bda862edc1..8cf10a92a64 100644 --- a/packages/manager/src/IdentifyUser.tsx +++ b/packages/manager/src/IdentifyUser.tsx @@ -2,7 +2,6 @@ import md5 from 'md5'; import * as React from 'react'; import { LAUNCH_DARKLY_API_KEY } from 'src/constants'; import { useLDClient } from 'src/containers/withFeatureFlagProvider.container'; -import { initGTMUser } from './analytics'; import { configureErrorReportingUser } from './exceptionReporting'; import useFeatureFlagsLoad from './hooks/useFeatureFlagLoad'; import { useAccount } from './queries/account'; @@ -23,7 +22,6 @@ export const IdentifyUser = () => { const { setFeatureFlagsLoaded } = useFeatureFlagsLoad(); - const euuid = account?.euuid; const userID = profile?.uid; const username = profile?.username; @@ -34,13 +32,6 @@ export const IdentifyUser = () => { } }, [userID, username]); - // Configure user for GTM once we have the info we need. - React.useEffect(() => { - if (euuid) { - initGTMUser(euuid); - } - }, [euuid]); - React.useEffect(() => { if (!LAUNCH_DARKLY_API_KEY) { /** diff --git a/packages/manager/src/analytics.ts b/packages/manager/src/analytics.ts deleted file mode 100644 index 16b19574382..00000000000 --- a/packages/manager/src/analytics.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { GTM_ID } from './constants'; - -/* tslint:disable */ -const gaInit = (i: any, s: any, o: any, g: any, r: any, a: any, m: any) => { - const currdate: any = new Date(); - i['GoogleAnalyticsObject'] = r; - (i[r] = - i[r] || - function () { - (i[r].q = i[r].q || []).push(arguments); - }), - (i[r].l = 1 * currdate); - (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); - a.async = 1; - a.src = g; - m.parentNode.insertBefore(a, m); -}; - -const initGTM = (w: any, d: any, s: any, l: any, i: any) => { - w[l] = w[l] || []; - w[l].push({ - 'gtm.start': new Date().getTime(), - event: 'gtm.js', - }); - var f = d.getElementsByTagName(s)[0], - j = d.createElement(s), - dl = l != 'dataLayer' ? '&l=' + l : ''; - j.async = true; - j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; - f.parentNode.insertBefore(j, f); -}; -/* tslint:enable */ - -/** - * Initiates Google Analytics Tracking Script. - * Should be called when the app loads - * - * @param production current environment of the app - * @param gaId Your Google Analytics Tracking ID - */ -export const initAnalytics = (production: boolean, gaID?: string) => { - /** if no GA ID exists */ - if (!gaID) { - return; - } - - const url = production - ? 'https://www.google-analytics.com/analytics.js' - : 'https://www.google-analytics.com/analytics_debug.js'; - - gaInit(window, document, 'script', url, 'ga', {}, {}); - - (window as any).ga('create', gaID, 'auto'); - (window as any).ga('set', 'anonymizeIp', true); - (window as any).ga('send', 'pageview'); -}; - -/** - * Initiates Google Tag Manager Tracking Script. - * Should be called when the app loads - * - * @param gtmId Your Google Tag Manager Tracking ID - */ -export const initTagManager = (gtmId?: string) => { - if (!gtmId) { - return; - } - - initGTM(window, document, 'script', 'dataLayer', gtmId); -}; - -export const initGTMUser = (userId: string) => { - if (!GTM_ID) { - return; - } - (window as any).dataLayer = (window as any).dataLayer || []; - (window as any).dataLayer.push({ - event: 'userInfo', - gtmAccountID: GTM_ID, - gtmIndividualUserId: userId, - }); -}; diff --git a/packages/manager/src/constants.ts b/packages/manager/src/constants.ts index 4c768eb4218..f75ca17098b 100644 --- a/packages/manager/src/constants.ts +++ b/packages/manager/src/constants.ts @@ -67,9 +67,6 @@ export const LONGVIEW_ROOT = 'https://longview.linode.com/fetch'; export const SENTRY_URL = import.meta.env.REACT_APP_SENTRY_URL; export const LOGIN_SESSION_LIFETIME_MS = 45 * 60 * 1000; export const OAUTH_TOKEN_REFRESH_TIMEOUT = LOGIN_SESSION_LIFETIME_MS / 2; -/** Google Analytics and Tag Manager */ -export const GA_ID = import.meta.env.REACT_APP_GA_ID; -export const GTM_ID = import.meta.env.REACT_APP_GTM_ID; /** Adobe Analytics */ export const ADOBE_ANALYTICS_URL = import.meta.env .REACT_APP_ADOBE_ANALYTICS_URL; diff --git a/packages/manager/src/env.d.ts b/packages/manager/src/env.d.ts index 630d461e306..526e878dca3 100644 --- a/packages/manager/src/env.d.ts +++ b/packages/manager/src/env.d.ts @@ -12,8 +12,6 @@ interface ImportMetaEnv { REACT_APP_DISABLE_EVENT_THROTTLE?: boolean; REACT_APP_LOG_PERFORMANCE_METRICS?: string; REACT_APP_ACCESS_TOKEN?: string; - REACT_APP_GTM_ID?: string; - REACT_APP_GA_ID?: string; REACT_APP_ADOBE_ANALYTICS_URL?: string; REACT_APP_SENTRY_URL?: string; REACT_APP_GPAY_ENV?: 'TEST' | 'PRODUCTION'; diff --git a/packages/manager/src/index.tsx b/packages/manager/src/index.tsx index e7b97a925cc..6fe51468ef5 100644 --- a/packages/manager/src/index.tsx +++ b/packages/manager/src/index.tsx @@ -8,12 +8,10 @@ import { RouteComponentProps, Switch, } from 'react-router-dom'; -import { initAnalytics, initTagManager } from 'src/analytics'; import AuthenticationWrapper from 'src/components/AuthenticationWrapper'; import CookieWarning from 'src/components/CookieWarning'; import SnackBar from 'src/components/SnackBar'; import SplashScreen from 'src/components/SplashScreen'; -import { GA_ID, GTM_ID, isProductionBuild } from 'src/constants'; import 'src/exceptionReporting'; import Logout from 'src/layouts/Logout'; import { setupInterceptors } from 'src/request'; @@ -40,13 +38,6 @@ const LoginAsCustomerCallback = React.lazy( ); const OAuthCallbackPage = React.lazy(() => import('src/layouts/OAuth')); -/* - * Initialize Analytic and Google Tag Manager - */ -initAnalytics(isProductionBuild, GA_ID); - -initTagManager(GTM_ID); - const NullAuth = () => null auth route; const Null = () => null route; diff --git a/packages/manager/src/utilities/ga.ts b/packages/manager/src/utilities/ga.ts index ade77bf3f2a..71d8ffa948b 100644 --- a/packages/manager/src/utilities/ga.ts +++ b/packages/manager/src/utilities/ga.ts @@ -1,5 +1,4 @@ -import { event } from 'react-ga'; -import { GA_ID, ADOBE_ANALYTICS_URL } from 'src/constants'; +import { ADOBE_ANALYTICS_URL } from 'src/constants'; interface AnalyticsEvent { category: string; @@ -22,9 +21,6 @@ export const sendEvent = (eventPayload: AnalyticsEvent): void => { value: eventPayload.value, }); } - - /** only send events if we have a GA ID */ - return !!GA_ID ? event(eventPayload) : undefined; }; // LinodeActionMenu.tsx From 99bea09fbdebe75524702dd5bd687c8cee957146 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 08:21:33 -0700 Subject: [PATCH 02/10] Rename ga.ts and ga.test.ts, update imports --- packages/manager/src/components/DocsLink/DocsLink.tsx | 2 +- packages/manager/src/components/FileUploader/FileUploader.tsx | 2 +- .../manager/src/components/LinodeCLIModal/LinodeCLIModal.tsx | 2 +- .../src/components/SelectRegionPanel/SelectRegionPanel.tsx | 2 +- .../features/Databases/DatabaseLanding/DatabaseEmptyState.tsx | 2 +- .../manager/src/features/Domains/CreateDomain/CreateDomain.tsx | 2 +- packages/manager/src/features/Domains/DisableDomainDialog.tsx | 2 +- .../manager/src/features/Domains/DomainsEmptyLandingPage.tsx | 2 +- .../EntityTransfersCreate/EntityTransfersCreate.tsx | 2 +- .../EntityTransfersLanding/ConfirmTransferCancelDialog.tsx | 2 +- .../EntityTransfersLanding/ConfirmTransferDialog.tsx | 2 +- .../EntityTransfersLanding/CreateTransferSuccessDialog.tsx | 2 +- .../Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx | 2 +- .../manager/src/features/Images/ImagesLandingEmptyState.tsx | 2 +- .../KubernetesLanding/KubernetesLandingEmptyState.tsx | 2 +- packages/manager/src/features/Linodes/LinodeEntityDetail.tsx | 2 +- .../features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx | 2 +- .../src/features/Linodes/LinodesCreate/CodeBlock/index.tsx | 2 +- .../manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx | 2 +- .../features/Linodes/LinodesCreate/LinodeCreateContainer.tsx | 2 +- .../Linodes/LinodesCreate/TabbedContent/FromAppsContent.tsx | 2 +- .../LinodesDetail/LinodeAdvanced/LinodeDiskActionMenu.tsx | 2 +- .../Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx | 2 +- .../Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx | 2 +- .../Linodes/LinodesDetail/LinodeBackup/CancelBackupsDialog.tsx | 2 +- .../Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx | 2 +- .../LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx | 2 +- .../src/features/Linodes/LinodesLanding/LinodeActionMenu.tsx | 2 +- .../src/features/Linodes/LinodesLanding/LinodesLanding.tsx | 2 +- .../Linodes/LinodesLanding/LinodesLandingEmptyState.tsx | 2 +- .../src/features/Linodes/MigrateLinode/MigrateLinode.tsx | 2 +- packages/manager/src/features/Linodes/SMTPRestrictionText.tsx | 2 +- .../manager/src/features/NodeBalancers/NodeBalancerCreate.tsx | 2 +- .../ObjectStorage/AccessKeyLanding/AccessKeyLanding.tsx | 2 +- .../src/features/ObjectStorage/BucketDetail/BucketDetail.tsx | 2 +- .../src/features/ObjectStorage/BucketLanding/BucketLanding.tsx | 2 +- .../ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx | 2 +- .../features/ObjectStorage/ObjectUploader/ObjectUploader.tsx | 2 +- .../StackScriptBase/StackScriptsEmptyLandingPage.tsx | 2 +- .../src/features/ToastNotifications/ToastNotifications.tsx | 2 +- .../src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx | 2 +- .../features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx | 2 +- .../manager/src/features/Volumes/VolumesLandingEmptyState.tsx | 2 +- packages/manager/src/store/backupDrawer/index.ts | 2 +- .../manager/src/utilities/{ga.test.ts => analytics.test.ts} | 2 +- packages/manager/src/utilities/{ga.ts => analytics.ts} | 0 packages/manager/src/utilities/emptyStateLandingUtils.ts | 2 +- 47 files changed, 46 insertions(+), 46 deletions(-) rename packages/manager/src/utilities/{ga.test.ts => analytics.test.ts} (96%) rename packages/manager/src/utilities/{ga.ts => analytics.ts} (100%) diff --git a/packages/manager/src/components/DocsLink/DocsLink.tsx b/packages/manager/src/components/DocsLink/DocsLink.tsx index dfd236e9f01..f69ad8b5267 100644 --- a/packages/manager/src/components/DocsLink/DocsLink.tsx +++ b/packages/manager/src/components/DocsLink/DocsLink.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import DocsIcon from 'src/assets/icons/docs.svg'; import { makeStyles } from 'tss-react/mui'; import { Theme } from '@mui/material/styles'; -import { sendHelpButtonClickEvent } from 'src/utilities/ga'; +import { sendHelpButtonClickEvent } from 'src/utilities/analytics'; import { IconTextLink } from '../IconTextLink/IconTextLink'; const useStyles = makeStyles()((theme: Theme) => ({ diff --git a/packages/manager/src/components/FileUploader/FileUploader.tsx b/packages/manager/src/components/FileUploader/FileUploader.tsx index 8c79dc370cc..44b018c2b16 100644 --- a/packages/manager/src/components/FileUploader/FileUploader.tsx +++ b/packages/manager/src/components/FileUploader/FileUploader.tsx @@ -27,7 +27,7 @@ import { useCurrentToken } from 'src/hooks/useAuthentication'; import { queryKey, useUploadImageQuery } from 'src/queries/images'; import { redirectToLogin } from 'src/session'; import { setPendingUpload } from 'src/store/pendingUpload'; -import { sendImageUploadEvent } from 'src/utilities/ga'; +import { sendImageUploadEvent } from 'src/utilities/analytics'; import { readableBytes } from 'src/utilities/unitConversions'; interface FileUploaderProps { diff --git a/packages/manager/src/components/LinodeCLIModal/LinodeCLIModal.tsx b/packages/manager/src/components/LinodeCLIModal/LinodeCLIModal.tsx index 14bc0aa0bf1..4bf40662ade 100644 --- a/packages/manager/src/components/LinodeCLIModal/LinodeCLIModal.tsx +++ b/packages/manager/src/components/LinodeCLIModal/LinodeCLIModal.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip'; import { Dialog } from 'src/components/Dialog/Dialog'; -import { sendCLIClickEvent } from 'src/utilities/ga'; +import { sendCLIClickEvent } from 'src/utilities/analytics'; import { styled } from '@mui/material/styles'; export interface ImageUploadSuccessDialogProps { diff --git a/packages/manager/src/components/SelectRegionPanel/SelectRegionPanel.tsx b/packages/manager/src/components/SelectRegionPanel/SelectRegionPanel.tsx index e85cf353ab9..cf93147343d 100644 --- a/packages/manager/src/components/SelectRegionPanel/SelectRegionPanel.tsx +++ b/packages/manager/src/components/SelectRegionPanel/SelectRegionPanel.tsx @@ -8,7 +8,7 @@ import { Notice } from 'src/components/Notice/Notice'; import { Region } from '@linode/api-v4/lib/regions'; import { RegionHelperText } from 'src/components/SelectRegionPanel/RegionHelperText'; import { RegionSelect } from 'src/components/EnhancedSelect/variants/RegionSelect'; -import { sendLinodeCreateDocsEvent } from 'src/utilities/ga'; +import { sendLinodeCreateDocsEvent } from 'src/utilities/analytics'; import { useLocation } from 'react-router-dom'; import { useTheme } from '@mui/material/styles'; diff --git a/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx b/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx index b9bb17b4fa7..63bb3713796 100644 --- a/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx +++ b/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import DatabaseIcon from 'src/assets/icons/entityIcons/database.svg'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, diff --git a/packages/manager/src/features/Domains/CreateDomain/CreateDomain.tsx b/packages/manager/src/features/Domains/CreateDomain/CreateDomain.tsx index 8adaf28ccf9..218269bb7a6 100644 --- a/packages/manager/src/features/Domains/CreateDomain/CreateDomain.tsx +++ b/packages/manager/src/features/Domains/CreateDomain/CreateDomain.tsx @@ -36,7 +36,7 @@ import { handleFieldErrors, handleGeneralErrors, } from 'src/utilities/formikErrorUtils'; -import { sendCreateDomainEvent } from 'src/utilities/ga'; +import { sendCreateDomainEvent } from 'src/utilities/analytics'; import { ExtendedIP, extendedIPToString, diff --git a/packages/manager/src/features/Domains/DisableDomainDialog.tsx b/packages/manager/src/features/Domains/DisableDomainDialog.tsx index 7252d6db62d..067bfab6d92 100644 --- a/packages/manager/src/features/Domains/DisableDomainDialog.tsx +++ b/packages/manager/src/features/Domains/DisableDomainDialog.tsx @@ -4,7 +4,7 @@ import Button from 'src/components/Button'; import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import { Domain } from '@linode/api-v4/lib/domains'; import { useUpdateDomainMutation } from 'src/queries/domains'; -import { sendDomainStatusChangeEvent } from 'src/utilities/ga'; +import { sendDomainStatusChangeEvent } from 'src/utilities/analytics'; interface Props { domain: Domain | undefined; diff --git a/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx b/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx index 7a380a6f093..96502ca00b6 100644 --- a/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx +++ b/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import DomainIcon from 'src/assets/icons/entityIcons/domain.svg'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { gettingStartedGuides, headers, diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/EntityTransfersCreate.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/EntityTransfersCreate.tsx index 1a952d8fb15..ef5bbab3c88 100644 --- a/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/EntityTransfersCreate.tsx +++ b/packages/manager/src/features/EntityTransfers/EntityTransfersCreate/EntityTransfersCreate.tsx @@ -9,7 +9,7 @@ import Grid from '@mui/material/Unstable_Grid2'; import { Notice } from 'src/components/Notice/Notice'; import { queryKey, useCreateTransfer } from 'src/queries/entityTransfers'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; -import { sendEntityTransferCreateEvent } from 'src/utilities/ga'; +import { sendEntityTransferCreateEvent } from 'src/utilities/analytics'; import { countByEntity } from '../utilities'; import LinodeTransferTable from './LinodeTransferTable'; import TransferCheckoutBar from './TransferCheckoutBar'; diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferCancelDialog.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferCancelDialog.tsx index 5aa72f91271..ca84bc5681f 100644 --- a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferCancelDialog.tsx +++ b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferCancelDialog.tsx @@ -13,7 +13,7 @@ import Typography from 'src/components/core/Typography'; import { Notice } from 'src/components/Notice/Notice'; import { queryKey } from 'src/queries/entityTransfers'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; -import { sendEntityTransferCancelEvent } from 'src/utilities/ga'; +import { sendEntityTransferCancelEvent } from 'src/utilities/analytics'; import { useQueryClient } from 'react-query'; const useStyles = makeStyles(() => ({ diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferDialog.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferDialog.tsx index c3e6852cd05..885e96998c7 100644 --- a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferDialog.tsx +++ b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/ConfirmTransferDialog.tsx @@ -24,7 +24,7 @@ import { capitalize } from 'src/utilities/capitalize'; import { parseAPIDate } from 'src/utilities/date'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import { formatDate } from 'src/utilities/formatDate'; -import { sendEntityTransferReceiveEvent } from 'src/utilities/ga'; +import { sendEntityTransferReceiveEvent } from 'src/utilities/analytics'; import { pluralize } from 'src/utilities/pluralize'; import { countByEntity } from '../utilities'; import { useQueryClient } from 'react-query'; diff --git a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/CreateTransferSuccessDialog.tsx b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/CreateTransferSuccessDialog.tsx index e3b2b0cfc03..a53199b83e4 100644 --- a/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/CreateTransferSuccessDialog.tsx +++ b/packages/manager/src/features/EntityTransfers/EntityTransfersLanding/CreateTransferSuccessDialog.tsx @@ -14,7 +14,7 @@ import { parseAPIDate } from 'src/utilities/date'; import { sendEntityTransferCopyDraftEmailEvent, sendEntityTransferCopyTokenEvent, -} from 'src/utilities/ga'; +} from 'src/utilities/analytics'; import { pluralize } from 'src/utilities/pluralize'; import { debounce } from 'throttle-debounce'; diff --git a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx index 016a7750e62..314fdc1d099 100644 --- a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx +++ b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import FirewallIcon from 'src/assets/icons/entityIcons/firewall.svg'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { gettingStartedGuides, headers, diff --git a/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx b/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx index ce0c44231e0..8a7cba812ca 100644 --- a/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx +++ b/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ImageIcon from 'src/assets/icons/entityIcons/image.svg'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, diff --git a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx index 9d04284b087..85af56b0651 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import KubernetesSvg from 'src/assets/icons/entityIcons/kubernetes.svg'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, diff --git a/packages/manager/src/features/Linodes/LinodeEntityDetail.tsx b/packages/manager/src/features/Linodes/LinodeEntityDetail.tsx index 87e68f084ec..17581d08af2 100644 --- a/packages/manager/src/features/Linodes/LinodeEntityDetail.tsx +++ b/packages/manager/src/features/Linodes/LinodeEntityDetail.tsx @@ -29,7 +29,7 @@ import { useRegionsQuery } from 'src/queries/regions'; import { useTypeQuery } from 'src/queries/types'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import formatDate from 'src/utilities/formatDate'; -import { sendLinodeActionMenuItemEvent } from 'src/utilities/ga'; +import { sendLinodeActionMenuItemEvent } from 'src/utilities/analytics'; import { pluralize } from 'src/utilities/pluralize'; import { ipv4TableID } from './LinodesDetail/LinodeNetworking/LinodeNetworking'; import { lishLink, sshLink } from './LinodesDetail/utilities'; diff --git a/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx b/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx index f1911401d82..39815729487 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx @@ -13,7 +13,7 @@ import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Tabs from 'src/components/core/ReachTabs'; import TabPanels from 'src/components/core/ReachTabPanels'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import generateCurlCommand from 'src/utilities/generate-cURL'; import generateCLICommand from 'src/utilities/generate-cli'; diff --git a/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx b/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx index 784f34bab83..b08cf35d5c4 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { HighlightedMarkdown } from 'src/components/HighlightedMarkdown/HighlightedMarkdown'; import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { useCodeBlockStyles } from './styles'; export interface Props { command: string; diff --git a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx index ab0fe2c5887..3f8562389a2 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx @@ -43,7 +43,7 @@ import { getInitialType } from 'src/store/linodeCreate/linodeCreate.reducer'; import { doesRegionSupportFeature } from 'src/utilities/doesRegionSupportFeature'; import { getErrorMap } from 'src/utilities/errorUtils'; import { filterCurrentTypes } from 'src/utilities/filterCurrentLinodeTypes'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { getQueryParamsFromQueryString } from 'src/utilities/queryParams'; import { v4 } from 'uuid'; import { AddonsPanel } from './AddonsPanel'; diff --git a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx index 2f4cb775a78..9a401d93804 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx @@ -56,7 +56,7 @@ import { upsertLinode } from 'src/store/linodes/linodes.actions'; import { MapState } from 'src/store/types'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import { isEURegion } from 'src/utilities/formatRegion'; -import { sendCreateLinodeEvent, sendEvent } from 'src/utilities/ga'; +import { sendCreateLinodeEvent, sendEvent } from 'src/utilities/analytics'; import { getQueryParamsFromQueryString } from 'src/utilities/queryParams'; import scrollErrorIntoView from 'src/utilities/scrollErrorIntoView'; import { validatePassword } from 'src/utilities/validatePassword'; diff --git a/packages/manager/src/features/Linodes/LinodesCreate/TabbedContent/FromAppsContent.tsx b/packages/manager/src/features/Linodes/LinodesCreate/TabbedContent/FromAppsContent.tsx index e622e7a6ce8..306001b2372 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/TabbedContent/FromAppsContent.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/TabbedContent/FromAppsContent.tsx @@ -27,7 +27,7 @@ import Box from 'src/components/core/Box'; import Paper from 'src/components/core/Paper'; import Typography from 'src/components/core/Typography'; import { oneClickApps, AppCategory } from 'src/features/OneClickApps/FakeSpec'; -import { sendMarketplaceSearchEvent } from 'src/utilities/ga'; +import { sendMarketplaceSearchEvent } from 'src/utilities/analytics'; type ClassNames = 'main' | 'sidebar' | 'searchAndFilter' | 'search' | 'filter'; diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskActionMenu.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskActionMenu.tsx index a9d194fb971..3cd9fbc80ba 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskActionMenu.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskActionMenu.tsx @@ -6,7 +6,7 @@ import { makeStyles, useTheme } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import useMediaQuery from '@mui/material/useMediaQuery'; import InlineMenuAction from 'src/components/InlineMenuAction'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; const useStyles = makeStyles(() => ({ root: { diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx index 8546e6e512a..25246bdd9b8 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx @@ -26,7 +26,7 @@ import { handleFieldErrors, handleGeneralErrors, } from 'src/utilities/formikErrorUtils'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { extendValidationSchema } from 'src/utilities/validatePassword'; import { object, string } from 'yup'; diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx index 561ec300c14..546f403c205 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx @@ -35,7 +35,7 @@ import { withLinodeDetailContext, } from 'src/features/Linodes/LinodesDetail/linodeDetailContext'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import LinodeDiskDrawer from './LinodeDiskDrawer'; import LinodeDiskRow from './LinodeDiskRow'; diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeBackup/CancelBackupsDialog.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeBackup/CancelBackupsDialog.tsx index d5872d7f3bd..040ab42ef80 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeBackup/CancelBackupsDialog.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeBackup/CancelBackupsDialog.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { useSnackbar } from 'notistack'; import { resetEventsPolling } from 'src/eventsPolling'; import { useLinodeBackupsCancelMutation } from 'src/queries/linodes/backups'; -import { sendBackupsDisabledEvent } from 'src/utilities/ga'; +import { sendBackupsDisabledEvent } from 'src/utilities/analytics'; import Typography from 'src/components/core/Typography'; import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog'; import ActionsPanel from 'src/components/ActionsPanel/ActionsPanel'; diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx index b6966d1b525..f1da5641e6f 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx @@ -10,7 +10,7 @@ import Select, { Item } from 'src/components/EnhancedSelect/Select'; import Grid from '@mui/material/Unstable_Grid2'; import TextField from 'src/components/TextField'; import { useVlansQuery } from 'src/queries/vlans'; -import { sendLinodeCreateDocsEvent } from 'src/utilities/ga'; +import { sendLinodeCreateDocsEvent } from 'src/utilities/analytics'; import useMediaQuery from '@mui/material/useMediaQuery'; const useStyles = makeStyles((theme: Theme) => ({ diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx index 424ea7a2f03..860242b94b7 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx @@ -17,7 +17,7 @@ import { useLinodeUpdateMutation, } from 'src/queries/linodes/linodes'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { getQueryParamsFromQueryString } from 'src/utilities/queryParams'; import scrollErrorIntoView from 'src/utilities/scrollErrorIntoView'; import { DeleteLinodeDialog } from '../../LinodesLanding/DeleteLinodeDialog'; diff --git a/packages/manager/src/features/Linodes/LinodesLanding/LinodeActionMenu.tsx b/packages/manager/src/features/Linodes/LinodesLanding/LinodeActionMenu.tsx index 50b1aef4007..f1e167b5fd4 100644 --- a/packages/manager/src/features/Linodes/LinodesLanding/LinodeActionMenu.tsx +++ b/packages/manager/src/features/Linodes/LinodesLanding/LinodeActionMenu.tsx @@ -15,7 +15,7 @@ import { sendLinodeActionEvent, sendLinodeActionMenuItemEvent, sendMigrationNavigationEvent, -} from 'src/utilities/ga'; +} from 'src/utilities/analytics'; import { ExtendedType, extendType } from 'src/utilities/extendType'; import { LinodeHandlers } from './LinodesLanding'; diff --git a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx index 4cec97e3b2f..fc531bd60f6 100644 --- a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx +++ b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx @@ -29,7 +29,7 @@ import { MapState } from 'src/store/types'; import { sendGroupByTagEnabledEvent, sendLinodesViewEvent, -} from 'src/utilities/ga'; +} from 'src/utilities/analytics'; import { EnableBackupsDialog } from '../LinodesDetail/LinodeBackup/EnableBackupsDialog'; import { LinodeRebuildDialog } from '../LinodesDetail/LinodeRebuild/LinodeRebuildDialog'; import { MigrateLinode } from 'src/features/Linodes/MigrateLinode'; diff --git a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyState.tsx b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyState.tsx index 88b1a4c017f..9ad688416ef 100644 --- a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyState.tsx +++ b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyState.tsx @@ -8,7 +8,7 @@ import { ResourcesLinkIcon } from 'src/components/EmptyLandingPageResources/Reso import { ResourcesLinksSubSection } from 'src/components/EmptyLandingPageResources/ResourcesLinksSubSection'; import { ResourcesMoreLink } from 'src/components/EmptyLandingPageResources/ResourcesMoreLink'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, diff --git a/packages/manager/src/features/Linodes/MigrateLinode/MigrateLinode.tsx b/packages/manager/src/features/Linodes/MigrateLinode/MigrateLinode.tsx index dbecd6f44c0..2d5038de296 100644 --- a/packages/manager/src/features/Linodes/MigrateLinode/MigrateLinode.tsx +++ b/packages/manager/src/features/Linodes/MigrateLinode/MigrateLinode.tsx @@ -24,7 +24,7 @@ import { useRegionsQuery } from 'src/queries/regions'; import { useTypeQuery } from 'src/queries/types'; import { formatDate } from 'src/utilities/formatDate'; import { isEURegion } from 'src/utilities/formatRegion'; -import { sendMigrationInitiatedEvent } from 'src/utilities/ga'; +import { sendMigrationInitiatedEvent } from 'src/utilities/analytics'; import { getLinodeDescription } from 'src/utilities/getLinodeDescription'; import scrollErrorIntoView from 'src/utilities/scrollErrorIntoView'; import CautionNotice from './CautionNotice'; diff --git a/packages/manager/src/features/Linodes/SMTPRestrictionText.tsx b/packages/manager/src/features/Linodes/SMTPRestrictionText.tsx index baed8e1ff71..54ba17dbe8d 100644 --- a/packages/manager/src/features/Linodes/SMTPRestrictionText.tsx +++ b/packages/manager/src/features/Linodes/SMTPRestrictionText.tsx @@ -4,7 +4,7 @@ import ExternalLink from 'src/components/ExternalLink'; import { SupportLink } from 'src/components/SupportLink'; import { MAGIC_DATE_THAT_EMAIL_RESTRICTIONS_WERE_IMPLEMENTED } from 'src/constants'; import { useAccount } from 'src/queries/account'; -import { sendLinodeCreateDocsEvent } from 'src/utilities/ga'; +import { sendLinodeCreateDocsEvent } from 'src/utilities/analytics'; export interface Props { children: (props: { text: React.ReactNode }) => React.ReactNode; supportLink?: { diff --git a/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx b/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx index ea7e675f39c..785531b9cb4 100644 --- a/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx +++ b/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx @@ -18,7 +18,7 @@ import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import { isEURegion } from 'src/utilities/formatRegion'; import { NodeBalancerConfigPanel } from './NodeBalancerConfigPanel'; import { Notice } from 'src/components/Notice/Notice'; -import { sendCreateNodeBalancerEvent } from 'src/utilities/ga'; +import { sendCreateNodeBalancerEvent } from 'src/utilities/analytics'; import { TagsInput, Tag } from 'src/components/TagsInput/TagsInput'; import { useGrants, useProfile } from 'src/queries/profile'; import { useHistory } from 'react-router-dom'; diff --git a/packages/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyLanding.tsx b/packages/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyLanding.tsx index 60c17298199..16e2fd2338d 100644 --- a/packages/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyLanding.tsx +++ b/packages/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyLanding.tsx @@ -25,7 +25,7 @@ import { sendCreateAccessKeyEvent, sendEditAccessKeyEvent, sendRevokeAccessKeyEvent, -} from 'src/utilities/ga'; +} from 'src/utilities/analytics'; interface Props { accessDrawerOpen: boolean; diff --git a/packages/manager/src/features/ObjectStorage/BucketDetail/BucketDetail.tsx b/packages/manager/src/features/ObjectStorage/BucketDetail/BucketDetail.tsx index f31c0ee2050..c219be9f9aa 100644 --- a/packages/manager/src/features/ObjectStorage/BucketDetail/BucketDetail.tsx +++ b/packages/manager/src/features/ObjectStorage/BucketDetail/BucketDetail.tsx @@ -14,7 +14,7 @@ import { getQueryParamFromQueryString } from 'src/utilities/queryParams'; import { OBJECT_STORAGE_DELIMITER } from 'src/constants'; import { ObjectDetailsDrawer } from './ObjectDetailsDrawer'; import { ObjectUploader } from '../ObjectUploader/ObjectUploader'; -import { sendDownloadObjectEvent } from 'src/utilities/ga'; +import { sendDownloadObjectEvent } from 'src/utilities/analytics'; import { Table } from 'src/components/Table'; import { TableBody } from 'src/components/TableBody'; import { TableCell } from 'src/components/TableCell'; diff --git a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLanding.tsx b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLanding.tsx index cd78bc773eb..3c98017de65 100644 --- a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLanding.tsx +++ b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLanding.tsx @@ -32,7 +32,7 @@ import { import { sendDeleteBucketEvent, sendDeleteBucketFailedEvent, -} from 'src/utilities/ga'; +} from 'src/utilities/analytics'; const useStyles = makeStyles()((theme: Theme) => ({ copy: { diff --git a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx index fba8a8e6469..cab79707236 100644 --- a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx +++ b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { StyledBucketIcon } from './StylesBucketIcon'; import { useHistory } from 'react-router-dom'; import { diff --git a/packages/manager/src/features/ObjectStorage/ObjectUploader/ObjectUploader.tsx b/packages/manager/src/features/ObjectStorage/ObjectUploader/ObjectUploader.tsx index f33512e0a9b..4023e04a3dd 100644 --- a/packages/manager/src/features/ObjectStorage/ObjectUploader/ObjectUploader.tsx +++ b/packages/manager/src/features/ObjectStorage/ObjectUploader/ObjectUploader.tsx @@ -4,7 +4,7 @@ import { debounce } from 'throttle-debounce'; import { FileUpload } from './FileUpload'; import { getObjectURL } from '@linode/api-v4/lib/object-storage'; import { readableBytes } from 'src/utilities/unitConversions'; -import { sendObjectsQueuedForUploadEvent } from 'src/utilities/ga'; +import { sendObjectsQueuedForUploadEvent } from 'src/utilities/analytics'; import { updateBucket } from 'src/queries/objectStorage'; import { uploadObject } from '../requests'; import { useDropzone, FileRejection } from 'react-dropzone'; diff --git a/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx b/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx index 51da185b8a5..4387636c932 100644 --- a/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx +++ b/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import StackScriptsIcon from 'src/assets/icons/entityIcons/stackscript.svg'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { gettingStartedGuides, headers, diff --git a/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx b/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx index 7c8e1a0d8f2..8a36fba4ea0 100644 --- a/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx +++ b/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx @@ -9,7 +9,7 @@ import { Subscription } from 'rxjs/Subscription'; import Link from 'src/components/Link'; import { SupportLink } from 'src/components/SupportLink'; import { events$ } from 'src/events'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; interface ToastOptions { enqueueSnackbar: WithSnackbarProps['enqueueSnackbar']; diff --git a/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx b/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx index bfeecb60f0a..8be6236e637 100644 --- a/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx +++ b/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx @@ -35,7 +35,7 @@ import { handleFieldErrors, handleGeneralErrors, } from 'src/utilities/formikErrorUtils'; -import { sendCreateVolumeEvent } from 'src/utilities/ga'; +import { sendCreateVolumeEvent } from 'src/utilities/analytics'; import { isNilOrEmpty } from 'src/utilities/isNilOrEmpty'; import { maybeCastToNumber } from 'src/utilities/maybeCastToNumber'; import ConfigSelect, { diff --git a/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx b/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx index db59eb60ed9..eeef04fd25c 100644 --- a/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx +++ b/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx @@ -26,7 +26,7 @@ import { handleFieldErrors, handleGeneralErrors, } from 'src/utilities/formikErrorUtils'; -import { sendCreateVolumeEvent } from 'src/utilities/ga'; +import { sendCreateVolumeEvent } from 'src/utilities/analytics'; import { maybeCastToNumber } from 'src/utilities/maybeCastToNumber'; import { array, object, string } from 'yup'; import ConfigSelect from './ConfigSelect'; diff --git a/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx b/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx index b53a4751a2b..f34cc0cd27c 100644 --- a/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx +++ b/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { ResourcesSection } from 'src/components/EmptyLandingPageResources/ResourcesSection'; -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; import { StyledVolumeIcon } from './VolumesLandingEmptyState.styles'; import { useHistory } from 'react-router-dom'; import { diff --git a/packages/manager/src/store/backupDrawer/index.ts b/packages/manager/src/store/backupDrawer/index.ts index 8b4a2aecf6c..79d81b0345e 100644 --- a/packages/manager/src/store/backupDrawer/index.ts +++ b/packages/manager/src/store/backupDrawer/index.ts @@ -6,7 +6,7 @@ import { Reducer } from 'redux'; import { updateMultipleLinodes } from 'src/store/linodes/linodes.actions'; import { getLinodesWithoutBackups } from 'src/store/selectors/getLinodesWithBackups'; import { getErrorStringOrDefault } from 'src/utilities/errorUtils'; -import { sendBackupsEnabledEvent } from 'src/utilities/ga'; +import { sendBackupsEnabledEvent } from 'src/utilities/analytics'; import { ThunkActionCreator } from '../types'; import { queryKey, diff --git a/packages/manager/src/utilities/ga.test.ts b/packages/manager/src/utilities/analytics.test.ts similarity index 96% rename from packages/manager/src/utilities/ga.test.ts rename to packages/manager/src/utilities/analytics.test.ts index 149c44b5cd0..b2bf5fb05d5 100644 --- a/packages/manager/src/utilities/ga.test.ts +++ b/packages/manager/src/utilities/analytics.test.ts @@ -1,4 +1,4 @@ -import { generateTimeOfDay } from './ga'; +import { generateTimeOfDay } from './analytics'; describe('Utility Functions', () => { it('should generate human-readable time of day', () => { diff --git a/packages/manager/src/utilities/ga.ts b/packages/manager/src/utilities/analytics.ts similarity index 100% rename from packages/manager/src/utilities/ga.ts rename to packages/manager/src/utilities/analytics.ts diff --git a/packages/manager/src/utilities/emptyStateLandingUtils.ts b/packages/manager/src/utilities/emptyStateLandingUtils.ts index 9a4cd79d49e..10d0c24f351 100644 --- a/packages/manager/src/utilities/emptyStateLandingUtils.ts +++ b/packages/manager/src/utilities/emptyStateLandingUtils.ts @@ -1,4 +1,4 @@ -import { sendEvent } from 'src/utilities/ga'; +import { sendEvent } from 'src/utilities/analytics'; export const guidesMoreLinkText = 'Check out all our Docs'; export const docsLink = 'https://www.linode.com/docs/'; From 8d55b6122836924c2ec8a95c387f0abe80bed17f Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 08:25:49 -0700 Subject: [PATCH 03/10] Remove react-ga --- packages/manager/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/manager/package.json b/packages/manager/package.json index 9a502e9d2f8..0efa742d65a 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -63,7 +63,6 @@ "react-csv": "^2.0.3", "react-dom": "^17.0.2", "react-dropzone": "~11.2.0", - "react-ga": "^2.5.3", "react-number-format": "^3.5.0", "react-page-visibility": "^6.2.0", "react-query": "^3.3.2", From 9f3bc6d13f6a36279c22af9f9613767dd0012c03 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 08:49:43 -0700 Subject: [PATCH 04/10] Clean up analytics events file --- packages/manager/src/utilities/analytics.ts | 142 +++++++++++--------- 1 file changed, 82 insertions(+), 60 deletions(-) diff --git a/packages/manager/src/utilities/analytics.ts b/packages/manager/src/utilities/analytics.ts index 71d8ffa948b..517494420cf 100644 --- a/packages/manager/src/utilities/analytics.ts +++ b/packages/manager/src/utilities/analytics.ts @@ -25,15 +25,14 @@ export const sendEvent = (eventPayload: AnalyticsEvent): void => { // LinodeActionMenu.tsx export const sendLinodeActionEvent = (): void => { - // AC 8/26/2020: disabling this event to reduce hits on GA as this seems to not be used - // sendEvent({ - // category: 'Linode Action Menu', - // action: 'Open Action Menu' - // }); + sendEvent({ + category: 'Linode Action Menu', + action: 'Open Action Menu', + }); }; // LinodeActionMenu.tsx -// LinodeCard.tsx +// LinodeEntityDetail.tsx export const sendLinodeActionMenuItemEvent = (eventAction: string): void => { sendEvent({ category: 'Linode Action Menu Item', @@ -66,7 +65,7 @@ export const sendCreateVolumeEvent = ( }); }; -// For DOMAINS +// CreateDomain.tsx export const sendCreateDomainEvent = ( eventLabel: string, eventAction?: string @@ -78,54 +77,7 @@ export const sendCreateDomainEvent = ( }); }; -// getAll.ts -export const sendFetchAllEvent = ( - eventLabel: string, - eventValue: number -): void => { - sendEvent({ - category: 'Search', - action: 'Data fetch all entities', - label: eventLabel, - value: eventValue, - }); -}; - -// TagImportDrawer.tsx -export const sendImportDisplayGroupSubmitEvent = ( - eventLabel: string, - eventValue: number -): void => { - sendEvent({ - category: 'dashboard', - action: 'import display groups', - label: eventLabel, - value: eventValue, - }); -}; - -// LinodeThemeWrapper.tsx -export const sendSpacingToggleEvent = (eventLabel: string): void => { - // AC 8/24/2020: disabling this event to reduce hits on GA as this seems to not be used - // sendEvent({ - // category: 'Theme Choice', - // action: 'Spacing Toggle', - // label: eventLabel - // }); -}; - -// LinodeThemeWrapper.tsx -export const sendThemeToggleEvent = (): void => { - // AC 9/24/2020: disabling this event to reduce hits on GA as this seems to not be used - // sendEvent({ - // category: 'Theme Choice', - // action: 'Theme Toggle', - // label: eventLabel - // }); -}; - // backupDrawer/index.ts -// LinodeBackup.tsx export const sendBackupsEnabledEvent = (eventLabel: string): void => { sendEvent({ category: 'Backups', @@ -143,10 +95,7 @@ export const sendBackupsDisabledEvent = (): void => { }); }; -// NodeBalancersLanding.tsx -// DomainsLanding.tsx // LinodesLanding.tsx -// VolumesLanding.tsx export const sendGroupByTagEnabledEvent = ( eventCategory: string, eventLabel: boolean @@ -191,7 +140,7 @@ export const sendCreateLinodeEvent = ( }); }; -// CreateBucketForm.tsx +// CreateBucketDrawer.tsx export const sendCreateBucketEvent = (eventLabel: string): void => { sendEvent({ category: 'Object Storage', @@ -209,6 +158,7 @@ export const sendDeleteBucketEvent = (eventLabel: string): void => { }); }; +// BucketsLanding.tsx export const sendDeleteBucketFailedEvent = (eventLabel: string): void => { sendEvent({ category: 'Object Storage', @@ -242,8 +192,9 @@ export const sendRevokeAccessKeyEvent = (): void => { }; /** - * meant to be sent to GA upon navigating to `/linodes/${linodeID}/migrate` + * meant to be sent to AA upon navigating to `/linodes/${linodeID}/migrate` */ +// LinodeActionMenu.tsx export const sendMigrationNavigationEvent = ( pathNavigatedFrom: string ): void => { @@ -252,7 +203,7 @@ export const sendMigrationNavigationEvent = ( action: `From ${pathNavigatedFrom}`, }); }; - +// MigrateLinode.tsx export const sendMigrationInitiatedEvent = ( sourceRegionLabel: string, destRegionLabel: string, @@ -283,6 +234,7 @@ export const generateTimeOfDay = (currentHour: number): string => { return currentTimeOfDay; }; +// DisableDomainDialog.tsx export const sendDomainStatusChangeEvent = ( action: 'Enable' | 'Disable' ): void => { @@ -292,6 +244,7 @@ export const sendDomainStatusChangeEvent = ( }); }; +// BucketDetail.tsx export const sendDownloadObjectEvent = (): void => { sendEvent({ category: 'Object Storage', @@ -299,6 +252,7 @@ export const sendDownloadObjectEvent = (): void => { }); }; +// ObjectUploader.tsx export const sendObjectsQueuedForUploadEvent = (numObjects: number): void => { sendEvent({ category: 'Object Storage', @@ -307,6 +261,7 @@ export const sendObjectsQueuedForUploadEvent = (numObjects: number): void => { }); }; +// EntityTransferCreate.tsx export const sendEntityTransferCreateEvent = (label: string): void => { sendEvent({ // eslint-disable-next-line @@ -316,6 +271,7 @@ export const sendEntityTransferCreateEvent = (label: string): void => { }); }; +// ConfirmTransferDialog.tsx export const sendEntityTransferReceiveEvent = (label: string): void => { sendEvent({ category: 'Service Transfer', @@ -324,6 +280,7 @@ export const sendEntityTransferReceiveEvent = (label: string): void => { }); }; +// ConfirmTransferCancelDialog.tsx export const sendEntityTransferCancelEvent = (): void => { sendEvent({ category: 'Service Transfer', @@ -331,6 +288,7 @@ export const sendEntityTransferCancelEvent = (): void => { }); }; +// ConfirmTransferSuccessDialog.tsx export const sendEntityTransferCopyTokenEvent = (): void => { sendEvent({ category: 'Entity Transfer', @@ -338,6 +296,7 @@ export const sendEntityTransferCopyTokenEvent = (): void => { }); }; +// CreateTransferSuccessDialog.tsx export const sendEntityTransferCopyDraftEmailEvent = (): void => { sendEvent({ category: 'Entity Transfer', @@ -345,6 +304,7 @@ export const sendEntityTransferCopyDraftEmailEvent = (): void => { }); }; +// DocsLink.tsx export const sendHelpButtonClickEvent = (url: string, from?: string) => { if (from === 'Object Storage Landing') { sendObjectStorageDocsEvent('Docs'); @@ -357,6 +317,7 @@ export const sendHelpButtonClickEvent = (url: string, from?: string) => { }); }; +// LinodeCLIModal.tsx export const sendCLIClickEvent = (action: string) => { sendEvent({ category: 'Linode CLI Prompt', @@ -364,6 +325,7 @@ export const sendCLIClickEvent = (action: string) => { }); }; +// FileUploader.tsx export const sendImageUploadEvent = (action: string, imageSize: string) => { sendEvent({ category: 'Image Upload', @@ -372,6 +334,9 @@ export const sendImageUploadEvent = (action: string, imageSize: string) => { }); }; +// SelectRegionPanel.tsx +// SMTPRestrictionHelperText.tsx +// InterfaceSelect.tsx export const sendLinodeCreateDocsEvent = (action: string) => { sendEvent({ category: 'Linode Create Contextual Help', @@ -379,6 +344,34 @@ export const sendLinodeCreateDocsEvent = (action: string) => { }); }; +// LinodeCreate.tsx +// LinodeCreateContainer.tsx +// LinodeDetailHeader.tsx +export const sendLinodeCreateFlowDocsClickEvent = (label: string) => { + sendEvent({ + category: 'Linode Create Flow', + action: 'Click:link', + label, + }); +}; + +// LinodeDiskActionMenu.tsx +// LinodeDiskDrawer.tsx +// LinodeDisks.tsx +// ToastNotifications.tsx +export const sendLinodeDiskEvent = ( + diskActionTitle: string, + action: string, + label: string +) => { + sendEvent({ + category: `Disk ${diskActionTitle} Flow`, + action, + label, + }); +}; + +// BucketLanding.tsx export const sendObjectStorageDocsEvent = (action: string) => { sendEvent({ category: 'Object Storage Landing Contextual Help', @@ -388,6 +381,7 @@ export const sendObjectStorageDocsEvent = (action: string) => { type TypeOfSearch = 'Search Field' | 'Category Dropdown'; +// FromAppsContent.tsx export const sendMarketplaceSearchEvent = ( typeOfSearch: TypeOfSearch, appCategory?: string @@ -398,3 +392,31 @@ export const sendMarketplaceSearchEvent = ( label: appCategory ?? 'Apps Search', }); }; + +// DatabaseEmptyState.tsx +// KubernetesLandingEmptyState.tsx +// ListLinodesEmptyState.tsx +export const sendEmptyStateLandingCreateEvent = ( + productName: string, + eventLabel?: string +) => { + sendEvent({ + category: `${productName} landing page empty`, + action: 'Click:button', + label: `Create ${eventLabel ?? productName}`, + }); +}; + +// LinodeCreate.tsx +// LinodesCreate/CodeBlock/index.tsx +// LinodesCreate/ApiAwareness/index.tsx +export const sendApiAwarenessClickEvent = ( + clickType: string, + label: string +) => { + sendEvent({ + category: 'Linode Create API CLI Awareness Modal', + action: `Click:${clickType}`, + label, + }); +}; From bd8851e03b9835368814ad622f6ba2ccd347199f Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 09:09:01 -0700 Subject: [PATCH 05/10] More clean up to remove references to GA --- packages/api-v4/src/request.ts | 40 ------------------- packages/manager/src/App.tsx | 5 --- .../src/components/Button/Button.stories.tsx | 2 +- .../src/features/EntityTransfers/utilities.ts | 2 +- .../LinodesCreate/LinodeCreateContainer.tsx | 2 +- .../Linodes/LinodesLanding/LinodesLanding.tsx | 2 +- .../NodeBalancers/NodeBalancerCreate.tsx | 2 +- .../Volumes/VolumeCreate/CreateVolumeForm.tsx | 2 +- .../CreateVolumeForLinodeForm.tsx | 2 +- .../manager/src/store/backupDrawer/index.ts | 2 +- yarn.lock | 5 --- 11 files changed, 8 insertions(+), 58 deletions(-) diff --git a/packages/api-v4/src/request.ts b/packages/api-v4/src/request.ts index 03cb9725b33..0413913a3f2 100644 --- a/packages/api-v4/src/request.ts +++ b/packages/api-v4/src/request.ts @@ -179,46 +179,6 @@ export const requestGenerator = (...fns: Function[]): Promise => { ); } return baseRequest(config).then((response) => response.data); - - /* - * If in the future, we want to hook into every single - * async action for the purpose of sending the request data - * to Google Tag Manager, we can uncomment out the following - * .then() and .catch() on return Axios(config) - */ - - // .then(response => { - // /* - // * This is sending an event to the Google Tag Manager - // * data layer. This is important because it lets us track - // * async actions as custom events - // */ - // if ((window as any).dataLayer) { - // (window as any).dataLayer = (window as any).dataLayer || []; - // (window as any).dataLayer.push({ - // 'event': 'asyncActionSuccess', - // 'url': response.config.url, - // 'method': response.config.method, - // }); - // }; - // return response; - // }) - // .catch(e => { - // /* - // * This is sending an event to the Google Tag Manager - // * data layer. This is important because it lets us track - // * async actions as custom events - // */ - // if ((window as any).dataLayer) { - // (window as any).dataLayer = (window as any).dataLayer || []; - // (window as any).dataLayer.push({ - // 'event': 'asyncActionFailure', - // 'url': e.response.config.url, - // 'method': e.response.config.method, - // }); - // }; - // return Promise.reject(e); - // }); }; /** diff --git a/packages/manager/src/App.tsx b/packages/manager/src/App.tsx index f85346ca5f7..0f7857c8ff7 100644 --- a/packages/manager/src/App.tsx +++ b/packages/manager/src/App.tsx @@ -114,11 +114,6 @@ export class App extends React.Component { * Send pageviews */ this.props.history.listen(({ pathname }) => { - // Send Google Analytics page view events - if ((window as any).ga) { - (window as any).ga('send', 'pageview', pathname); - } - // Send Adobe Analytics page view events if ((window as any)._satellite) { (window as any)._satellite.track('page view', { diff --git a/packages/manager/src/components/Button/Button.stories.tsx b/packages/manager/src/components/Button/Button.stories.tsx index b8726753097..e9bd00c16dc 100644 --- a/packages/manager/src/components/Button/Button.stories.tsx +++ b/packages/manager/src/components/Button/Button.stories.tsx @@ -18,7 +18,7 @@ const meta: Meta = { component: Button, argTypes: { tooltipAnalyticsEvent: { - action: 'GA Event Action', + action: 'Analytics Event Action', }, }, args: { diff --git a/packages/manager/src/features/EntityTransfers/utilities.ts b/packages/manager/src/features/EntityTransfers/utilities.ts index 5d52fa603ee..2ec5e431273 100644 --- a/packages/manager/src/features/EntityTransfers/utilities.ts +++ b/packages/manager/src/features/EntityTransfers/utilities.ts @@ -1,7 +1,7 @@ import { TransferEntities } from '@linode/api-v4/lib/entity-transfers'; import { capitalize } from 'src/utilities/capitalize'; -// Return the count of each transferred entity by type, for reporting to GA. +// Return the count of each transferred entity by type, for reporting analytics. // E.g. { linodes: [ 1234 ], domains: [ 2345, 3456 ]} -> "Linodes: 1, Domains: 2" export const countByEntity = (transferEntities: TransferEntities) => { return Object.entries(transferEntities) diff --git a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx index 9a401d93804..55f0e2182b0 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx @@ -626,7 +626,7 @@ class LinodeCreateContainer extends React.PureComponent { this.props.upsertLinode(response); } - /** GA creation event */ + /** Analytics creation event */ handleAnalytics( createType, payload, diff --git a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx index fc531bd60f6..3e3d96eb120 100644 --- a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx +++ b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLanding.tsx @@ -127,7 +127,7 @@ export class ListLinodes extends React.Component { }; /** - * when you change the linode view, send an event to google analytics, debounced. + * when you change the linode view, send analytics event, debounced. */ changeViewDelayed = (style: 'grid' | 'list') => { sendLinodesViewEvent(eventCategory, style); diff --git a/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx b/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx index 785531b9cb4..5ea1fd6f8a2 100644 --- a/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx +++ b/packages/manager/src/features/NodeBalancers/NodeBalancerCreate.tsx @@ -257,7 +257,7 @@ const NodeBalancerCreate = () => { createNodeBalancer(nodeBalancerRequestData) .then((nodeBalancer) => { history.push(`/nodebalancers/${nodeBalancer.id}/summary`); - // GA Event + // Analytics Event sendCreateNodeBalancerEvent(`Region: ${nodeBalancer.region}`); }) .catch((errorResponse) => { diff --git a/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx b/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx index 8be6236e637..41f1fbfe77d 100644 --- a/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx +++ b/packages/manager/src/features/Volumes/VolumeCreate/CreateVolumeForm.tsx @@ -212,7 +212,7 @@ const CreateVolumeForm: React.FC = (props) => { `Volume scheduled for creation.` ); history.push('/volumes'); - // GA Event + // Analytics Event sendCreateVolumeEvent(`Size: ${size}GB`, origin); }) .catch((errorResponse) => { diff --git a/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx b/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx index eeef04fd25c..2845fe14556 100644 --- a/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx +++ b/packages/manager/src/features/Volumes/VolumeDrawer/CreateVolumeForLinodeForm.tsx @@ -116,7 +116,7 @@ const CreateVolumeForm: React.FC = (props) => { filesystem_path, `Volume scheduled for creation.` ); - // GA Event + // Analytics Event sendCreateVolumeEvent(`Size: ${size}GB`, origin); }) .catch((errorResponse) => { diff --git a/packages/manager/src/store/backupDrawer/index.ts b/packages/manager/src/store/backupDrawer/index.ts index 79d81b0345e..74ad79e08a1 100644 --- a/packages/manager/src/store/backupDrawer/index.ts +++ b/packages/manager/src/store/backupDrawer/index.ts @@ -273,7 +273,7 @@ export const enableAllBackups: EnableAllBackupsThunk = () => ( dispatch(handleEnableSuccess(response.success)); } dispatch(updateMultipleLinodes(response.success)); - // GA Event + // Analytics Event sendBackupsEnabledEvent( `Enabled backups for ${response.success.length} Linodes` ); diff --git a/yarn.lock b/yarn.lock index e6a43ffe299..5e87b0944f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12149,11 +12149,6 @@ react-fast-compare@^2.0.1: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== -react-ga@^2.5.3: - version "2.7.0" - resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.7.0.tgz#24328f157f31e8cffbf4de74a3396536679d8d7c" - integrity sha512-AjC7UOZMvygrWTc2hKxTDvlMXEtbmA0IgJjmkhgmQQ3RkXrWR11xEagLGFGaNyaPnmg24oaIiaNPnEoftUhfXA== - react-input-autosize@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-2.2.2.tgz#fcaa7020568ec206bc04be36f4eb68e647c4d8c2" From 73a7da02e17c1f5a1e390f1d88a0233e98ed70f8 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 09:44:07 -0700 Subject: [PATCH 06/10] More clean up --- .../ResourcesLinks.tsx | 4 +- .../ResourcesLinksTypes.ts | 4 +- .../ResourcesSection.tsx | 33 ++++++++----- .../DatabaseLanding/DatabaseEmptyState.tsx | 6 +-- .../DatabaseLandingEmptyStateData.ts | 2 +- .../Domains/DomainsEmptyLandingPage.tsx | 8 +-- .../Domains/DomainsEmptyResourcesData.ts | 2 +- .../FirewallLandingEmptyResourcesData.ts | 2 +- .../FirewallLandingEmptyState.tsx | 6 +-- .../Images/ImagesLandingEmptyState.tsx | 6 +-- .../Images/ImagesLandingEmptyStateData.ts | 2 +- .../KubernetesLandingEmptyState.tsx | 6 +-- .../KubernetesLandingEmptyStateData.ts | 2 +- .../LinodesCreate/ApiAwarenessModal/index.tsx | 49 +++++++++++-------- .../Linodes/LinodesCreate/CodeBlock/index.tsx | 8 +-- .../Linodes/LinodesCreate/LinodeCreate.tsx | 17 +++---- .../LinodesCreate/LinodeCreateContainer.tsx | 15 +++--- .../LinodeDetailHeader.tsx | 8 +-- .../LinodesLandingEmptyState.tsx | 8 +-- .../LinodesLandingEmptyStateData.ts | 2 +- .../BucketLandingEmptyResourcesData.ts | 2 +- .../BucketLanding/BucketLandingEmptyState.tsx | 6 +-- .../BucketLanding/CreateBucketDrawer.tsx | 2 + .../StackScriptsEmptyLandingPage.tsx | 6 +-- .../StackScriptsEmptyResourcesData.ts | 2 +- .../Volumes/VolumesLandingEmptyState.tsx | 6 +-- .../Volumes/VolumesLandingEmptyStateData.ts | 2 +- packages/manager/src/utilities/analytics.ts | 14 ------ .../src/utilities/emptyStateLandingUtils.ts | 6 +-- 29 files changed, 114 insertions(+), 122 deletions(-) diff --git a/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinks.tsx b/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinks.tsx index d7eeea16f88..fee22575e51 100644 --- a/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinks.tsx +++ b/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinks.tsx @@ -8,7 +8,7 @@ import { ResourcesLinkIcon } from 'src/components/EmptyLandingPageResources/Reso import type { ResourcesLinks } from './ResourcesLinksTypes'; export const ResourceLinks = (props: ResourcesLinks) => { - const { linkGAEvent, links } = props; + const { linkAnalyticsEvent, links } = props; return ( @@ -16,7 +16,7 @@ export const ResourceLinks = (props: ResourcesLinks) => { {linkData.text} {linkData.external && ( diff --git a/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinksTypes.ts b/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinksTypes.ts index 981376056ca..0f7a6298b8c 100644 --- a/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinksTypes.ts +++ b/packages/manager/src/components/EmptyLandingPageResources/ResourcesLinksTypes.ts @@ -4,7 +4,7 @@ interface ResourcesLink { external?: boolean; } -export interface LinkGAEvent { +export interface linkAnalyticsEvent { category: string; action: string; } @@ -17,7 +17,7 @@ export interface ResourcesHeaders { export interface ResourcesLinks { links: ResourcesLink[]; - linkGAEvent: LinkGAEvent; + linkAnalyticsEvent: linkAnalyticsEvent; } export interface ResourcesLinkSection { diff --git a/packages/manager/src/components/EmptyLandingPageResources/ResourcesSection.tsx b/packages/manager/src/components/EmptyLandingPageResources/ResourcesSection.tsx index ae7e7afdcd9..41b91e857b9 100644 --- a/packages/manager/src/components/EmptyLandingPageResources/ResourcesSection.tsx +++ b/packages/manager/src/components/EmptyLandingPageResources/ResourcesSection.tsx @@ -18,7 +18,7 @@ import { } from 'src/utilities/emptyStateLandingUtils'; import type { ResourcesHeaders, - LinkGAEvent, + linkAnalyticsEvent, ResourcesLinkSection, } from 'src/components/EmptyLandingPageResources/ResourcesLinksTypes'; @@ -56,7 +56,7 @@ interface ResourcesSectionProps { /** * The event data to be sent when the call to action is clicked */ - linkGAEvent: LinkGAEvent; + linkAnalyticsEvent: linkAnalyticsEvent; /** * If true, the transfer display will be shown at the bottom * */ @@ -74,14 +74,22 @@ interface ResourcesSectionProps { wide?: boolean; } -const GuideLinks = (guides: ResourcesLinkSection, linkGAEvent: LinkGAEvent) => ( - +const GuideLinks = ( + guides: ResourcesLinkSection, + linkAnalyticsEvent: linkAnalyticsEvent +) => ( + ); const YoutubeLinks = ( youtube: ResourcesLinkSection, - linkGAEvent: LinkGAEvent -) => ; + linkAnalyticsEvent: linkAnalyticsEvent +) => ( + +); export const ResourcesSection = (props: ResourcesSectionProps) => { const { @@ -91,7 +99,7 @@ export const ResourcesSection = (props: ResourcesSectionProps) => { gettingStartedGuidesData, headers, icon, - linkGAEvent, + linkAnalyticsEvent, showTransferDisplay, youtubeLinkData, wide = false, @@ -112,7 +120,7 @@ export const ResourcesSection = (props: ResourcesSectionProps) => { MoreLink={(props) => ( { )} title={gettingStartedGuidesData.title} > - {GuideLinks(gettingStartedGuidesData, linkGAEvent)} + {GuideLinks(gettingStartedGuidesData, linkAnalyticsEvent)} {CustomResource && } { MoreLink={(props) => ( @@ -145,7 +156,7 @@ export const ResourcesSection = (props: ResourcesSectionProps) => { )} title={youtubeLinkData.title} > - {YoutubeLinks(youtubeLinkData, linkGAEvent)} + {YoutubeLinks(youtubeLinkData, linkAnalyticsEvent)} } diff --git a/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx b/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx index 63bb3713796..a9ae6e5ec78 100644 --- a/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx +++ b/packages/manager/src/features/Databases/DatabaseLanding/DatabaseEmptyState.tsx @@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './DatabaseLandingEmptyStateData'; @@ -19,7 +19,7 @@ export const DatabaseEmptyState = () => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Database Cluster', }); @@ -31,7 +31,7 @@ export const DatabaseEmptyState = () => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={DatabaseIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/Databases/DatabaseLanding/DatabaseLandingEmptyStateData.ts b/packages/manager/src/features/Databases/DatabaseLanding/DatabaseLandingEmptyStateData.ts index 8c888ecd006..888c26a5ad1 100644 --- a/packages/manager/src/features/Databases/DatabaseLanding/DatabaseLandingEmptyStateData.ts +++ b/packages/manager/src/features/Databases/DatabaseLanding/DatabaseLandingEmptyStateData.ts @@ -67,7 +67,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Managed Databases landing page empty', }; diff --git a/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx b/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx index 96502ca00b6..935191ca76a 100644 --- a/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx +++ b/packages/manager/src/features/Domains/DomainsEmptyLandingPage.tsx @@ -5,7 +5,7 @@ import { sendEvent } from 'src/utilities/analytics'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './DomainsEmptyResourcesData'; @@ -23,7 +23,7 @@ export const DomainsEmptyLandingState = (props: Props) => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Domain', }); @@ -34,7 +34,7 @@ export const DomainsEmptyLandingState = (props: Props) => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Import a Zone', }); @@ -46,7 +46,7 @@ export const DomainsEmptyLandingState = (props: Props) => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={DomainIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/Domains/DomainsEmptyResourcesData.ts b/packages/manager/src/features/Domains/DomainsEmptyResourcesData.ts index 1628a4d8f60..ee62a9c0e91 100644 --- a/packages/manager/src/features/Domains/DomainsEmptyResourcesData.ts +++ b/packages/manager/src/features/Domains/DomainsEmptyResourcesData.ts @@ -65,7 +65,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Domains landing page empty', }; diff --git a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyResourcesData.ts b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyResourcesData.ts index 40332e7b935..63ed0eb8191 100644 --- a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyResourcesData.ts +++ b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyResourcesData.ts @@ -63,7 +63,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Firewall landing page empty', }; diff --git a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx index 314fdc1d099..e60b5d11c02 100644 --- a/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx +++ b/packages/manager/src/features/Firewalls/FirewallLanding/FirewallLandingEmptyState.tsx @@ -5,7 +5,7 @@ import { sendEvent } from 'src/utilities/analytics'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './FirewallLandingEmptyResourcesData'; @@ -22,7 +22,7 @@ export const FirewallLandingEmptyState = (props: Props) => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Firewall', }); @@ -34,7 +34,7 @@ export const FirewallLandingEmptyState = (props: Props) => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={FirewallIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx b/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx index 8a7cba812ca..d4db411f726 100644 --- a/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx +++ b/packages/manager/src/features/Images/ImagesLandingEmptyState.tsx @@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './ImagesLandingEmptyStateData'; @@ -19,7 +19,7 @@ export const ImagesLandingEmptyState = () => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Image', }); @@ -31,7 +31,7 @@ export const ImagesLandingEmptyState = () => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={ImageIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/Images/ImagesLandingEmptyStateData.ts b/packages/manager/src/features/Images/ImagesLandingEmptyStateData.ts index 60c66a43526..e7eee3be70d 100644 --- a/packages/manager/src/features/Images/ImagesLandingEmptyStateData.ts +++ b/packages/manager/src/features/Images/ImagesLandingEmptyStateData.ts @@ -70,7 +70,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Images landing page empty', }; diff --git a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx index 85af56b0651..c7849daeb47 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx +++ b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyState.tsx @@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './KubernetesLandingEmptyStateData'; @@ -19,7 +19,7 @@ export const KubernetesEmptyState = () => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Cluster', }); @@ -31,7 +31,7 @@ export const KubernetesEmptyState = () => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={KubernetesSvg} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyStateData.ts b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyStateData.ts index 15ec5cec6c3..fc0b3b6cc33 100644 --- a/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyStateData.ts +++ b/packages/manager/src/features/Kubernetes/KubernetesLanding/KubernetesLandingEmptyStateData.ts @@ -76,7 +76,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Kubernetes landing page empty', }; diff --git a/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx b/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx index 39815729487..41c3edeb963 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/ApiAwarenessModal/index.tsx @@ -13,7 +13,7 @@ import { makeStyles } from '@mui/styles'; import { Theme } from '@mui/material/styles'; import Tabs from 'src/components/core/ReachTabs'; import TabPanels from 'src/components/core/ReachTabPanels'; -import { sendEvent } from 'src/utilities/analytics'; +import { sendApiAwarenessClickEvent } from 'src/utilities/analytics'; import generateCurlCommand from 'src/utilities/generate-cURL'; import generateCLICommand from 'src/utilities/generate-cli'; @@ -60,13 +60,6 @@ export interface Props { payLoad: CreateLinodeRequest; } -const fireGAEvent = (label: string) => { - sendEvent({ - action: 'Click:link', - category: 'Linode Create API CLI Awareness Modal', - label, - }); -}; const ApiAwarenessModal = (props: Props) => { const { isOpen, onClose, route, payLoad } = props; @@ -104,11 +97,7 @@ const ApiAwarenessModal = (props: Props) => { ]; const handleTabChange = (index: number) => { - sendEvent({ - category: 'Linode Create API CLI Awareness Modal', - action: `Click: ${tabs[index].type} Tab`, - label: tabs[index].type, - }); + sendApiAwarenessClickEvent(`${tabs[index].type} Tab`, tabs[index].type); }; useEffect(() => { @@ -147,7 +136,9 @@ const ApiAwarenessModal = (props: Props) => { fireGAEvent('personal access token')} + onClick={() => + sendApiAwarenessClickEvent('link', 'personal access token') + } hideIcon /> . The command below assumes that your personal access token has @@ -156,14 +147,21 @@ const ApiAwarenessModal = (props: Props) => { fireGAEvent('Get Started with the Linode API')} + onClick={() => + sendApiAwarenessClickEvent( + 'link', + 'Get Started with the Linode API' + ) + } hideIcon />{' '} and{' '} fireGAEvent('Linode API Guides')} + onClick={() => + sendApiAwarenessClickEvent('link', 'Linode API Guides') + } hideIcon /> . @@ -182,7 +180,10 @@ const ApiAwarenessModal = (props: Props) => { text="Install and Configure the Linode CLI" link="https://www.linode.com/docs/products/tools/cli/guides/install/" onClick={() => - fireGAEvent('Install and Configure the Linode CLI') + sendApiAwarenessClickEvent( + 'link', + 'Install and Configure the Linode CLI' + ) } hideIcon />{' '} @@ -191,7 +192,9 @@ const ApiAwarenessModal = (props: Props) => { fireGAEvent('Linode CLI Guides')} + onClick={() => + sendApiAwarenessClickEvent('link', 'Linode CLI Guides') + } hideIcon /> . @@ -210,21 +213,25 @@ const ApiAwarenessModal = (props: Props) => { fireGAEvent('Linode Terraform Provider')} + onClick={() => + sendApiAwarenessClickEvent('link', 'Linode Terraform Provider') + } hideIcon />{' '} and{' '} fireGAEvent('Ansible Collection')} + onClick={() => + sendApiAwarenessClickEvent('link', 'Ansible Collection') + } hideIcon /> .{' '} fireGAEvent('View all tools')} + onClick={() => sendApiAwarenessClickEvent('link', 'View all tools')} hideIcon />{' '} with programmatic access to the Linode platform. diff --git a/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx b/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx index b08cf35d5c4..ae1c2fdcc5d 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/CodeBlock/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { HighlightedMarkdown } from 'src/components/HighlightedMarkdown/HighlightedMarkdown'; import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip'; -import { sendEvent } from 'src/utilities/analytics'; +import { sendApiAwarenessClickEvent } from 'src/utilities/analytics'; import { useCodeBlockStyles } from './styles'; export interface Props { command: string; @@ -14,11 +14,7 @@ const CodeBlock = (props: Props) => { const classes = useCodeBlockStyles(); const handleCopyIconClick = () => { - sendEvent({ - category: 'Linode Create API CLI Awareness Modal', - action: `Click: Copy Icon`, - label: commandType, - }); + sendApiAwarenessClickEvent('Copy Icon', commandType); }; return ( diff --git a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx index 3f8562389a2..a4f12769aff 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreate.tsx @@ -43,7 +43,10 @@ import { getInitialType } from 'src/store/linodeCreate/linodeCreate.reducer'; import { doesRegionSupportFeature } from 'src/utilities/doesRegionSupportFeature'; import { getErrorMap } from 'src/utilities/errorUtils'; import { filterCurrentTypes } from 'src/utilities/filterCurrentLinodeTypes'; -import { sendEvent } from 'src/utilities/analytics'; +import { + sendApiAwarenessClickEvent, + sendLinodeCreateFlowDocsClickEvent, +} from 'src/utilities/analytics'; import { getQueryParamsFromQueryString } from 'src/utilities/queryParams'; import { v4 } from 'uuid'; import { AddonsPanel } from './AddonsPanel'; @@ -414,11 +417,7 @@ export class LinodeCreate extends React.PureComponent< stackscript_id: this.props.selectedStackScriptID, stackscript_data: this.props.selectedUDFs, }; - sendEvent({ - category: 'Linode Create API CLI Awareness Modal', - action: 'Click:Button', - label: 'Create Using Command Line', - }); + sendApiAwarenessClickEvent('Button', 'Create Using Command Line'); this.props.checkValidation(payload); }; @@ -725,11 +724,7 @@ export class LinodeCreate extends React.PureComponent< href="https://www.linode.com/docs/guides/choosing-a-compute-instance-plan/" label="Choosing a Plan" onClick={() => { - sendEvent({ - category: 'Linode Create Flow', - action: 'Click:link', - label: 'Choosing a Plan', - }); + sendLinodeCreateFlowDocsClickEvent('Choosing a Plan'); }} /> } diff --git a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx index 55f0e2182b0..242a9abab09 100644 --- a/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx +++ b/packages/manager/src/features/Linodes/LinodesCreate/LinodeCreateContainer.tsx @@ -56,7 +56,10 @@ import { upsertLinode } from 'src/store/linodes/linodes.actions'; import { MapState } from 'src/store/types'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; import { isEURegion } from 'src/utilities/formatRegion'; -import { sendCreateLinodeEvent, sendEvent } from 'src/utilities/analytics'; +import { + sendCreateLinodeEvent, + sendLinodeCreateFlowDocsClickEvent, +} from 'src/utilities/analytics'; import { getQueryParamsFromQueryString } from 'src/utilities/queryParams'; import scrollErrorIntoView from 'src/utilities/scrollErrorIntoView'; import { validatePassword } from 'src/utilities/validatePassword'; @@ -779,13 +782,9 @@ class LinodeCreateContainer extends React.PureComponent { title="Create" docsLabel="Getting Started" docsLink="https://www.linode.com/docs/guides/platform/get-started/" - onDocsClick={() => { - sendEvent({ - category: 'Linode Create Flow', - action: 'Click:link', - label: 'Getting Started', - }); - }} + onDocsClick={() => + sendLinodeCreateFlowDocsClickEvent('Getting Started') + } /> { }, }} onDocsClick={() => { - sendEvent({ - category: 'Linode Create Flow', - action: 'Click:link', - label: 'Getting Started', - }); + sendLinodeCreateFlowDocsClickEvent('Getting Started'); }} /> { onClick: () => { push('/linodes/create'); sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Linode', }); @@ -43,7 +43,7 @@ export const LinodesLandingEmptyState = () => { icon={} MoreLink={(props) => ( @@ -59,7 +59,7 @@ export const LinodesLandingEmptyState = () => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={LinodeSvg} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} showTransferDisplay={true} youtubeLinkData={youtubeLinkData} wide={true} diff --git a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyStateData.ts b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyStateData.ts index 44b2511aa76..21c6fb47ebb 100644 --- a/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyStateData.ts +++ b/packages/manager/src/features/Linodes/LinodesLanding/LinodesLandingEmptyStateData.ts @@ -75,7 +75,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Linodes landing page empty', }; diff --git a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyResourcesData.ts b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyResourcesData.ts index cce0387df36..8ff85aa6a37 100644 --- a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyResourcesData.ts +++ b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyResourcesData.ts @@ -73,7 +73,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Object Storage landing page empty', }; diff --git a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx index cab79707236..ff6c5672c4d 100644 --- a/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx +++ b/packages/manager/src/features/ObjectStorage/BucketLanding/BucketLandingEmptyState.tsx @@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './BucketLandingEmptyResourcesData'; @@ -19,7 +19,7 @@ export const BucketLandingEmptyState = () => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Bucket', }); @@ -32,7 +32,7 @@ export const BucketLandingEmptyState = () => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={StyledBucketIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} showTransferDisplay youtubeLinkData={youtubeLinkData} /> diff --git a/packages/manager/src/features/ObjectStorage/BucketLanding/CreateBucketDrawer.tsx b/packages/manager/src/features/ObjectStorage/BucketLanding/CreateBucketDrawer.tsx index f42b4bfbfc3..b0a05eccb3e 100644 --- a/packages/manager/src/features/ObjectStorage/BucketLanding/CreateBucketDrawer.tsx +++ b/packages/manager/src/features/ObjectStorage/BucketLanding/CreateBucketDrawer.tsx @@ -22,6 +22,7 @@ import { useObjectStorageBuckets, useObjectStorageClusters, } from 'src/queries/objectStorage'; +import { sendCreateBucketEvent } from 'src/utilities/analytics'; interface Props { isOpen: boolean; @@ -67,6 +68,7 @@ export const CreateBucketDrawer = (props: Props) => { }, async onSubmit(values) { await createBucket(values); + sendCreateBucketEvent(values.cluster); onClose(); }, }); diff --git a/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx b/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx index 4387636c932..92fe8e3ea68 100644 --- a/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx +++ b/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyLandingPage.tsx @@ -5,7 +5,7 @@ import { sendEvent } from 'src/utilities/analytics'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './StackScriptsEmptyResourcesData'; @@ -22,7 +22,7 @@ export const StackScriptsEmptyLandingState = (props: Props) => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create StackScript', }); @@ -34,7 +34,7 @@ export const StackScriptsEmptyLandingState = (props: Props) => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={StackScriptsIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyResourcesData.ts b/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyResourcesData.ts index 7a53a44f7ea..f6a70eb0343 100644 --- a/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyResourcesData.ts +++ b/packages/manager/src/features/StackScripts/StackScriptBase/StackScriptsEmptyResourcesData.ts @@ -66,7 +66,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'StackScripts landing page empty', }; diff --git a/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx b/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx index f34cc0cd27c..bd42991641a 100644 --- a/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx +++ b/packages/manager/src/features/Volumes/VolumesLandingEmptyState.tsx @@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom'; import { gettingStartedGuides, headers, - linkGAEvent, + linkAnalyticsEvent, youtubeLinkData, } from './VolumesLandingEmptyStateData'; @@ -19,7 +19,7 @@ export const VolumesLandingEmptyState = () => { { onClick: () => { sendEvent({ - category: linkGAEvent.category, + category: linkAnalyticsEvent.category, action: 'Click:button', label: 'Create Volume', }); @@ -31,7 +31,7 @@ export const VolumesLandingEmptyState = () => { gettingStartedGuidesData={gettingStartedGuides} headers={headers} icon={StyledVolumeIcon} - linkGAEvent={linkGAEvent} + linkAnalyticsEvent={linkAnalyticsEvent} youtubeLinkData={youtubeLinkData} /> ); diff --git a/packages/manager/src/features/Volumes/VolumesLandingEmptyStateData.ts b/packages/manager/src/features/Volumes/VolumesLandingEmptyStateData.ts index 784335e4f76..73686bd8d63 100644 --- a/packages/manager/src/features/Volumes/VolumesLandingEmptyStateData.ts +++ b/packages/manager/src/features/Volumes/VolumesLandingEmptyStateData.ts @@ -66,7 +66,7 @@ export const youtubeLinkData: ResourcesLinkSection = { title: 'Video Playlist', }; -export const linkGAEvent: ResourcesLinks['linkGAEvent'] = { +export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = { action: 'Click:link', category: 'Volumes landing page empty', }; diff --git a/packages/manager/src/utilities/analytics.ts b/packages/manager/src/utilities/analytics.ts index 517494420cf..93e76ba89dd 100644 --- a/packages/manager/src/utilities/analytics.ts +++ b/packages/manager/src/utilities/analytics.ts @@ -393,20 +393,6 @@ export const sendMarketplaceSearchEvent = ( }); }; -// DatabaseEmptyState.tsx -// KubernetesLandingEmptyState.tsx -// ListLinodesEmptyState.tsx -export const sendEmptyStateLandingCreateEvent = ( - productName: string, - eventLabel?: string -) => { - sendEvent({ - category: `${productName} landing page empty`, - action: 'Click:button', - label: `Create ${eventLabel ?? productName}`, - }); -}; - // LinodeCreate.tsx // LinodesCreate/CodeBlock/index.tsx // LinodesCreate/ApiAwareness/index.tsx diff --git a/packages/manager/src/utilities/emptyStateLandingUtils.ts b/packages/manager/src/utilities/emptyStateLandingUtils.ts index 10d0c24f351..2da5edba98b 100644 --- a/packages/manager/src/utilities/emptyStateLandingUtils.ts +++ b/packages/manager/src/utilities/emptyStateLandingUtils.ts @@ -9,17 +9,17 @@ export const youtubeChannelLink = // retaining the old label for tracking export const youtubeMoreLinkLabel = 'View the complete playlist'; -interface GAEventTemplate { +interface AnalyticsEventTemplate { category: string; action: string; } export const getLinkOnClick = ( - linkGAEventTemplate: GAEventTemplate, + linkAnalyticsEventTemplate: AnalyticsEventTemplate, linkText: string ) => () => { sendEvent({ - ...linkGAEventTemplate, + ...linkAnalyticsEventTemplate, label: linkText, }); }; From ec42dd94241d7bf05dbaeeaae3c7d800c50dd5e1 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 09:52:20 -0700 Subject: [PATCH 07/10] Fix bug overfiring disk error toast event; clean up --- .../LinodeAdvanced/LinodeDiskDrawer.tsx | 8 ++------ .../LinodesDetail/LinodeAdvanced/LinodeDisks.tsx | 12 ++++++------ .../ToastNotifications/ToastNotifications.tsx | 15 ++++++++------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx index 25246bdd9b8..1285671abe5 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDiskDrawer.tsx @@ -26,7 +26,7 @@ import { handleFieldErrors, handleGeneralErrors, } from 'src/utilities/formikErrorUtils'; -import { sendEvent } from 'src/utilities/analytics'; +import { sendLinodeDiskEvent } from 'src/utilities/analytics'; import { extendValidationSchema } from 'src/utilities/validatePassword'; import { object, string } from 'yup'; @@ -113,11 +113,7 @@ const getTitle = (v: DrawerMode) => { }; const handleLinkClick = (label: string) => { - sendEvent({ - category: 'Disk Resize Flow', - action: `Click:link`, - label, - }); + sendLinodeDiskEvent('Resize', 'Click:link', label); }; export const DiskDrawer: React.FC = (props) => { diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx index 546f403c205..fbe80c84739 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeAdvanced/LinodeDisks.tsx @@ -35,7 +35,7 @@ import { withLinodeDetailContext, } from 'src/features/Linodes/LinodesDetail/linodeDetailContext'; import { getAPIErrorOrDefault } from 'src/utilities/errorUtils'; -import { sendEvent } from 'src/utilities/analytics'; +import { sendLinodeDiskEvent } from 'src/utilities/analytics'; import LinodeDiskDrawer from './LinodeDiskDrawer'; import LinodeDiskRow from './LinodeDiskRow'; @@ -181,11 +181,11 @@ class LinodeDisks extends React.Component { text={noFreeDiskSpaceWarning} status="help" tooltipAnalyticsEvent={() => - sendEvent({ - category: `Disk Resize Flow`, - action: `Open:tooltip`, - label: `Add a Disk help icon tooltip`, - }) + sendLinodeDiskEvent( + 'Resize', + 'Open:tooltip', + 'Add a Disk help icon tooltip' + ) } /> ) : undefined} diff --git a/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx b/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx index 8a36fba4ea0..04d2e47504d 100644 --- a/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx +++ b/packages/manager/src/features/ToastNotifications/ToastNotifications.tsx @@ -9,7 +9,7 @@ import { Subscription } from 'rxjs/Subscription'; import Link from 'src/components/Link'; import { SupportLink } from 'src/components/SupportLink'; import { events$ } from 'src/events'; -import { sendEvent } from 'src/utilities/analytics'; +import { sendLinodeDiskEvent } from 'src/utilities/analytics'; interface ToastOptions { enqueueSnackbar: WithSnackbarProps['enqueueSnackbar']; @@ -130,11 +130,12 @@ class ToastNotifications extends React.PureComponent { link: formatLink( 'Learn more about resizing restrictions.', 'https://www.linode.com/docs/products/compute/compute-instances/guides/disks-and-storage/', - sendEvent({ - category: 'Disk Resize Flow', - action: `Click:link`, - label: 'Disk resize failed toast', - }) + () => + sendLinodeDiskEvent( + 'Resize', + 'Click:link', + 'Disk resize failed toast' + ) ), }); case 'image_upload': @@ -279,7 +280,7 @@ export default withSnackbar(ToastNotifications); const formatLink = (text: string, link: string, handleClick?: any) => { return ( - handleClick}> + {text} ); From 9dc59d0d48c96ffead624f4abb13fb15de0c6d90 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 11:12:18 -0700 Subject: [PATCH 08/10] Added changeset: Deprecate Google Analytics and clean up unused custom events --- packages/manager/.changeset/pr-9266-removed-1686852738775.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-9266-removed-1686852738775.md diff --git a/packages/manager/.changeset/pr-9266-removed-1686852738775.md b/packages/manager/.changeset/pr-9266-removed-1686852738775.md new file mode 100644 index 00000000000..09cacf03f78 --- /dev/null +++ b/packages/manager/.changeset/pr-9266-removed-1686852738775.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Removed +--- + +Deprecate Google Analytics and clean up unused custom events ([#9266](https://github.com/linode/manager/pull/9266)) From 0f39300840925c26c99f16316cd43c759fd5a7b2 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Thu, 15 Jun 2023 11:13:24 -0700 Subject: [PATCH 09/10] Added changeset: References to deprecated Google Tag Manager --- packages/api-v4/.changeset/pr-9266-removed-1686852804191.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/api-v4/.changeset/pr-9266-removed-1686852804191.md diff --git a/packages/api-v4/.changeset/pr-9266-removed-1686852804191.md b/packages/api-v4/.changeset/pr-9266-removed-1686852804191.md new file mode 100644 index 00000000000..5237e0829de --- /dev/null +++ b/packages/api-v4/.changeset/pr-9266-removed-1686852804191.md @@ -0,0 +1,5 @@ +--- +"@linode/api-v4": Removed +--- + +References to deprecated Google Tag Manager ([#9266](https://github.com/linode/manager/pull/9266)) From b3d600bf64ada8097dbbdd945a1f29678e750734 Mon Sep 17 00:00:00 2001 From: mjac0bs Date: Fri, 16 Jun 2023 12:41:51 -0700 Subject: [PATCH 10/10] Remove any pipes --- packages/manager/src/utilities/analytics.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/manager/src/utilities/analytics.ts b/packages/manager/src/utilities/analytics.ts index 93e76ba89dd..6db0b754ff1 100644 --- a/packages/manager/src/utilities/analytics.ts +++ b/packages/manager/src/utilities/analytics.ts @@ -14,10 +14,11 @@ export const sendEvent = (eventPayload: AnalyticsEvent): void => { // Send a Direct Call Rule if our environment is configured with an Adobe Launch script if ((window as any)._satellite) { + // Just don't allow pipes in strings for Adobe Analytics processing. (window as any)._satellite.track('custom event', { - category: eventPayload.category, - action: eventPayload.action, - label: eventPayload.label, + category: eventPayload.category.replace('|', ''), + action: eventPayload.action.replace('|', ''), + label: eventPayload.label?.replace('|', ''), value: eventPayload.value, }); }