Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Hide UTM filters

Tim Wilsond259cf098da3
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/page-client.tsx
index b936f568d9..7c473221e7 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/page-client.tsx
@@ -61,6 +61,7 @@ export function ProgramAnalyticsPageClient() {
queryString,
selectedTab: event,
},
+ hideUTM: true,
});
return (
diff --git a/apps/web/ui/analytics/use-analytics-filters.tsx b/apps/web/ui/analytics/use-analytics-filters.tsx
index 0cf59fd66c..a1fe8fbf18 100644
--- a/apps/web/ui/analytics/use-analytics-filters.tsx
+++ b/apps/web/ui/analytics/use-analytics-filters.tsx
@@ -86,6 +86,7 @@ export function useAnalyticsFilters({
partnerPage,
dashboardProps,
context,
+ hideUTM = false,
}: {
partnerPage?: boolean;
dashboardProps?: AnalyticsDashboardProps;
@@ -93,6 +94,7 @@ export function useAnalyticsFilters({
ContextType<typeof AnalyticsContext>,
"baseApiPath" | "queryString" | "selectedTab" | "requiresUpgrade"
>;
+ hideUTM?: boolean;
} = {}) {
const { slug, programSlug } = useParams();
const { plan } = useWorkspace();
@@ -315,6 +317,7 @@ export function useAnalyticsFilters({
cacheOnly: !isRequested("utm_content"),
context,
});
+
const utmData = {
utm_source: utmSources,
utm_medium: utmMediums,
@@ -741,22 +744,24 @@ export function useAnalyticsFilters({
right: nFormatter(count, { full: true }),
})) ?? null,
},
- ...UTM_PARAMETERS.filter(({ key }) => key !== "ref").map(
- ({ key, label, icon: Icon }) => ({
- key,
- icon: Icon,
- label: `UTM ${label}`,
- getOptionIcon: (value) => (
- <Icon display={value} className="h-4 w-4" />
- ),
- options:
- utmData[key]?.map((dt) => ({
- value: dt[key],
- label: dt[key],
- right: nFormatter(dt.count, { full: true }),
- })) ?? null,
- }),
- ),
+ ...(hideUTM
+ ? []
+ : UTM_PARAMETERS.filter(({ key }) => key !== "ref").map(
+ ({ key, label, icon: Icon }) => ({
+ key,
+ icon: Icon,
+ label: `UTM ${label}`,
+ getOptionIcon: (value) => (
+ <Icon display={value} className="h-4 w-4" />
+ ),
+ options:
+ utmData[key]?.map((dt) => ({
+ value: dt[key],
+ label: dt[key],
+ right: nFormatter(dt.count, { full: true }),
+ })) ?? null,
+ }),
+ )),
],
[
dashboardProps,