From 2fbd96d81ad6d0308c41dee5288942deca9ddde6 Mon Sep 17 00:00:00 2001 From: Jay Hodgson Date: Mon, 28 Aug 2023 11:38:10 -0700 Subject: [PATCH] PORTALS-2789 --- apps/portals/src/ComponentRenderer.tsx | 12 +++++++++++- apps/portals/src/types/portal-util-types.ts | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/portals/src/ComponentRenderer.tsx b/apps/portals/src/ComponentRenderer.tsx index 8fa7bfadae..18cd8b4c78 100644 --- a/apps/portals/src/ComponentRenderer.tsx +++ b/apps/portals/src/ComponentRenderer.tsx @@ -5,6 +5,14 @@ import { scrollToWithOffset } from './utils' import { SynapseComponent } from './SynapseComponent' import Layout from './portal-components/Layout' +const ignoreSearchParamsSet: Set = new Set([ + 'utm_source', + 'utm_campaign', + 'utm_medium', + 'utm_term', + 'utm_content', +]) + export function ComponentRenderer(props: { config: SynapseConfig }) { const { containerClassName, @@ -23,7 +31,9 @@ export function ComponentRenderer(props: { config: SynapseConfig }) { // https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams -- needs polyfill for ie11 const searchParams = new URLSearchParams(search) searchParams.forEach((value, key) => { - searchParamsProps[key] = value + if (!ignoreSearchParamsSet.has(key)) { + searchParamsProps[key] = value + } }) } const scrollToRef = React.useRef(null) diff --git a/apps/portals/src/types/portal-util-types.ts b/apps/portals/src/types/portal-util-types.ts index 5e273bd810..14ce54b948 100644 --- a/apps/portals/src/types/portal-util-types.ts +++ b/apps/portals/src/types/portal-util-types.ts @@ -47,7 +47,6 @@ export type DetailsPageContent = export type DetailsPageProps = DetailsPageContent & { showMenu?: boolean // default to true - /** Note, to exclude from processing, use the suffix "NotAQueryFilterKey" */ searchParams?: { [index: string]: string }