Skip to content

Migrate Conversions, Props reports to /query endpoint#6440

Open
apata wants to merge 3 commits into
masterfrom
query/migrate-conversions-props
Open

Migrate Conversions, Props reports to /query endpoint#6440
apata wants to merge 3 commits into
masterfrom
query/migrate-conversions-props

Conversation

@apata

@apata apata commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Changes

Migrates Conversions and Props reports to /query endpoint

Tests

  • Automated tests have been added

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode

@apata apata added the preview label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Preview environment👷🏼‍♀️🏗️
PR-6440

@apata apata force-pushed the query/migrate-conversions-props branch from 2b1a42f to b6ea299 Compare June 9, 2026 10:45
const BAR_COLOR = 'bg-red-50 group-hover/row:bg-red-100'

type ConversionsProps = {
afterFetchData?: (data: QueryApiResponse) => void

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's rename this to onDataReady to be consistent?

Comment on lines +210 to +212
// isPageViewGoal currently has no return statement and resolves to
// `undefined` at runtime; cast preserves the historical truthiness check.
const isPageview = isPageViewGoal(goalName) as unknown as boolean

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since isPageViewGoal never returns anything, we can safely get rid of this const I guess. The !undefined below currently evaluates to true anyway so it's redundant in the && chain.

FTR: I believe the intent was to not switch tab to Mode.PROPS if the goal filter being applied is a pageview goal. Looks like that broke at some point then. Maybe accidentally, but I guess it makes sense to change tab even in this case. The props tab will definitely be more interesting than the single goal item :)

function renderImportedQueryUnsupportedWarning(): ReactNode {
if (mode === Mode.CONVERSIONS) {
return (
<ImportedQueryUnsupportedWarning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (non-blocking): What do you think about renaming this component to FunnelApiImportedWarningBubble? Otherwise we'd have ImportedQueryUnsupportedWarning and ImportedWarningBubble, making it hard to understand how they're different.

When I first introduced the new ImportedWarningBubble component, I was hoping we could use that here too. Now that I've went down a familiar rabbit hole trying to get rid of ImportedDataInView, I've realised that there's no obvious solution on the table for the "Funnels" and "Explore" tabs.

For custom props and conversions however, we could use ImportedWarningBubble. For conversions, it'd only be a matter of passing the whole API response. For props, we'd have to also extend the component with a message? option.

Then the FunnelApiImportedWarningBubble would only depend on importedDataInView and nothing else.

Might be worth adding a module-level comment there too:

Renders an imported warning bubble for the "Funnels" and "Explore" tabs. Currently, while the funnel and exploration queries silently ignore everything related to imports, we still want to let the user know that imports are not included in those reports. Therefore, we rely on Top Stats response to know whether imported data is in range or not, and if it is, we render the warning bubble.

All that said though, probably best to do this separately in a follow-up

import { NonTimeDimension } from '../../stats-query'
import { FilterInfo } from '../../components/drilldown-link'

const BAR_COLOR = 'bg-red-50 group-hover/row:bg-red-100'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we export this from here and use in props.tsx and special-goal-prop-breakdown.tsx too?

)
}

function getGoalsFilterInfo(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to be an exact duplicate of the same function in stats/modals/conversions.tsx. Let's share a single function.

[dashboardState, dimensions]
)

const columnsHiddenForAllNull = useMemo((): Set<Metric> => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very similar to the one in index-breakdown.tsx, with the only exception being the shape of the data. Maybe there's a way to deduplicate it? A hook like useHiddenMetricColumns?

{...props}
barClassName={BAR_COLOR}
text={value}
getFilterInfo={() => ({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use makeGetFilterInfo from stats/modals/props.tsx here to deduplicate?


return (
<div className="w-full" style={{ minHeight: `${MIN_HEIGHT}px` }}>
<IndexBreakdown

@RobertJoonas RobertJoonas Jun 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something we already talked about but leaving a note JIC: Should pass a bigger column width for desktop. Same in special goal prop breakdown.

['visitors', 'desc'],
...dimensions.map((dim): OrderByEntry => [dim, 'asc'])
...dimensions
.filter((dim) => dim !== 'event:goal')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're making sure here that we’re not trying to order by event:goal which is unsupported. This logic is currently duplicated in both index and details breakdowns. Would be nice to define that limitation in a single place, e.g.: reports-config.ts? Either by setting an explicit dimensionOrderBy field for the goals report, or just exporting a const CANNOT_ORDER_BY_DIMENSIONS

return {
dimensions: [`event:props:${propKey}` as NonTimeDimension],
metricsByContext: {
realtimeMetrics: ['visitors', 'events'],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already talked about it but highlighting again JIC: missing conversion rate in realtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants