Skip to content

Commit

Permalink
feat: add google analytics and google search engine and 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
HamzaAmar committed Oct 21, 2023
1 parent 4262b86 commit 1391cc1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
23 changes: 23 additions & 0 deletions apps/docs/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react'
import Link from 'next/link'
import { Layout } from 'src/component/common'
import { Button, Flex, Heading, Text } from '@pillar-ui/core'

export default function Custom404() {
return (
<Layout>
<Flex style={{ maxWidth: '680px' }} justify="center" direction="column" items="center" gap="md" className="hero">
<Heading size="3xl" weight="bold">
404 - Page Not Found
</Heading>
<Text contrast="low" size="lg">
The page you&apos;re looking for has wandered into the digital abyss. But worry not! The UI guardians are here
to guide you back.
</Text>
<Button as={Link} href="/">
Return to Home
</Button>
</Flex>
</Layout>
)
}
19 changes: 18 additions & 1 deletion apps/docs/src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@ import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html>
<Head />
<Head>
<meta name="google-site-verification" content={`${process.env.NEXT_PUBLIC_G_SITE_VERIFICATION}`} />
<script async src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GA_TRACKING_ID}`} />
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.GA_TRACKING_ID}', {
page_path: window.location.pathname,
});
`,
}}
/>
<link rel="icon" href="/favicon.png" sizes="16" />
</Head>

<body className="custom-scroll">
<Main />
<NextScript />
Expand Down

0 comments on commit 1391cc1

Please sign in to comment.