Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Keep <gclid> medium

Blue Mouseffb40c232d68
diff --git a/backend/apps/cloud/src/analytics/utils/clickIdSources.ts b/backend/apps/cloud/src/analytics/utils/clickIdSources.ts
index 921ea8d23..6b267e99c 100644
--- a/backend/apps/cloud/src/analytics/utils/clickIdSources.ts
+++ b/backend/apps/cloud/src/analytics/utils/clickIdSources.ts
@@ -115,12 +115,6 @@ const CLICK_ID_MAP: Record<string, ClickIdMapping> = {
*/
const CLICK_ID_KEYS = Object.keys(CLICK_ID_MAP)
-/**
- * Placeholder value the JS tracker historically sent in the `me` field
- * when only a `gclid` was detected on the client. We rewrite it here.
- */
-const LEGACY_GCLID_PLACEHOLDER = '<gclid>'
-
/**
* Pulls the URL search string out of a `pg` value the tracker sent.
*
@@ -182,15 +176,6 @@ export const enrichTrafficSource = <T extends TrafficSourceFields>(
): T => {
if (!payload) return payload
- // 1. Rewrite the legacy `<gclid>` placeholder the JS tracker emits.
- if (payload.me === LEGACY_GCLID_PLACEHOLDER) {
- const gclidMapping = CLICK_ID_MAP.gclid
- payload.me = gclidMapping.medium
- if (!payload.so) payload.so = gclidMapping.source
- if (!payload.ref) payload.ref = gclidMapping.ref
- }
-
- // 2. Parse the page URL search string for any known click IDs.
const search = extractSearchString(payload.pg)
const mapping = findClickIdMapping(search)
if (mapping) {
diff --git a/backend/apps/community/src/analytics/utils/clickIdSources.ts b/backend/apps/community/src/analytics/utils/clickIdSources.ts
index 921ea8d23..6b267e99c 100644
--- a/backend/apps/community/src/analytics/utils/clickIdSources.ts
+++ b/backend/apps/community/src/analytics/utils/clickIdSources.ts
@@ -115,12 +115,6 @@ const CLICK_ID_MAP: Record<string, ClickIdMapping> = {
*/
const CLICK_ID_KEYS = Object.keys(CLICK_ID_MAP)
-/**
- * Placeholder value the JS tracker historically sent in the `me` field
- * when only a `gclid` was detected on the client. We rewrite it here.
- */
-const LEGACY_GCLID_PLACEHOLDER = '<gclid>'
-
/**
* Pulls the URL search string out of a `pg` value the tracker sent.
*
@@ -182,15 +176,6 @@ export const enrichTrafficSource = <T extends TrafficSourceFields>(
): T => {
if (!payload) return payload
- // 1. Rewrite the legacy `<gclid>` placeholder the JS tracker emits.
- if (payload.me === LEGACY_GCLID_PLACEHOLDER) {
- const gclidMapping = CLICK_ID_MAP.gclid
- payload.me = gclidMapping.medium
- if (!payload.so) payload.so = gclidMapping.source
- if (!payload.ref) payload.ref = gclidMapping.ref
- }
-
- // 2. Parse the page URL search string for any known click IDs.
const search = extractSearchString(payload.pg)
const mapping = findClickIdMapping(search)
if (mapping) {