Skip to content

Commit

Permalink
Merge pull request #69 from dnd-side-project/main
Browse files Browse the repository at this point in the history
Hotjar to Production
  • Loading branch information
seondal authored Nov 6, 2023
2 parents 0fa4ebd + 3c1e3c0 commit ce939ed
Show file tree
Hide file tree
Showing 8 changed files with 2,343 additions and 40 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_NODE_ENV=development
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_NODE_ENV=production
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"next": "13.4.12",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hotjar": "^6.1.0",
"react-intersection-observer": "^9.5.2",
"react-lottie-player": "^1.5.4",
"react-tooltip": "^5.20.0",
Expand Down
1 change: 1 addition & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const metadata: Metadata = {
},
other: {
'naver-site-verification': 'eb9f471cae26de34e6bc71849e73f04cb8b00d83',
'last-updated': '2023-11-06',
},
openGraph: {
title: META_STRING.title,
Expand Down
18 changes: 17 additions & 1 deletion src/components/Analytics/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { usePathname, useSearchParams } from 'next/navigation';
import Script from 'next/script';
import { useEffect } from 'react';

import { GA_ID } from '@/constants';
import { GA_ID, HOTJAR } from '@/constants';
import { pageview } from '@/utils/gtm';

export default function Analytics() {
Expand Down Expand Up @@ -41,6 +41,22 @@ export default function Analytics() {
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);
})(window,document,'script','dataLayer', '${GA_ID}');
`,
}}
/>
<Script
id="hotjar-script"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:${HOTJAR.HJID},hjsv:${HOTJAR.HJSV}};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');;
`,
}}
/>
Expand Down
1 change: 1 addition & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export const BASE_API_URL = process.env.NEXT_PUBLIC_API_URL;
export const BASE_SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? 'https://www.posepicker.site';
export const KAKAO_KEY = process.env.NEXT_PUBLIC_KAKAO_KEY;
export const GA_ID = process.env.NEXT_PUBLIC_GA_ID;
export const HOTJAR = { HJID: 3704547, HJSV: 6 };
2,355 changes: 2,316 additions & 39 deletions yarn-error.log

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4201,6 +4201,11 @@ [email protected]:
loose-envify "^1.1.0"
scheduler "^0.23.0"

react-hotjar@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-hotjar/-/react-hotjar-6.1.0.tgz#910dd5d002f5043a6f34ae7ada545b2aace1edae"
integrity sha512-V1UJixDMspAIrbGIFG282U7mH2aK1JBid0YR8F9oscb6lTkjMga+gst2gesxJDsqsax+k+lM1LqRXYzmUu8izA==

react-intersection-observer@^9.5.2:
version "9.5.2"
resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-9.5.2.tgz#f68363a1ff292323c0808201b58134307a1626d0"
Expand Down

0 comments on commit ce939ed

Please sign in to comment.