Skip to content

Commit 26d75be

Browse files
authored
fix(app): remove product app marketing pixels (#2716)
1 parent 2e86a8d commit 26d75be

15 files changed

Lines changed: 31 additions & 407 deletions

File tree

Dockerfile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,12 @@ ARG NEXT_PUBLIC_PORTAL_URL
7777
ARG NEXT_PUBLIC_POSTHOG_KEY
7878
ARG NEXT_PUBLIC_POSTHOG_HOST
7979
ARG NEXT_PUBLIC_IS_DUB_ENABLED
80-
ARG NEXT_PUBLIC_GTM_ID
81-
ARG NEXT_PUBLIC_LINKEDIN_PARTNER_ID
82-
ARG NEXT_PUBLIC_LINKEDIN_CONVERSION_ID
83-
ARG NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL
8480
ARG NEXT_PUBLIC_API_URL
8581
ENV NEXT_PUBLIC_BETTER_AUTH_URL=$NEXT_PUBLIC_BETTER_AUTH_URL \
8682
NEXT_PUBLIC_PORTAL_URL=$NEXT_PUBLIC_PORTAL_URL \
8783
NEXT_PUBLIC_POSTHOG_KEY=$NEXT_PUBLIC_POSTHOG_KEY \
8884
NEXT_PUBLIC_POSTHOG_HOST=$NEXT_PUBLIC_POSTHOG_HOST \
8985
NEXT_PUBLIC_IS_DUB_ENABLED=$NEXT_PUBLIC_IS_DUB_ENABLED \
90-
NEXT_PUBLIC_GTM_ID=$NEXT_PUBLIC_GTM_ID \
91-
NEXT_PUBLIC_LINKEDIN_PARTNER_ID=$NEXT_PUBLIC_LINKEDIN_PARTNER_ID \
92-
NEXT_PUBLIC_LINKEDIN_CONVERSION_ID=$NEXT_PUBLIC_LINKEDIN_CONVERSION_ID \
93-
NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL=$NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL \
9486
NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL \
9587
NEXT_TELEMETRY_DISABLED=1 NODE_ENV=production \
9688
NEXT_OUTPUT_STANDALONE=true \
@@ -157,4 +149,4 @@ COPY --from=portal-builder /app/apps/portal/public ./apps/portal/public
157149
EXPOSE 3000
158150
CMD ["node", "apps/portal/server.js"]
159151

160-
# (Trigger.dev hosted; no local runner stage)
152+
# (Trigger.dev hosted; no local runner stage)

apps/app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"@mendable/firecrawl-js": "^1.24.0",
3232
"@monaco-editor/react": "^4.7.0",
3333
"@nangohq/frontend": "^0.53.2",
34-
"@next/third-parties": "^15.3.1",
3534
"@novu/api": "^1.6.0",
3635
"@novu/nextjs": "^3.10.1",
3736
"@number-flow/react": "^0.5.9",

apps/app/src/app/(app)/setup/hooks/useOnboardingForm.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import { useApi } from '@/hooks/use-api';
44
import { trackEvent, trackOnboardingEvent } from '@/utils/tracking';
55
import { zodResolver } from '@hookform/resolvers/zod';
6-
import { sendGTMEvent } from '@next/third-parties/google';
76
import { useAction } from 'next-safe-action/hooks';
8-
import { useRouter, useSearchParams } from 'next/navigation';
7+
import { useSearchParams } from 'next/navigation';
98
import { useEffect, useState } from 'react';
109
import { useForm } from 'react-hook-form';
1110
import { toast } from 'sonner';
@@ -30,7 +29,6 @@ export function useOnboardingForm({
3029
initialData,
3130
currentStep,
3231
}: UseOnboardingFormProps = {}) {
33-
const router = useRouter();
3432
const searchParams = useSearchParams();
3533
const api = useApi();
3634

@@ -114,7 +112,6 @@ export function useOnboardingForm({
114112
onSuccess: async ({ data }) => {
115113
if (data?.success && data?.organizationId) {
116114
setIsFinalizing(true);
117-
sendGTMEvent({ event: 'conversion' });
118115

119116
// Track organization created
120117
trackEvent('organization_created', {
@@ -231,14 +228,14 @@ export function useOnboardingForm({
231228
const handlePrefillAll = async () => {
232229
try {
233230
// Fetch frameworks to get valid IDs
234-
const response = await api.get<{ data: { id: string; visible: boolean }[] }>('/v1/frameworks/available');
231+
const response = await api.get<{ data: { id: string; visible: boolean }[] }>(
232+
'/v1/frameworks/available',
233+
);
235234
const allFrameworks = Array.isArray(response.data?.data) ? response.data.data : [];
236235
const visibleFrameworks = allFrameworks.filter((f) => f.visible);
237-
236+
238237
// Use first two visible frameworks, or just the first one if only one exists
239-
const frameworkIds = visibleFrameworks
240-
.slice(0, 2)
241-
.map((f: { id: string }) => f.id);
238+
const frameworkIds = visibleFrameworks.slice(0, 2).map((f: { id: string }) => f.id);
242239

243240
const prefilledAnswers: Partial<CompanyDetails> = {
244241
frameworkIds: frameworkIds.length > 0 ? frameworkIds : [],

apps/app/src/app/layout.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import '@trycompai/design-system/globals.css';
22

3-
import { LinkedInInsight } from '@/components/tracking/LinkedInInsight';
43
import { env } from '@/env.mjs';
54
import { auth } from '@/utils/auth';
6-
import { cn } from '@trycompai/ui/cn';
75
import { Analytics as DubAnalytics } from '@dub/analytics/react';
6+
import { cn } from '@trycompai/ui/cn';
87
import { Analytics as VercelAnalytics } from '@vercel/analytics/next';
98
import { GeistMono } from 'geist/font/mono';
109
import type { Metadata } from 'next';
@@ -95,19 +94,9 @@ export default async function Layout({ children }: { children: React.ReactNode }
9594
/>
9695
)}
9796
</head>
98-
<body
99-
className={cn(
100-
`${GeistMono.variable} ${font.variable}`,
101-
'antialiased',
102-
)}
103-
>
104-
{env.NEXT_PUBLIC_LINKEDIN_PARTNER_ID && (
105-
<LinkedInInsight partnerId={env.NEXT_PUBLIC_LINKEDIN_PARTNER_ID} />
106-
)}
97+
<body className={cn(`${GeistMono.variable} ${font.variable}`, 'antialiased')}>
10798
<NuqsAdapter>
108-
<Providers session={session}>
109-
{children}
110-
</Providers>
99+
<Providers session={session}>{children}</Providers>
111100
</NuqsAdapter>
112101
<Toaster richColors />
113102
<VercelAnalytics />

apps/app/src/app/providers.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
'use client';
22

3-
import { env } from '@/env.mjs';
4-
import { AnalyticsProvider } from '@trycompai/analytics';
5-
import { Toaster } from '@trycompai/ui/sooner';
6-
import { GoogleTagManager } from '@next/third-parties/google';
73
import {
84
defaultShouldDehydrateQuery,
95
QueryClient,
106
QueryClientProvider,
117
} from '@tanstack/react-query';
8+
import { AnalyticsProvider } from '@trycompai/analytics';
9+
import { Toaster } from '@trycompai/ui/sooner';
1210
import { Session, User } from 'better-auth';
1311
import { ThemeProvider } from 'next-themes';
1412
import type { ReactNode } from 'react';
@@ -72,15 +70,6 @@ export function Providers({ children, session }: ProviderProps) {
7270
disableTransitionOnChange
7371
scriptProps={{ 'data-cfasync': 'false' }}
7472
>
75-
{env.NEXT_PUBLIC_GTM_ID && (
76-
<GoogleTagManager
77-
gtmId={env.NEXT_PUBLIC_GTM_ID}
78-
dataLayer={{
79-
user_id: session?.user?.id ?? '',
80-
user_email: session?.user?.email ?? '',
81-
}}
82-
/>
83-
)}
8473
<AnalyticsProvider
8574
userId={session?.user?.id ?? undefined}
8675
userEmail={session?.user?.email ?? undefined}

apps/app/src/components/tracking/CheckoutCompleteTracking.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client';
22

3-
import { env } from '@/env.mjs';
4-
import { trackEvent, trackLinkedInConversion, trackPurchaseEvent } from '@/utils/tracking';
3+
import { trackEvent, trackPurchaseEvent } from '@/utils/tracking';
54
import { useSearchParams } from 'next/navigation';
65
import { useEffect } from 'react';
76

@@ -16,10 +15,10 @@ export function CheckoutCompleteTracking() {
1615
// Parse value if provided
1716
const transactionValue = value ? parseFloat(value) : undefined;
1817

19-
// Track purchase completion with value
18+
// Product analytics only. Paid-media revenue/signed-deal measurement lives in HubSpot imports.
2019
trackPurchaseEvent('purchase_completed', transactionValue);
2120

22-
// Track specific plan type with enhanced data for Google Ads
21+
// Track specific plan type with enhanced product analytics data
2322
trackEvent('purchase_completed', {
2423
event_category: 'ecommerce',
2524
plan_type: checkoutComplete,
@@ -37,21 +36,6 @@ export function CheckoutCompleteTracking() {
3736
},
3837
],
3938
});
40-
41-
// Send Google Ads specific conversion event if conversion label is configured
42-
if (env.NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL) {
43-
trackEvent('conversion', {
44-
send_to: env.NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL,
45-
value: transactionValue,
46-
currency: 'USD',
47-
transaction_id: `${organizationId}_${Date.now()}`,
48-
});
49-
}
50-
51-
// Track LinkedIn conversion if ID is available
52-
if (env.NEXT_PUBLIC_LINKEDIN_CONVERSION_ID) {
53-
trackLinkedInConversion(env.NEXT_PUBLIC_LINKEDIN_CONVERSION_ID);
54-
}
5539
}
5640
}, [checkoutComplete, organizationId, value]);
5741

apps/app/src/components/tracking/LinkedInInsight.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)