Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat: Add host filter + path cleaning to page reports (#67188)

Jordan Mryyanc3994e16a917
diff --git a/frontend/src/scenes/web-analytics/PageReports.tsx b/frontend/src/scenes/web-analytics/PageReports.tsx
index 6820751ead54..331987a99541 100644
--- a/frontend/src/scenes/web-analytics/PageReports.tsx
+++ b/frontend/src/scenes/web-analytics/PageReports.tsx
@@ -7,8 +7,9 @@ import { FEATURE_FLAGS } from 'lib/constants'
import { LemonInputSelect } from 'lib/lemon-ui/LemonInputSelect/LemonInputSelect'
import { pageReportsLogic } from './pageReportsLogic'
+import { PathCleaningToggle } from './PathCleaningToggle'
import { Tiles } from './WebAnalyticsDashboard'
-import { WebAnalyticsCompareFilter } from './WebAnalyticsFilters'
+import { WebAnalyticsCompareFilter, WebAnalyticsDomainSelector } from './WebAnalyticsFilters'
function NoUrlSelectedMessage(): JSX.Element {
return (
@@ -28,16 +29,13 @@ function NoUrlSelectedMessage(): JSX.Element {
}
export function PageReportsFilters({ tabs }: { tabs: JSX.Element }): JSX.Element {
- const { pagesUrls, pageUrl, isLoading, dateFilter, pageUrlSearchTerm, featureFlags } = useValues(pageReportsLogic)
- const { setPageUrl, setPageUrlSearchTerm, loadPages, setDates } = useActions(pageReportsLogic)
+ const { pageUrlOptions, pageUrl, isLoading, dateFilter, pageUrlSearchTerm, featureFlags, isPathCleaningEnabled } =
+ useValues(pageReportsLogic)
+ const { setPageUrl, setPageUrlSearchTerm, loadPages, setDates, setIsPathCleaningEnabled } =
+ useActions(pageReportsLogic)
const rankedSearchEnabled = !!featureFlags[FEATURE_FLAGS.PAGE_REPORTS_RANKED_URL_SEARCH]
- const options = pagesUrls.map((option: { url: string }) => ({
- key: option.url,
- label: option.url,
- }))
-
const emptyStateComponent = rankedSearchEnabled ? (
<div className="text-muted-alt px-3 py-2 text-xs">
{pageUrlSearchTerm
@@ -50,10 +48,11 @@ export function PageReportsFilters({ tabs }: { tabs: JSX.Element }): JSX.Element
<FilterBar
top={tabs}
left={
- <div className="flex flex-row gap-2 items-center flex-1 min-w-0 w-full">
+ <div className="flex flex-row flex-wrap gap-2 items-center w-full min-w-0">
<DateFilter dateFrom={dateFilter.dateFrom} dateTo={dateFilter.dateTo} onChange={setDates} />
<WebAnalyticsCompareFilter />
<LemonInputSelect
+ className="flex-1 min-w-0"
allowCustomValues={true}
fullWidth={true}
placeholder="Click or type to see top pages, or paste a URL"
@@ -62,12 +61,14 @@ export function PageReportsFilters({ tabs }: { tabs: JSX.Element }): JSX.Element
mode="single"
value={pageUrl ? [pageUrl] : null}
onChange={(val: string[]) => setPageUrl(val.length > 0 ? val[0] : null)}
- options={options}
+ options={pageUrlOptions}
onInputChange={(val: string) => setPageUrlSearchTerm(val)}
data-attr="page-reports-url-search"
onFocus={() => loadPages('')}
emptyStateComponent={emptyStateComponent}
/>
+ <PathCleaningToggle value={isPathCleaningEnabled} onChange={setIsPathCleaningEnabled} />
+ <WebAnalyticsDomainSelector />
</div>
}
/>
diff --git a/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts b/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts
new file mode 100644
index 000000000000..605c7ee01e06
--- /dev/null
+++ b/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts
@@ -0,0 +1,191 @@
+import { PathCleaningFilter, PropertyOperator } from '~/types'
+
+import { buildPageUrlOptions, cleanPageURLForDisplay, createPageReportsFilters } from './pageReportsLogic'
+
+describe('createPageReportsFilters', () => {
+ const hostFilters = (
+ filters: ReturnType<typeof createPageReportsFilters>
+ ): ReturnType<typeof createPageReportsFilters> => filters.filter((filter) => filter.key === '$host')
+
+ const filterFor = (
+ filters: ReturnType<typeof createPageReportsFilters>,
+ key: string
+ ): ReturnType<typeof createPageReportsFilters>[number] | undefined => filters.find((filter) => filter.key === key)
+
+ test.each([
+ {
+ name: 'full URL with no selected host keeps the URL host and pathname',
+ url: 'https://posthog.com/pricing',
+ selectedHost: null,
+ expectedHostValues: ['posthog.com'],
+ expectKeys: ['$host', '$pathname'],
+ },
+ {
+ name: 'selected host overrides the URL host without duplicating $host',
+ url: 'https://posthog.com/pricing',
+ selectedHost: 'eu.posthog.com',
+ expectedHostValues: ['eu.posthog.com'],
+ expectKeys: ['$host', '$pathname'],
+ },
+ {
+ name: 'unparseable URL with a selected host appends the host filter to the fallback',
+ url: 'not a url',
+ selectedHost: 'posthog.com',
+ expectedHostValues: ['posthog.com'],
+ expectKeys: ['$current_url', '$host'],
+ },
+ {
+ name: 'unparseable URL with no selected host adds no host filter',
+ url: 'not a url',
+ selectedHost: null,
+ expectedHostValues: [],
+ expectKeys: ['$current_url'],
+ },
+ ])('$name', ({ url, selectedHost, expectedHostValues, expectKeys }) => {
+ const filters = createPageReportsFilters(url, true, selectedHost)
+
+ expect(hostFilters(filters).map((filter) => filter.value)).toEqual(expectedHostValues)
+ expect(filters.map((filter) => filter.key).sort()).toEqual([...expectKeys].sort())
+ })
+
+ test.each([
+ {
+ name: 'cleaning off keeps the pathname an exact match',
+ url: 'https://posthog.com/pricing',
+ selectedHost: null,
+ isPathCleaningEnabled: false,
+ expectedPathnameOperator: PropertyOperator.Exact,
+ expectedPathnameValue: '/pricing',
+ expectedHostValue: 'posthog.com',
+ },
+ {
+ name: 'cleaning on switches the pathname to a cleaned-path match',
+ url: 'https://posthog.com/pricing',
+ selectedHost: null,
+ isPathCleaningEnabled: true,
+ expectedPathnameOperator: PropertyOperator.IsCleanedPathExact,
+ expectedPathnameValue: '/pricing',
+ expectedHostValue: 'posthog.com',
+ },
+ {
+ name: 'cleaning on decodes the alias so it survives URL parsing',
+ url: 'hedgebox.net/files/<id>/',
+ selectedHost: null,
+ isPathCleaningEnabled: true,
+ expectedPathnameOperator: PropertyOperator.IsCleanedPathExact,
+ expectedPathnameValue: '/files/<id>/',
+ expectedHostValue: 'hedgebox.net',
+ },
+ {
+ name: 'cleaning on with a selected host cleans the pathname but leaves the host exact',
+ url: 'https://posthog.com/pricing',
+ selectedHost: 'eu.posthog.com',
+ isPathCleaningEnabled: true,
+ expectedPathnameOperator: PropertyOperator.IsCleanedPathExact,
+ expectedPathnameValue: '/pricing',
+ expectedHostValue: 'eu.posthog.com',
+ },
+ ])(
+ '$name',
+ ({
+ url,
+ selectedHost,
+ isPathCleaningEnabled,
+ expectedPathnameOperator,
+ expectedPathnameValue,
+ expectedHostValue,
+ }) => {
+ const filters = createPageReportsFilters(url, true, selectedHost, isPathCleaningEnabled)
+
+ const pathnameFilter = filterFor(filters, '$pathname')
+ expect(pathnameFilter?.operator).toEqual(expectedPathnameOperator)
+ expect(pathnameFilter?.value).toEqual(expectedPathnameValue)
+
+ const hostFilter = filterFor(filters, '$host')
+ expect(hostFilter?.value).toEqual(expectedHostValue)
+ expect(hostFilter?.operator).toEqual(PropertyOperator.Exact)
+ }
+ )
+})
+
+describe('cleanPageURLForDisplay', () => {
+ const idRule: PathCleaningFilter[] = [{ regex: '\\d+', alias: ':id' }]
+
+ test.each([
+ {
+ name: 'no rules returns the URL unchanged',
+ url: 'https://posthog.com/files/123/',
+ filters: [] as PathCleaningFilter[],
+ expected: 'https://posthog.com/files/123/',
+ },
+ {
+ name: 'cleans the pathname and keeps the host',
+ url: 'https://posthog.com/files/123/',
+ filters: idRule,
+ expected: 'posthog.com/files/:id/',
+ },
+ {
+ name: 'cleans a host-less URL',
+ url: 'posthog.com/files/123',
+ filters: idRule,
+ expected: 'posthog.com/files/:id',
+ },
+ {
+ name: 'applies rules in order',
+ url: 'posthog.com/files/123',
+ filters: [
+ { regex: '\\d+', alias: ':id' },
+ { regex: '/files', alias: '/f' },
+ ],
+ expected: 'posthog.com/f/:id',
+ },
+ {
+ name: 'skips invalid regex rules',
+ url: 'posthog.com/files/123',
+ filters: [
+ { regex: '[', alias: 'x' },
+ { regex: '\\d+', alias: ':id' },
+ ],
+ expected: 'posthog.com/files/:id',
+ },
+ ])('$name', ({ url, filters, expected }) => {
+ expect(cleanPageURLForDisplay(url, filters)).toEqual(expected)
+ })
+})
+
+describe('buildPageUrlOptions', () => {
+ const idRule: PathCleaningFilter[] = [{ regex: '\\d+', alias: ':id' }]
+ const urls = (...list: string[]): { url: string }[] => list.map((url) => ({ url }))
+
+ test('passes raw URLs through when cleaning is disabled', () => {
+ expect(buildPageUrlOptions(urls('a.com/p/1', 'a.com/p/2'), null, idRule, false)).toEqual([
+ { key: 'a.com/p/1', label: 'a.com/p/1' },
+ { key: 'a.com/p/2', label: 'a.com/p/2' },
+ ])
+ })
+
+ test('passes raw URLs through when there are no cleaning rules', () => {
+ expect(buildPageUrlOptions(urls('a.com/p/1'), null, [], true)).toEqual([
+ { key: 'a.com/p/1', label: 'a.com/p/1' },
+ ])
+ })
+
+ test('de-duplicates options by their cleaned form, keeping the first raw URL', () => {
+ expect(buildPageUrlOptions(urls('a.com/p/1', 'a.com/p/2', 'a.com/q'), null, idRule, true)).toEqual([
+ { key: 'a.com/p/1', label: 'a.com/p/:id' },
+ { key: 'a.com/q', label: 'a.com/q' },
+ ])
+ })
+
+ test('keeps the selected URL as its cleaned group representative', () => {
+ expect(buildPageUrlOptions(urls('a.com/p/1', 'a.com/p/2'), 'a.com/p/2', idRule, true)).toEqual([
+ { key: 'a.com/p/2', label: 'a.com/p/:id' },
+ ])
+ })
+
+ test('surfaces the selected URL even when it is absent from the loaded page list', () => {
+ expect(buildPageUrlOptions(urls('a.com/p/1'), 'a.com/p/9', idRule, true)).toEqual([
+ { key: 'a.com/p/9', label: 'a.com/p/:id' },
+ ])
+ })
+})
diff --git a/frontend/src/scenes/web-analytics/pageReportsLogic.ts b/frontend/src/scenes/web-analytics/pageReportsLogic.ts
index 1fb8ca0218c0..9630edf5e4a5 100644
--- a/frontend/src/scenes/web-analytics/pageReportsLogic.ts
+++ b/frontend/src/scenes/web-analytics/pageReportsLogic.ts
@@ -4,6 +4,8 @@ import { router } from 'kea-router'
import api from 'lib/api'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { isValidRegexp } from 'lib/utils/regexp'
+import { teamLogic } from 'scenes/teamLogic'
import {
CompareFilter,
@@ -22,9 +24,12 @@ import {
ChartDisplayType,
InsightLogicProps,
IntervalType,
+ PathCleaningFilter,
PropertyFilterType,
PropertyMathType,
PropertyOperator,
+ TeamPublicType,
+ TeamType,
} from '~/types'
import {
@@ -40,16 +45,13 @@ import {
WEB_ANALYTICS_DEFAULT_QUERY_TAGS,
WebAnalyticsTile,
WebTileLayout,
+ eventPropertiesToPathClean,
parseWebAnalyticsURL,
} from './common'
import { PROPERTY_PATHNAME } from './constants'
import type { pageReportsLogicType } from './pageReportsLogicType'
import { webAnalyticsLogic } from './webAnalyticsLogic'
-export interface PageURLSearchResult {
- url: string
-}
-
/**
* Creates property filters for URL matching that handles query parameters consistently
* Always attempts to parse full URLs into host+pathname filters to enable backend optimizations
@@ -57,8 +59,11 @@ export interface PageURLSearchResult {
* @param stripQueryParams Whether to strip query parameters (used as fallback for regex)
* @returns An array of property filters for the URL
*/
+export interface PageURLSearchResult {
+ url: string
+}
+
export function createUrlPropertyFilter(url: string, stripQueryParams: boolean): WebAnalyticsPropertyFilters {
- // Always try to parse as full URL first - this enables pre-aggregated table optimizations on backend
const parsed = parseWebAnalyticsURL(url)
if (parsed.isValid && parsed.host && parsed.pathname) {
@@ -89,11 +94,121 @@ export function createUrlPropertyFilter(url: string, stripQueryParams: boolean):
]
}
+function safeDecode(value: string): string {
+ try {
+ return decodeURIComponent(value)
+ } catch {
+ return value
+ }
+}
+
+export function applyPathCleaningToFilters(
+ filters: WebAnalyticsPropertyFilters,
+ isPathCleaningEnabled: boolean
+): WebAnalyticsPropertyFilters {
+ if (!isPathCleaningEnabled) {
+ return filters
+ }
+ return filters.map((filter) => {
+ if (
+ filter.type === PropertyFilterType.Event &&
+ filter.operator === PropertyOperator.Exact &&
+ typeof filter.key === 'string' &&
+ eventPropertiesToPathClean.has(filter.key)
+ ) {
+ return {
+ ...filter,
+ operator: PropertyOperator.IsCleanedPathExact,
+ // decode because `new URL()` percent-encodes cleaning aliases (`<id>` → `%3Cid%3E`), which never match
+ value: typeof filter.value === 'string' ? safeDecode(filter.value) : filter.value,
+ }
+ }
+ return filter
+ })
+}
+
+export function cleanPathnameForDisplay(pathname: string, filters: PathCleaningFilter[]): string {
+ return filters.reduce((cleaned, filter) => {
+ if (!filter.regex || !isValidRegexp(filter.regex)) {
+ return cleaned
+ }
+ return cleaned.replace(new RegExp(filter.regex, 'gi'), filter.alias ?? '')
+ }, pathname)
+}
+
+export function cleanPageURLForDisplay(url: string, filters: PathCleaningFilter[]): string {
+ if (filters.length === 0) {
+ return url
+ }
+ const parsed = parseWebAnalyticsURL(url)
+ if (parsed.isValid && parsed.pathname) {
+ const cleanedPathname = cleanPathnameForDisplay(parsed.pathname, filters)
+ return parsed.host ? `${parsed.host}${cleanedPathname}` : cleanedPathname
+ }
+ return cleanPathnameForDisplay(url, filters)
+}
+
+export interface PageURLOption {
+ key: string
+ label: string
+}
+
+export function buildPageUrlOptions(
+ pagesUrls: PageURLSearchResult[],
+ pageUrl: string | null,
+ filters: PathCleaningFilter[],
+ isPathCleaningEnabled: boolean
+): PageURLOption[] {
+ if (!isPathCleaningEnabled || filters.length === 0) {
+ return pagesUrls.map(({ url }) => ({ key: url, label: url }))
+ }
+
+ const representativeByCleaned = new Map<string, string>()
+ if (pageUrl) {
+ representativeByCleaned.set(cleanPageURLForDisplay(pageUrl, filters), pageUrl)
+ }
+ for (const { url } of pagesUrls) {
+ const cleaned = cleanPageURLForDisplay(url, filters)
+ if (!representativeByCleaned.has(cleaned)) {
+ representativeByCleaned.set(cleaned, url)
+ }
+ }
+
+ return [...representativeByCleaned.entries()].map(([label, key]) => ({ key, label }))
+}
+
+function createHostFilter(host: string | null): WebAnalyticsPropertyFilters {
+ return host ? [{ type: PropertyFilterType.Event, key: '$host', operator: PropertyOperator.Exact, value: host }] : []
+}
+
+/**
+ * Builds the property filters for a page report: the page URL filter, with the selected host (when
+ * set) taking precedence over the host embedded in the URL. This lets the host dropdown re-scope every
+ * report tile — e.g. comparing the same pathname across different domains — instead of leaving the
+ * tiles pinned to the host baked into the picked URL.
+ */
+export function createPageReportsFilters(
+ url: string,
+ stripQueryParams: boolean,
+ selectedHost: string | null,
+ isPathCleaningEnabled: boolean = false
+): WebAnalyticsPropertyFilters {
+ const filters = createUrlPropertyFilter(url, stripQueryParams)
+
+ // Drop the URL's own host so the explicitly selected host wins, then apply it.
+ const withSelectedHost = selectedHost
+ ? [...filters.filter((filter) => filter.key !== '$host'), ...createHostFilter(selectedHost)]
+ : filters
+
+ return applyPathCleaningToFilters(withSelectedHost, isPathCleaningEnabled)
+}
+
const createTimeOnPageTrendsQuery = (
pathname: string,
filterTestAccounts: boolean,
interval: IntervalType,
- dateRange: { date_from: string | null; date_to: string | null }
+ dateRange: { date_from: string | null; date_to: string | null },
+ isPathCleaningEnabled: boolean
): InsightVizNode<TrendsQuery> => {
return {
kind: NodeKind.InsightVizNode,
@@ -114,8 +229,10 @@ const createTimeOnPageTrendsQuery = (
{
type: PropertyFilterType.Event,
key: '$prev_pageview_pathname',
- operator: PropertyOperator.Exact,
- value: pathname,
+ operator: isPathCleaningEnabled
+ ? PropertyOperator.IsCleanedPathExact
+ : PropertyOperator.Exact,
+ value: isPathCleaningEnabled ? safeDecode(pathname) : pathname,
},
{
type: PropertyFilterType.Event,
@@ -151,12 +268,15 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
'compareFilter',
'webAnalyticsFilters',
'isPathCleaningEnabled',
+ 'selectedHost',
'controls',
],
featureFlagLogic,
['featureFlags'],
+ teamLogic,
+ ['currentTeam'],
],
- actions: [webAnalyticsLogic, ['setDates']],
+ actions: [webAnalyticsLogic, ['setDates', 'setDomainFilter', 'setIsPathCleaningEnabled']],
},
actions: () => ({
@@ -218,7 +338,19 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
date_to: values.dateFilter.dateTo,
}
+ const hostFilter = createHostFilter(values.selectedHost)
+
if (values.featureFlags[FEATURE_FLAGS.PAGE_REPORTS_RANKED_URL_SEARCH]) {
+ const properties: WebAnalyticsPropertyFilters = [...hostFilter]
+ if (searchTerm) {
+ properties.push({
+ type: PropertyFilterType.Event,
+ key: PROPERTY_PATHNAME,
+ operator: PropertyOperator.IContains,
+ value: searchTerm,
+ })
+ }
+
const response = await api.query<WebStatsTableQuery>(
setLatestVersionsOnQuery({
kind: NodeKind.WebStatsTableQuery,
@@ -234,17 +366,9 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
includeBounceRate: true,
useWebAnalyticsPrecompute: values.controls.useWebAnalyticsPrecompute,
dateRange,
- properties: searchTerm
- ? [
- {
- type: PropertyFilterType.Event,
- key: PROPERTY_PATHNAME,
- operator: PropertyOperator.IContains,
- value: searchTerm,
- },
- ]
- : [],
+ properties,
limit: 100,
+ doPathCleaning: values.isPathCleaningEnabled,
tags: WEB_ANALYTICS_DEFAULT_QUERY_TAGS,
})
)
@@ -261,7 +385,7 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
searchTerm: searchTerm,
stripQueryParams: true,
dateRange,
- properties: [],
+ properties: hostFilter,
tags: WEB_ANALYTICS_DEFAULT_QUERY_TAGS,
})
)
@@ -278,6 +402,21 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
(selectors) => [selectors.pagesUrlsLoading, selectors.isInitialLoad],
(pagesUrlsLoading: boolean, isInitialLoad: boolean) => pagesUrlsLoading || isInitialLoad,
],
+ pathCleaningFilters: [
+ (s) => [s.currentTeam],
+ (currentTeam: TeamType | TeamPublicType | null): PathCleaningFilter[] =>
+ (currentTeam && 'path_cleaning_filters' in currentTeam ? currentTeam.path_cleaning_filters : null) ??
+ [],
+ ],
+ pageUrlOptions: [
+ (s) => [s.pagesUrls, s.pageUrl, s.pathCleaningFilters, s.isPathCleaningEnabled],
+ (
+ pagesUrls: PageURLSearchResult[],
+ pageUrl: string | null,
+ pathCleaningFilters: PathCleaningFilter[],
+ isPathCleaningEnabled: boolean
+ ): PageURLOption[] => buildPageUrlOptions(pagesUrls, pageUrl, pathCleaningFilters, isPathCleaningEnabled),
+ ],
stripQueryParams: [() => [], () => true],
queries: [
(s) => [
@@ -288,6 +427,7 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
s.shouldFilterTestAccounts,
s.compareFilter,
s.isPathCleaningEnabled,
+ s.selectedHost,
],
(
webAnalyticsTiles: WebAnalyticsTile[],
@@ -296,7 +436,8 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
dateFilter: typeof webAnalyticsLogic.values.dateFilter,
shouldFilterTestAccounts: boolean,
compareFilter: CompareFilter,
- isPathCleaningEnabled: boolean
+ isPathCleaningEnabled: boolean,
+ selectedHost: string | null
) => {
// If we don't have a pageUrl, return empty queries to rendering problems
if (!pageUrl) {
@@ -324,9 +465,12 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
}
}
- const pageReportsPropertyFilters: WebAnalyticsPropertyFilters = [
- ...createUrlPropertyFilter(pageUrl, stripQueryParams),
- ]
+ const pageReportsPropertyFilters: WebAnalyticsPropertyFilters = createPageReportsFilters(
+ pageUrl,
+ stripQueryParams,
+ selectedHost,
+ isPathCleaningEnabled
+ )
const dateRange = { date_from: dateFilter.dateFrom, date_to: dateFilter.dateTo }
// Helper function to get query from a tile by tab ID
@@ -371,7 +515,7 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
],
},
properties: [
- ...(pageUrl ? createUrlPropertyFilter(pageUrl, stripQueryParams) : []),
+ ...pageReportsPropertyFilters,
{
key: 'event',
value: ['$pageview', '$pageleave'],
@@ -412,7 +556,8 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
parsedUrl.pathname,
shouldFilterTestAccounts,
dateFilter.interval,
- dateRange
+ dateRange,
+ isPathCleaningEnabled
)
: undefined
@@ -459,8 +604,14 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
}),
],
combinedMetricsQuery: [
- (s) => [s.pageUrl, s.stripQueryParams, s.shouldFilterTestAccounts],
- (pageUrl: string | null, stripQueryParams: boolean, shouldFilterTestAccounts: boolean) =>
+ (s) => [s.pageUrl, s.stripQueryParams, s.shouldFilterTestAccounts, s.selectedHost, s.isPathCleaningEnabled],
+ (
+ pageUrl: string | null,
+ stripQueryParams: boolean,
+ shouldFilterTestAccounts: boolean,
+ selectedHost: string | null,
+ isPathCleaningEnabled: boolean
+ ) =>
(dateFilter: typeof webAnalyticsLogic.values.dateFilter): InsightVizNode<TrendsQuery> => ({
kind: NodeKind.InsightVizNode,
source: {
@@ -495,7 +646,9 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
showLegend: true,
},
filterTestAccounts: shouldFilterTestAccounts,
- properties: pageUrl ? createUrlPropertyFilter(pageUrl, stripQueryParams) : [],
+ properties: pageUrl
+ ? createPageReportsFilters(pageUrl, stripQueryParams, selectedHost, isPathCleaningEnabled)
+ : [],
tags: WEB_ANALYTICS_DEFAULT_QUERY_TAGS,
},
embedded: true,
@@ -790,6 +943,12 @@ export const pageReportsLogic = kea<pageReportsLogicType>({
actions.loadPages(values.pageUrlSearchTerm)
}
},
+ setDomainFilter: () => {
+ actions.loadPages(values.pageUrlSearchTerm)
+ },
+ setIsPathCleaningEnabled: () => {
+ actions.loadPages(values.pageUrlSearchTerm)
+ },
}),
afterMount: ({ actions }: { actions: pageReportsLogicType['actions'] }) => {