|
| 1 | +import { OpenPanelComponent } from "@openpanel/nextjs"; |
1 | 2 | import { useRouter } from "next/router"; |
2 | 3 | import Script from "next/script"; |
3 | 4 | import { useEffect } from "react"; |
4 | 5 | import { GTM_ID, pushToDataLayer } from "@/lib/analytics"; |
5 | 6 | import { api } from "@/utils/api"; |
6 | 7 |
|
7 | 8 | /** |
8 | | - * Loads Google Tag Manager and the HubSpot marketing tag on the cloud |
9 | | - * version only, and translates tracking query params appended by the |
10 | | - * auth/billing flows (?signup=..., ?subscription=new) into dataLayer events. |
| 9 | + * Loads Google Tag Manager, the HubSpot marketing tag, and OpenPanel |
| 10 | + * product analytics on the cloud version only, and translates tracking |
| 11 | + * query params appended by the auth/billing flows (?signup=..., |
| 12 | + * ?subscription=new) into dataLayer events. |
11 | 13 | */ |
12 | 14 | export const Analytics = () => { |
13 | 15 | const router = useRouter(); |
@@ -40,6 +42,14 @@ export const Analytics = () => { |
40 | 42 |
|
41 | 43 | return ( |
42 | 44 | <> |
| 45 | + <OpenPanelComponent |
| 46 | + apiUrl="https://openpanel.dokploy.com/api" |
| 47 | + clientId="bf5a178b-7f28-4461-bf47-d63feff15922" |
| 48 | + trackScreenViews={true} |
| 49 | + trackOutgoingLinks={true} |
| 50 | + trackAttributes={true} |
| 51 | + globalProperties={{ site: "app" }} |
| 52 | + /> |
43 | 53 | <Script id="analytics-init" strategy="afterInteractive"> |
44 | 54 | {` |
45 | 55 | window.hsConversationsSettings = { loadImmediately: false }; |
|
0 commit comments