Skip to content

Commit

Permalink
🛠 fix : hotjar main
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Nov 6, 2023
1 parent 0fa4ebd commit b74e2e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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

0 comments on commit b74e2e1

Please sign in to comment.