This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/layout.tsx | |
import { Suspense } from 'react' | |
import HubspotTracker from '@/components/main/HubSpotTracker' | |
export default function RootLayout({ | |
children | |
}: { | |
children: React.ReactNode | |
}) { | |
return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/main/HubSpotTracker.tsx | |
"use client"; | |
import { useEffect, useState } from "react"; | |
import { usePathname, useSearchParams } from "next/navigation"; | |
import Script from "next/script"; | |
declare global { | |
interface Window { | |
_hsq: any[]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Client } from "@hubspot/api-client"; | |
import { FilterOperatorEnum } from "@hubspot/api-client/lib/codegen/crm/contacts"; | |
// import { retryRequest } from "../utils/errorHandler"; | |
class HubSpotService { | |
private hubspotClient: Client; | |
constructor(accessToken: string) { | |
this.hubspotClient = new Client({ accessToken }); | |
} |