Hi everyone, I am wondering if you are able to help me with the below:
What I’m trying to achieve
I need a reliable way to count how many times our hosted feature service datasets have been downloaded by clients. By “download” I mean actions such as:
Using the Item details → Export Data options (Shapefile/FGDB/CSV/GeoJSON, etc.)
Creating replicas via FeatureServer /createReplica (offline/FGDB pulls)
Open Data / Hub dataset downloads
Direct FeatureServer /query calls that return a file (e.g., f=csv, f=geojson, f=xlsx, etc.)
Ultimately I’d like per-item totals over a date range (and, ideally, a breakdown by day and/or actor).
What I’ve tried so far
Item → Usage tab
This seems to report requests, not true downloads, so it doesn’t meet the requirement.
Org activity (Portal History) via ArcGIS API for Python
I’m pulling …/portals/{portalId}/history and filtering events where the request/path indicates:
/content/items/{id}/export (exports)
FeatureServer/createReplica (replicas)
I also experimented with heuristics to catch other flows:
Open Data / Hub URLs containing /download or /api/downloads
FeatureServer /query requests where f is csv|geojson|kml|xlsx|xls
/content/items/{id}/data?...download=1
However, I’m still not confident I’m catching all download routes consistently, and some events don’t include the itemId—only the service URL—so attribution back to the item can be fuzzy.
Organisation reports
The standard Activity/Usage reports I can access don’t appear to expose a dedicated “download count” metric per item.
Questions:
Is there an official / supported way in ArcGIS Online to count dataset downloads for a hosted feature service (not just request counts)?
In Portal History, are there specific event types/fields Esri recommends keying off that reliably correspond to a download across all common flows (Export Data, createReplica, Hub download, /data with download=1, /query with file formats)?
Any pitfalls or gotchas (e.g., Map Viewer or Dashboards “download” features that actually use client-side queries and won’t show up as exports/replicas)?
What are the retention limits for the activity history relevant to this (so we understand how far back we can report)?
If an event only logs the service URL (no itemId), what’s the best practice to attribute it back to the correct item (especially for views vs parent services)?
If we’re using ArcGIS Hub, is there a built-in, trustworthy content download metric we should be using instead for datasets exposed via Hub/Open Data?
Environment
ArcGIS Online (hosted)
I’m an org admin (have access to org activity)
ArcGIS API for Python 2.x on Windows
Items: hosted Feature Service / Feature Layer (hosted) and Feature Layer View
Hi @_Ali
ArcGIS Online does not currently offer a dedicated, supported metric for dataset downloads across all flows. The Usage tab and Activity Reports focus on general access and views, not file-based exports or replicas.
Some gotchas to be aware off
Map Viewer & Dashboards often use query requests with f=json , which are not downloads.
• Client-side exports (e.g., CSV from a table widget) may not trigger server-side export events.
• Feature Layer Views complicate attribution—events may log the view’s URL, not the parent item.
To mitigate this:
• Maintain a lookup table of service URLs → item IDs.
• Use relatedItems() to trace views back to their source layers.
Data Retention I think is 90days of logs I think (open to correction on this)
With Hub you can use the Hub API to query download events. Monitor /api/downloads and /download paths in Portal History, adding a 3rd party like Google Analytics might help more with more details
Data download settings—ArcGIS Hub | Documentation
There are some great questions you have an perhaps they could be fed back through the ideas for considerations in the future for the software.
I hope the above helps in some way.
Thank you so much @DanielFox1 .