Skip to content

Commit

Permalink
Add Hotjar
Browse files Browse the repository at this point in the history
* add hotjar

* use env vars
  • Loading branch information
MarkSackerberg authored Feb 28, 2024
1 parent 2e1d1e9 commit e64fb8b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NEXT_PUBLIC_DOCSEARCH_APP_ID=R2IYF7ETH7
NEXT_PUBLIC_DOCSEARCH_API_KEY=599cec31baffa4868cae4e79f180729b
NEXT_PUBLIC_DOCSEARCH_INDEX_NAME=docsearch
NEXT_PUBLIC_HOTJAR_ID=3793483
NEXT_PUBLIC_HOTJAR_VERSION=6
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@docsearch/react": "^3.2.1",
"@headlessui/react": "^1.7.13",
"@heroicons/react": "^2.0.18",
"@hotjar/browser": "^1.0.9",
"@markdoc/markdoc": "0.3.0",
"@markdoc/next.js": "0.2.3",
"@sindresorhus/slugify": "^2.1.0",
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/components/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import clsx from 'clsx'
import Link from 'next/link'
import Hotjar from '@hotjar/browser';

import { Header } from '@/components/Header'
import { Navigation } from '@/components/Navigation'
Expand All @@ -13,6 +14,9 @@ export function Layout({ children, page }) {
const Hero = page.activeHero
useLightense()
useAccentClass(page.product)
if(process.env.NEXT_HOTJAR_ID && process.env.NEXT_HOTJAR_Version){
Hotjar.init(process.env.NEXT_HOTJAR_ID, process.env.NEXT_HOTJAR_Version);
}

return (
<>
Expand Down

0 comments on commit e64fb8b

Please sign in to comment.