Skip to content

Commit

Permalink
Add google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Mar 9, 2024
1 parent 9f634b5 commit 5f81133
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ export function Layout({ children }: { children: React.ReactNode }) {
<Links />
</head>
<body className={error ? 'c-error__body' : undefined}>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-6VHREDE1NE"></script>
<script
dangerouslySetInnerHTML={{
__html: [
`window.dataLayer = window.dataLayer || [];`,
`function gtag(){window.dataLayer.push(arguments);}`,
`gtag('js', new Date());`,
`gtag('config', 'G-6VHREDE1NE');`,
].join(''),
}}
/>
{children}
<ScrollRestoration />
<Scripts />
Expand Down

0 comments on commit 5f81133

Please sign in to comment.