- 
                Notifications
    You must be signed in to change notification settings 
- Fork 206
feat: add support for funnel reports #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| """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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
| ### Hints for `date_ranges`: | 
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.