feat: add support for funnel reports#54
feat: add support for funnel reports#54cagnusmarlsen wants to merge 7 commits intogoogleanalytics:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
8becde3 to
b46f025
Compare
b46f025 to
0db3192
Compare
jradcliff
left a comment
There was a problem hiding this comment.
Thank you so much for this PR! I added a few comments and suggestions.
- Josh, Google Analytics team
| """Run a Google Analytics Data API funnel report. | ||
|
|
There was a problem hiding this comment.
| """Run a Google Analytics Data API funnel report. | |
| """Run a Google Analytics Data API funnel report. | |
| See the funnel report guide at | |
| https://developers.google.com/analytics/devguides/reporting/data/v1/funnels | |
| for details and examples. | |
| """ | ||
|
|
||
|
|
||
| def _run_funnel_report_description() -> str: |
There was a problem hiding this comment.
Could you move this file into a funnel.py file, similar to how we separate out runReport into core.py, run_realtime_report into realtime.py, and get_custom_dimensions_and_metrics, etc. into metadata.py?
| Example: | ||
| [ | ||
| { | ||
| "name": "Page View", | ||
| "filter_expression": { | ||
| "funnel_field_filter": { | ||
| "field_name": "eventName", | ||
| "string_filter": { | ||
| "match_type": "EXACT", | ||
| "value": "page_view" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "name": "Sign Up", | ||
| "event": "sign_up" | ||
| } | ||
| ] |
There was a problem hiding this comment.
Please move the JSON examples into separate methods that you call here, similar to what we're doing with date range hints, etc. for runReport:
This offers a few advantages:
- It keeps this docstring reasonably short.
- In the methods that return JSON, you can use the client library to generate the JSON so you know that it's well-formed. This will also make maintenance easier if the API objects evolve and change.
|
Hi Josh, |
This PR aims to add support for generating funnel reports using the Google Analytics MCP server. It adds a
run_funnel_reporttool that uses the runFunnelReport method to generate funnel reports based on user queries.