Skip to content

Commit 2f7f50a

Browse files
committed
feat: add OpenPanel analytics to cloud version
1 parent 903789b commit 2f7f50a

3 files changed

Lines changed: 104 additions & 3 deletions

File tree

‎apps/dokploy/components/shared/analytics.tsx‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import { OpenPanelComponent } from "@openpanel/nextjs";
12
import { useRouter } from "next/router";
23
import Script from "next/script";
34
import { useEffect } from "react";
45
import { GTM_ID, pushToDataLayer } from "@/lib/analytics";
56
import { api } from "@/utils/api";
67

78
/**
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.
1113
*/
1214
export const Analytics = () => {
1315
const router = useRouter();
@@ -40,6 +42,14 @@ export const Analytics = () => {
4042

4143
return (
4244
<>
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+
/>
4353
<Script id="analytics-init" strategy="afterInteractive">
4454
{`
4555
window.hsConversationsSettings = { loadImmediately: false };

‎apps/dokploy/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"@hookform/resolvers": "^5.2.2",
6868
"@octokit/auth-app": "^6.1.3",
6969
"@octokit/webhooks": "^13.9.0",
70+
"@openpanel/nextjs": "^1.5.1",
7071
"@react-email/components": "^1.0.12",
7172
"@stepperize/react": "4.0.1",
7273
"@stripe/stripe-js": "4.8.0",

‎pnpm-lock.yaml‎

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)