Skip to content

Commit

Permalink
chore: add hotjar to plus page
Browse files Browse the repository at this point in the history
  • Loading branch information
idoshamun committed Mar 10, 2025
1 parent a128428 commit 640ff8f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

11 changes: 8 additions & 3 deletions packages/webapp/components/Pixels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ const GtagTracking = ({
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const HotJarTracking = ({ hotjarId }: HotjarProps): ReactElement => {
export const HotJarTracking = ({ hotjarId }: HotjarProps): ReactElement => {
const { cookieExists: acceptedMarketing } = useConsentCookie(
GdprConsentKey.Marketing,
);
if (!acceptedMarketing) {
return null;
}
return (
<Script strategy="afterInteractive" id="load-hotjar">
{`
Expand Down Expand Up @@ -331,7 +337,7 @@ export const EXPERIENCE_TO_SENIORITY: Record<
NOT_ENGINEER: 'not_engineer',
};

export const Pixels = ({ hotjarId }: Partial<HotjarProps>): ReactElement => {
export const Pixels = (): ReactElement => {
const { cookieExists: acceptedMarketing } = useConsentCookie(
GdprConsentKey.Marketing,
);
Expand All @@ -350,7 +356,6 @@ export const Pixels = ({ hotjarId }: Partial<HotjarProps>): ReactElement => {

return (
<>
{hotjarId && <HotJarTracking hotjarId={hotjarId} />}
<FbTracking {...props} />
<GtagTracking {...props} />
{consent && (
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp/pages/plus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { CommonPlusPageProps } from '@dailydotdev/shared/src/components/plu
import { getPlusLayout } from '../../components/layouts/PlusLayout/PlusLayout';
import { getTemplatedTitle } from '../../components/layouts/utils';
import { defaultOpenGraph } from '../../next-seo';
import { HotJarTracking } from '../../components/Pixels';

const PlusMobile = dynamic(() =>
import(
Expand Down Expand Up @@ -46,6 +47,7 @@ const PlusPage = ({

return (
<GiftUserContext.Provider value={{ giftToUser }}>
<HotJarTracking hotjarId="5215055" />
{isLaptop ? (
<PlusDesktop shouldShowPlusHeader={shouldShowPlusHeader} />
) : (
Expand Down

0 comments on commit 640ff8f

Please sign in to comment.