diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 55f9fe661..2477fba54 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "hasInstallScript": true, "dependencies": { - "@next/third-parties": "^14.0.4", + "@next/third-parties": "^14.3.0-canary.59", "@opentelemetry/api": "^1.8.0", "@trussworks/react-uswds": "^7.0.0", "@uswds/uswds": "^3.6.0", @@ -5074,9 +5074,9 @@ } }, "node_modules/@next/third-parties": { - "version": "14.1.4", - "resolved": "https://registry.npmjs.org/@next/third-parties/-/third-parties-14.1.4.tgz", - "integrity": "sha512-e/kpEFq5/ZPhHkxpJkvhMfLp3OC6KCBou0/BV8BvgjXAPgEo6sa0ZXe0l4ZEb3wcA7NIEHIpqCmjU5Z7QAHcKQ==", + "version": "14.3.0-canary.59", + "resolved": "https://registry.npmjs.org/@next/third-parties/-/third-parties-14.3.0-canary.59.tgz", + "integrity": "sha512-iLFFrkeWU3VWHjviPSecoMA0ehvu6Xnm2YIyX6XCukWYRTyi4hyisaITBt0EVF/ycytBZGxWLnFzP1RW77WV+A==", "dependencies": { "third-party-capital": "1.0.20" }, diff --git a/frontend/package.json b/frontend/package.json index e7ea90517..f97eb31f5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -24,7 +24,7 @@ "ts:check": "tsc --noEmit" }, "dependencies": { - "@next/third-parties": "^14.0.4", + "@next/third-parties": "^14.3.0-canary.59", "@opentelemetry/api": "^1.8.0", "@trussworks/react-uswds": "^7.0.0", "@uswds/uswds": "^3.6.0", diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index ae9ad6ff3..5c52b5004 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -29,6 +29,9 @@ export default function RootLayout({ children, params }: LayoutProps) { return ( + + + {/* Separate layout component for the inner-body UI elements since Storybook and tests trip over the fact that this file renders an tag */} @@ -36,7 +39,6 @@ export default function RootLayout({ children, params }: LayoutProps) { {/* TODO: Add locale="english" prop when ready for i18n */} {children} - ); } diff --git a/frontend/src/app/template.tsx b/frontend/src/app/template.tsx index d0c3f4046..a79e15041 100644 --- a/frontend/src/app/template.tsx +++ b/frontend/src/app/template.tsx @@ -10,7 +10,7 @@ export default function Template({ children }: { children: React.ReactNode }) { useEffect(() => { isProd && PUBLIC_ENV.GOOGLE_ANALYTICS_ID && - sendGAEvent({ event: "page_view" }); + sendGAEvent("event", "page_view"); }, [isProd]); return
{children}
; diff --git a/frontend/src/components/search/SearchBar.tsx b/frontend/src/components/search/SearchBar.tsx index 07bf3ffbf..295fdbc90 100644 --- a/frontend/src/components/search/SearchBar.tsx +++ b/frontend/src/components/search/SearchBar.tsx @@ -3,6 +3,7 @@ import { Icon } from "@trussworks/react-uswds"; import { useSearchParamUpdater } from "../../hooks/useSearchParamUpdater"; import { useState } from "react"; +import { sendGAEvent } from "@next/third-parties/google"; interface SearchBarProps { initialQueryParams: string; @@ -14,6 +15,7 @@ export default function SearchBar({ initialQueryParams }: SearchBarProps) { const handleSubmit = () => { updateQueryParams(inputValue, "query"); + sendGAEvent("event", "search", { search_term: inputValue }); }; return (