Support filtering by standard dimensions on all query tools - #2
Merged
Conversation
The query tools could only filter by page (event-level) and custom event properties, so a session-level question like visits per utm_campaign could not be scoped to the campaigns in question: the page filter forces event-level metrics, and utm dimensions had no filter at all. dimension_filters accepts any standard dimension with is / is_not / contains / contains_not, AND-combined with the existing filters. visit:* filters combine with session metrics, so visits can now be segmented directly. Verified against the live site: get_breakdown on visit:utm_campaign with a contains filter returns per-campaign visit counts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
dimension_filtersparameter toget_timeseries,get_breakdown,get_conversions, andcompare_periods: filter by any standard dimension withis/is_not/contains/contains_not, AND-combined with the existingpage/goal/property_filters.Why: the tools could only filter by page (event-level) and custom properties, so session metrics could not be scoped to a dimension value — e.g.
visitsperutm_campaignfor one campaign family was inexpressible, since the page filter rules out session metrics and utm dimensions had no filter at all.visit:*filters combine with session metrics, so this closes that gap; server instructions and README now point clients at it.Verified end-to-end against the live site:
get_breakdownonvisit:utm_campaignwith acontainsfilter returns per-campaign visit counts through the built STDIO server.Worker deploy stays a manual follow-up after merge (
pnpm deploy); running MCP sessions pick the new parameter up on restart.