Skip to content

Commit c02e06d

Browse files
authored
chore(analytics): remove Freebuff ad tracking and the Beluga short-link rewrite (#9974)
* chore(analytics): remove Freebuff ad tracking and the Beluga short-link rewrite * fix(consent): delete the retired Freebuff click-id cookie for returning visitors
1 parent 755dee5 commit c02e06d

14 files changed

Lines changed: 33 additions & 208 deletions

File tree

‎apps/sim/app/(auth)/signup/signup-form.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Turnstile, type TurnstileInstance } from '@marsidev/react-turnstile'
55
import { createLogger } from '@sim/logger'
66
import { useRouter, useSearchParams } from 'next/navigation'
77
import { usePostHog } from 'posthog-js/react'
8-
import { trackFreebuffConversion } from '@/lib/analytics/freebuff'
98
import { trackGoogleEvent } from '@/lib/analytics/google'
109
import { client, useSession } from '@/lib/auth/client'
1110
import { DISPOSABLE_EMAIL_ERROR_CODE, DISPOSABLE_EMAIL_MESSAGE } from '@/lib/auth/constants'
@@ -112,7 +111,7 @@ function SignupFormContent({
112111
const searchParams = useSearchParams()
113112
const { refetch: refetchSession } = useSession()
114113
const posthog = usePostHog()
115-
const { measurement, marketing } = useTrackingConsent()
114+
const { measurement } = useTrackingConsent()
116115
useCaptureWhenReady('signup_page_viewed', {})
117116
const [isLoading, setIsLoading] = useState(false)
118117

@@ -352,7 +351,6 @@ function SignupFormContent({
352351
}
353352

354353
if (measurement) trackGoogleEvent('sign_up', { method: 'email' })
355-
if (marketing) trackFreebuffConversion('signup_completed', response.data.user.id)
356354

357355
try {
358356
await refetchSession()

‎apps/sim/app/(landing)/cookie-policy/cookie-policy-content.tsx‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const COOKIE_POLICY_CONFIG: LegalPageConfig = {
4444
title: 'Cookie Policy',
4545
description:
4646
'What cookies Sim sets, why, how long they last, and how to change your choice at any time.',
47-
lastUpdated: 'October 13, 2026',
47+
lastUpdated: 'November 12, 2026',
4848
intro: [
4949
{
5050
kind: 'paragraph',
@@ -238,12 +238,6 @@ export const COOKIE_POLICY_CONFIG: LegalPageConfig = {
238238
],
239239
['personalization_id', 'X (Twitter)', 'Personalizes the ads shown on X.', '13 months'],
240240
['muc_ads', 'X (Twitter)', 'Measures ad conversions across X domains.', '13 months'],
241-
[
242-
'bfcid',
243-
'Freebuff',
244-
'Stores the click identifier from a Freebuff ad that brought you to sim.ai, so a sign-up can be credited to that ad. Deleted if you withdraw Marketing consent.',
245-
'30 days',
246-
],
247241
]),
248242
],
249243
},
@@ -280,8 +274,7 @@ export const COOKIE_POLICY_CONFIG: LegalPageConfig = {
280274
</ProseLink>
281275
, <ProseLink href='https://adssettings.google.com'>Google Ads</ProseLink>,{' '}
282276
<ProseLink href='https://x.com/settings/privacy_and_safety'>X (Twitter)</ProseLink>,
283-
and <ProseLink href='https://posthog.com/privacy'>PostHog</ProseLink>. For Freebuff,{' '}
284-
{CHANGE_CHOICES} to withdraw Marketing consent.
277+
and <ProseLink href='https://posthog.com/privacy'>PostHog</ProseLink>.
285278
</>
286279
),
287280
},
@@ -303,7 +296,6 @@ export const COOKIE_POLICY_CONFIG: LegalPageConfig = {
303296
<ProseLink href='https://policies.google.com/technologies/cookies'>Google</ProseLink>{' '}
304297
(Analytics and Ads),{' '}
305298
<ProseLink href='https://x.com/en/privacy'>X (Twitter)</ProseLink>,{' '}
306-
<ProseLink href='https://freebuff.com/privacy-policy'>Freebuff</ProseLink>,{' '}
307299
<ProseLink href='https://ahrefs.com/legal/privacy-policy'>Ahrefs</ProseLink>,{' '}
308300
<ProseLink href='https://posthog.com/privacy'>PostHog</ProseLink>, and{' '}
309301
<ProseLink href='https://www.cloudflare.com/privacypolicy/'>Cloudflare</ProseLink>.

‎apps/sim/app/(landing)/privacy/privacy-content.tsx‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function richText(content: string): ReactNode {
4444
export const PRIVACY_CONFIG: LegalPageConfig = {
4545
title: 'Privacy Policy',
4646
description: 'Sim Studio, Inc. · Operating the Sim platform (sim.ai)',
47-
lastUpdated: 'November 4, 2026',
47+
lastUpdated: 'November 12, 2026',
4848
intro: [
4949
{
5050
kind: 'paragraph',
@@ -263,7 +263,7 @@ export const PRIVACY_CONFIG: LegalPageConfig = {
263263
],
264264
[
265265
'Behavioral remarketing',
266-
'Cookie and pixel identifiers, ad click identifiers, browser and Device data, campaign attribution, website interaction data, and, for Freebuff sign-up conversions, a pseudonymous Sim Account identifier and the sign-up time',
266+
'Cookie and pixel identifiers, ad click identifiers, browser and Device data, campaign attribution, and website interaction data',
267267
'Consent — Article 6(1)(a)',
268268
'Marketing cookies and ad personalization require Marketing consent. Google Ads may load earlier with ad storage denied and send limited cookieless consent signals. Consent may be changed or withdrawn through the cookie preferences link.',
269269
],
@@ -577,7 +577,7 @@ export const PRIVACY_CONFIG: LegalPageConfig = {
577577
{
578578
kind: 'paragraph',
579579
content: richText(
580-
'Sim advertises through Google Ads, X, and Freebuff, and measures which ads lead to sign-ups and demo bookings. These services use non-essential Cookies, pixels, and similar technologies. Marketing Cookies and ad personalization are enabled only after You consent to the Marketing category in the cookie banner.'
580+
'Sim advertises through Google Ads and X, and measures which ads lead to sign-ups and demo bookings. These services use non-essential Cookies, pixels, and similar technologies. Marketing Cookies and ad personalization are enabled only after You consent to the Marketing category in the cookie banner.'
581581
),
582582
},
583583
{
@@ -592,12 +592,6 @@ export const PRIVACY_CONFIG: LegalPageConfig = {
592592
"**X.** The X pixel loads on Sim's marketing pages only after Marketing consent. It reports page views and demo bookings."
593593
),
594594
},
595-
{
596-
kind: 'paragraph',
597-
content: richText(
598-
'**Freebuff.** After Marketing consent, the Freebuff tag stores the click identifier from a Freebuff ad. When You sign up, Sim sends Freebuff that click identifier, the event type, a pseudonymous Sim Account identifier, and the sign-up time so the sign-up can be credited to the ad. Sim does not send Your name or email address.'
599-
),
600-
},
601595
{
602596
kind: 'paragraph',
603597
content: richText(
@@ -621,9 +615,6 @@ export const PRIVACY_CONFIG: LegalPageConfig = {
621615
richText(
622616
'X: [Personalization and data settings](https://x.com/settings/privacy_and_safety)'
623617
),
624-
richText(
625-
'Freebuff: withdraw Marketing consent through the cookie preferences link; Sim then deletes the Freebuff click identifier cookie'
626-
),
627618
],
628619
},
629620
],
@@ -987,7 +978,7 @@ export const PRIVACY_CONFIG: LegalPageConfig = {
987978
{
988979
kind: 'paragraph',
989980
content: richText(
990-
'We do not sell Personal Information for money. When Marketing Cookies are enabled, Sim makes identifiers and internet activity on sim.ai available to Google, X, and Freebuff for advertising and ad measurement. This includes cookie and click identifiers, pages visited, and conversion events. California law may treat this as a "sale" or "sharing" of Personal Information. You may opt out at any time through the cookie preferences link, by sending a Global Privacy Control signal, or by emailing privacy@sim.ai. Sim does not knowingly sell or share the Personal Information of consumers under 16.'
981+
'We do not sell Personal Information for money. When Marketing Cookies are enabled, Sim makes identifiers and internet activity on sim.ai available to Google and X for advertising and ad measurement. This includes cookie and click identifiers, pages visited, and conversion events. California law may treat this as a "sale" or "sharing" of Personal Information. You may opt out at any time through the cookie preferences link, by sending a Global Privacy Control signal, or by emailing privacy@sim.ai. Sim does not knowingly sell or share the Personal Information of consumers under 16.'
991982
),
992983
},
993984
{ kind: 'subheading', text: 'Global Privacy Control' },

‎apps/sim/app/_shell/consent/consent-provider.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { TrackingConsentProvider } from '@/lib/consent/tracking-consent'
55
import { AttributionCookieGuard } from '@/app/_shell/consent/attribution-cookie-guard'
66
import { ConsentBanner } from '@/app/_shell/consent/consent-banner'
77
import { ConsentStoreProvider } from '@/app/_shell/consent/consent-store-provider'
8-
import { FreebuffClickIdGuard } from '@/app/_shell/consent/freebuff-click-id-guard'
98
import { GoogleAnalyticsPageViewTracker } from '@/app/_shell/consent/google-analytics-page-view-tracker'
9+
import { RetiredCookieCleanup } from '@/app/_shell/consent/retired-cookie-cleanup'
1010

1111
interface ConsentProviderProps {
1212
children: ReactNode
@@ -24,8 +24,8 @@ export function ConsentProvider({ children }: ConsentProviderProps) {
2424
<TrackingConsentProvider>
2525
{children}
2626
<GoogleAnalyticsPageViewTracker />
27-
<FreebuffClickIdGuard />
2827
<AttributionCookieGuard />
28+
<RetiredCookieCleanup />
2929
<ConsentBanner />
3030
</TrackingConsentProvider>
3131
</ConsentStoreProvider>

‎apps/sim/app/_shell/consent/freebuff-click-id-guard.tsx‎

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use client'
2+
3+
import { useEffect } from 'react'
4+
5+
/**
6+
* Cookies a removed integration may have left in returning browsers. Nothing
7+
* reads them any more, so they are deleted whatever the visitor's consent:
8+
* keeping an unused advertising identifier serves no one. `bfcid` lives at most
9+
* 30 days, so this list can be emptied once that window has passed.
10+
*/
11+
const RETIRED_COOKIES = ['bfcid'] as const
12+
13+
/** Deletes every retired cookie present in this browser, once per page load. */
14+
export function RetiredCookieCleanup() {
15+
useEffect(() => {
16+
for (const name of RETIRED_COOKIES) {
17+
if (document.cookie.includes(`${name}=`)) {
18+
document.cookie = `${name}=; Max-Age=0; Path=/; SameSite=Lax`
19+
}
20+
}
21+
}, [])
22+
23+
return null
24+
}

‎apps/sim/lib/analytics/attribution.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const CLICK_ID_PARAMETERS = [
4949
'ttclid',
5050
'twclid',
5151
'rdt_cid',
52-
'bfcid',
5352
] as const
5453

5554
/**

‎apps/sim/lib/analytics/freebuff.server.ts‎

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

‎apps/sim/lib/analytics/freebuff.ts‎

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

‎apps/sim/lib/auth/auth.ts‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ import {
3636
renderWelcomeEmail,
3737
} from '@/components/emails'
3838
import { readAttributionProperties } from '@/lib/analytics/attribution'
39-
import { FREEBUFF_CLICK_ID_COOKIE } from '@/lib/analytics/freebuff'
40-
import { reportFreebuffConversion } from '@/lib/analytics/freebuff.server'
4139
import { getAccessControlConfig, isEmailBlockedByAccessControl } from '@/lib/auth/access-control'
4240
import { enqueueAdminRemovedChatCleanup } from '@/lib/auth/admin-removal-chat-cleanup'
4341
import { holdAdminRemovalStops, stopAdminRemovedRuns } from '@/lib/auth/admin-removal-stops'
@@ -373,23 +371,6 @@ export const auth = betterAuth({
373371
userId: user.id,
374372
})
375373

376-
/**
377-
* Only the marketing-consent-gated Freebuff tag writes the `bfcid`
378-
* cookie, and `FreebuffClickIdGuard` deletes it once marketing consent
379-
* is withdrawn or expires. Not awaited: the postback
380-
* retries on its own and must never delay signup. The browser tag
381-
* reports the same `eventId` on email signup and Freebuff dedupes.
382-
*/
383-
const freebuffClickId = context?.getCookie(FREEBUFF_CLICK_ID_COOKIE)
384-
if (freebuffClickId) {
385-
void reportFreebuffConversion({
386-
clickId: freebuffClickId,
387-
eventType: 'signup_completed',
388-
eventId: user.id,
389-
occurredAt: user.createdAt,
390-
})
391-
}
392-
393374
try {
394375
PlatformEvents.userSignedUp({
395376
userId: user.id,

0 commit comments

Comments
 (0)