From 66f49bab528878bab4e67f48b0f6b3a806df0e63 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 11:37:04 -0300 Subject: [PATCH 1/2] chore(Tracking): Remove LinkedIn from the app Co-Authored-By: Claude Opus 5.5 --- frontend/api/dev-routes.js | 1 - frontend/api/index.js | 6 ------ frontend/common/stores/account-store.js | 6 ------ frontend/common/stores/feature-list-store.ts | 1 - frontend/common/stores/organisation-store.js | 1 - frontend/env/project_prod.js | 1 - frontend/web/index.handlebars | 3 --- frontend/web/project/libs.js | 21 -------------------- 8 files changed, 40 deletions(-) diff --git a/frontend/api/dev-routes.js b/frontend/api/dev-routes.js index 2688b1a9e0e2..fc171066450a 100644 --- a/frontend/api/dev-routes.js +++ b/frontend/api/dev-routes.js @@ -46,7 +46,6 @@ module.exports = function setupRoutes(app) { { name: 'reo', value: process.env.REO_API_KEY }, { name: 'capterraKey', value: process.env.CAPTERRA_API_KEY }, { name: 'hideInviteLinks', value: envToBool('DISABLE_INVITE_LINKS', false) }, - { name: 'linkedinPartnerTracking', value: envToBool('LINKEDIN_PARTNER_TRACKING', false) }, { name: 'useSecureCookies', value: envToBool('USE_SECURE_COOKIES', true) }, { name: 'cookieSameSite', value: process.env.USE_SECURE_COOKIES }, { name: 'cookieAuthEnabled', value: process.env.COOKIE_AUTH_ENABLED }, diff --git a/frontend/api/index.js b/frontend/api/index.js index b55a82a2311a..e2c7d39d502a 100755 --- a/frontend/api/index.js +++ b/frontend/api/index.js @@ -105,10 +105,6 @@ app.get('/config/project-overrides', (req, res) => { name: 'hideInviteLinks', value: envToBool('DISABLE_INVITE_LINKS', false), }, - { - name: 'linkedinPartnerTracking', - value: envToBool('LINKEDIN_PARTNER_TRACKING', false), - }, { name: 'useSecureCookies', value: envToBool('USE_SECURE_COOKIES', true) }, { name: 'cookieSameSite', value: process.env.USE_SECURE_COOKIES }, { name: 'cookieAuthEnabled', value: process.env.COOKIE_AUTH_ENABLED }, @@ -292,10 +288,8 @@ app.post('/api/webflow/webhook', (req, res) => { // Catch all to render index template app.get('/', (req, res) => { - const linkedin = process.env.LINKEDIN || '' return res.render('index', { isDev, - linkedin, }) }) diff --git a/frontend/common/stores/account-store.js b/frontend/common/stores/account-store.js index cb701c588edb..ac2a66c82b13 100644 --- a/frontend/common/stores/account-store.js +++ b/frontend/common/stores/account-store.js @@ -131,12 +131,6 @@ const controller = { }) } } - - if (Project.linkedinConversionId) { - window.lintrk?.('track', { - conversion_id: Project.linkedinConversionId, - }) - } }) }, deleteOrganisation: () => { diff --git a/frontend/common/stores/feature-list-store.ts b/frontend/common/stores/feature-list-store.ts index 4b06187083fa..3c1d58cacad2 100644 --- a/frontend/common/stores/feature-list-store.ts +++ b/frontend/common/stores/feature-list-store.ts @@ -189,7 +189,6 @@ const controller = { }, value: flag.name, }) - window.lintrk?.('track', { conversion_id: 16798354 }) } else { flagsmith.trackEvent('feature_created', { metadata: { diff --git a/frontend/common/stores/organisation-store.js b/frontend/common/stores/organisation-store.js index 9a1b7499ac92..cc1caf8bd3c0 100644 --- a/frontend/common/stores/organisation-store.js +++ b/frontend/common/stores/organisation-store.js @@ -57,7 +57,6 @@ const controller = { .then((res) => createSampleUser(res, envName, project)) }), ).then((res) => { - window.lintrk?.('track', { conversion_id: 16798346 }) project.environments = res store.model.projects = store.model.projects.concat(project) getStore().dispatch(projectService.util.invalidateTags(['Project'])) diff --git a/frontend/env/project_prod.js b/frontend/env/project_prod.js index 8f0dc98013f3..37cc25bedb7c 100644 --- a/frontend/env/project_prod.js +++ b/frontend/env/project_prod.js @@ -44,7 +44,6 @@ const Project = { region: 'eu1', }, - linkedinConversionId: 16798338, // This is used for Sentry tracking maintenance: false, plans: { diff --git a/frontend/web/index.handlebars b/frontend/web/index.handlebars index e1d5ef2be951..9e11d7bce877 100644 --- a/frontend/web/index.handlebars +++ b/frontend/web/index.handlebars @@ -104,7 +104,4 @@ {{/if}} -{{#if linkedin}} - -{{/if}} diff --git a/frontend/web/project/libs.js b/frontend/web/project/libs.js index 8561ff97b7ca..9fc34342ebfe 100644 --- a/frontend/web/project/libs.js +++ b/frontend/web/project/libs.js @@ -63,27 +63,6 @@ if (typeof SENTRY_RELEASE_VERSION !== 'undefined' && Project.sentry && typeof Se }); } -if(Project.linkedinPartnerTracking) { - const _linkedin_partner_id = "5747572"; - window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; - window._linkedin_data_partner_ids.push(_linkedin_partner_id); - (function(l) { - if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])}; - window.lintrk.q=[]} - var s = document.getElementsByTagName("script")[0]; - var b = document.createElement("script"); - b.type = "text/javascript";b.async = true; - b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; - s.parentNode.insertBefore(b, s);})(window.lintrk); - var img = document.createElement("img"); - img.setAttribute("height", "1"); - img.setAttribute("width", "1"); - img.setAttribute("style", "display:none;"); - img.setAttribute("alt", ""); - img.setAttribute("src", "https://px.ads.linkedin.com/collect/?pid=5747572&fmt=gif"); - document.body.appendChild(img); -} - if(Project.hubspot && !disableThirdPartyScripts) { // Must be set before the script loads. The chat widget is loaded by // common/loadChat behind the hubspot_chat flag, not by chatflow targeting. From 06cb4c844b8e0c333fb4e8a586ac3029eddf2967 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 11:47:32 -0300 Subject: [PATCH 2/2] chore(Tracking): Remove Universal Analytics from the app Also stops the GA4 data it forwards. Co-Authored-By: Claude Opus 5.5 --- .../environment-variables.md | 1 - frontend/.eslintrc.js | 1 - frontend/api/dev-routes.js | 1 - frontend/api/index.js | 1 - frontend/global.d.ts | 13 ---------- frontend/web/project/api.ts | 24 +++---------------- frontend/web/project/libs.js | 10 -------- 7 files changed, 3 insertions(+), 48 deletions(-) diff --git a/docs/docs/deployment-self-hosting/core-configuration/environment-variables.md b/docs/docs/deployment-self-hosting/core-configuration/environment-variables.md index abc0cd04c365..8843796ddede 100644 --- a/docs/docs/deployment-self-hosting/core-configuration/environment-variables.md +++ b/docs/docs/deployment-self-hosting/core-configuration/environment-variables.md @@ -86,7 +86,6 @@ relevant section below for more details. `/api/v1/` through to `PROXY_API_URL`. If you are using this, any setting to `FLAGSMITH_API_URL` will be ignored and the browser will use the frontend node server to send API requests. Do not prepend `api/v1/` - it will be added automatically. -- `GOOGLE_ANALYTICS_API_KEY`: Google Analytics key to track API usage. - `FIRST_PROMOTER_ID`: First Promoter ID for checkout affiliates. - `ALLOW_SIGNUPS`: **DEPRECATED** in favour of `PREVENT_SIGNUP` in the API. Determines whether to prevent manual signups without invites. Set it to any value to allow signups. diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index dcfe41e72141..3b451c57fba6 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -161,7 +161,6 @@ module.exports = { 'describe': true, 'em': true, 'flagsmith': true, - 'ga': true, 'heap': true, 'hljs': true, 'hot': true, diff --git a/frontend/api/dev-routes.js b/frontend/api/dev-routes.js index fc171066450a..c51cc55f5744 100644 --- a/frontend/api/dev-routes.js +++ b/frontend/api/dev-routes.js @@ -31,7 +31,6 @@ module.exports = function setupRoutes(app) { { name: 'superUserCreateOnly', value: envToBool('ONLY_SUPERUSERS_CAN_CREATE_ORGANISATIONS', false) }, { name: 'flagsmith', value: process.env.FLAGSMITH_ON_FLAGSMITH_API_KEY }, { name: 'headway', value: process.env.HEADWAY_API_KEY }, - { name: 'ga', value: process.env.GOOGLE_ANALYTICS_API_KEY }, { name: 'sha', value: sha }, { name: 'fpr', value: process.env.FIRST_PROMOTER_ID }, { name: 'sentry', value: process.env.SENTRY_API_KEY }, diff --git a/frontend/api/index.js b/frontend/api/index.js index e2c7d39d502a..847461157d22 100755 --- a/frontend/api/index.js +++ b/frontend/api/index.js @@ -67,7 +67,6 @@ app.get('/config/project-overrides', (req, res) => { }, { name: 'flagsmith', value: process.env.FLAGSMITH_ON_FLAGSMITH_API_KEY }, { name: 'headway', value: process.env.HEADWAY_API_KEY }, - { name: 'ga', value: process.env.GOOGLE_ANALYTICS_API_KEY }, { name: 'sha', value: sha }, { name: 'fpr', value: process.env.FIRST_PROMOTER_ID }, { name: 'sentry', value: process.env.SENTRY_API_KEY }, diff --git a/frontend/global.d.ts b/frontend/global.d.ts index 4b513c366abe..e410ca900bef 100644 --- a/frontend/global.d.ts +++ b/frontend/global.d.ts @@ -10,21 +10,8 @@ export type OpenConfirm = { noText?: string } import { TooltipProps } from './web/components/Tooltip' -declare namespace UniversalAnalytics { - interface PageviewFieldsObject { - hitType: 'pageview' | 'event' - location?: string - page?: string - title?: string - [key: string]: any - } -} export declare const openModal: (name?: string) => Promise declare global { - function ga( - command: 'send', - fields: UniversalAnalytics.PageviewFieldsObject, - ): void const openModal: ( title: ReactNode, body?: ReactNode, diff --git a/frontend/web/project/api.ts b/frontend/web/project/api.ts index 1bfb3593fc42..9567c29f467a 100644 --- a/frontend/web/project/api.ts +++ b/frontend/web/project/api.ts @@ -306,14 +306,6 @@ const API = { 'first_events', )?.catch(() => {}) } - if (Project.ga) { - ga('send', { - eventAction: data.event, - eventCategory: data.category, - eventLabel: data.label, - hitType: 'event', - }) - } if (Project.amplitude) { amplitude.track(data.event, { category: data.category, @@ -325,19 +317,9 @@ const API = { } }, - // `path` overrides the reported location, e.g. for removing - // tokens in URLs - trackPage(title: string, path?: string): void { - if (Project.ga) - ga('send', { - hitType: 'pageview', - location: path - ? `${document.location.origin}${path}` - : document.location.href, - page: path ?? document.location.pathname, - title, - }) - }, + // Page views were only sent to Universal Analytics. Removed with its callers + // in a follow-up. + trackPage(): void {}, trackTraits(traits: Record): void { try { diff --git a/frontend/web/project/libs.js b/frontend/web/project/libs.js index 9fc34342ebfe..f7a099553415 100644 --- a/frontend/web/project/libs.js +++ b/frontend/web/project/libs.js @@ -45,16 +45,6 @@ window.NavLink = NavLink; // Analytics — not loaded in E2E runs, where widgets can overlay the UI const disableThirdPartyScripts = !!window.E2E -if (Project.ga && !disableThirdPartyScripts) { - (function (i, s, o, g, r, a, m) { - i.GoogleAnalyticsObject = r; i[r] = i[r] || function () { - (i[r].q = i[r].q || []).push(arguments); - }, i[r].l = 1 * new Date(); a = s.createElement(o), - m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m); - }(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga')); - ga('create', Project.ga, 'auto'); -} - if (typeof SENTRY_RELEASE_VERSION !== 'undefined' && Project.sentry && typeof Sentry !== 'undefined') { Sentry.init({ dsn: Project.sentry,