18F / analytics-reporter-api

The Analytics API maintains the schema for the database that the Analytics Reporter writes to.
Other
6 stars 3 forks source link

Download report isn't filtered by domain #265

Closed s-agar closed 1 month ago

s-agar commented 1 month ago

The download report from the domain endpoint should, based on my understanding, only return items that have been downloaded from a specific domain, but the domain filter doesn't seem to be working. For example, the API request https://api.gsa.gov/analytics/dap/v2.0.0/reports/download/data?api_key=DEMO_KEY1 returns: [ { "id": 13551354, "date": "2024-08-06", "report_name": "download", "report_agency": null, "page": "www.uscis.gov/i-9", "file_name": "/sites/default/files/document/forms/i-9.pdf", "page_title": "Employment Eligibility Verification | USCIS", "event_label": "file_download", "total_events": 11684 }, { "id": 13551355, "date": "2024-08-06", "report_name": "download", "report_agency": null, "page": "www.ssa.gov/number-card/replace-card", "file_name": "/forms/ss-5.pdf", "page_title": "Replace Social Security card | SSA", "event_label": "file_download", "total_events": 8763 },....

But the API request https://api.gsa.gov/analytics/dap/v2.0.0/domain/www.gsa.gov/reports/download/data?api_key=DEMO_KEY1 returns the same thing: [ { "id": 13551354, "date": "2024-08-06", "report_name": "download", "report_agency": null, "page": "www.uscis.gov/i-9", "file_name": "/sites/default/files/document/forms/i-9.pdf", "page_title": "Employment Eligibility Verification | USCIS", "event_label": "file_download", "total_events": 11684 }, { "id": 13551355, "date": "2024-08-06", "report_name": "download", "report_agency": null, "page": "www.ssa.gov/number-card/replace-card", "file_name": "/forms/ss-5.pdf", "page_title": "Replace Social Security card | SSA", "event_label": "file_download", "total_events": 8763 },...

levinmr commented 1 month ago

Thanks for this report. I will look into the issue and find a resolution

levinmr commented 1 month ago

This was indeed a bug. A fix was implemented and the scenario is covered by tests now. Please retry your API request and you will see the expected data now.