0

Google Admin SDK used to have the "Google Docs" User Metrics for reporting. With it we were able to fetch the property "docs:num_spreadsheets" to get the number of spreadsheets owned by the each user. The Google docs metrics are now being deprecated, replaced by Google Drive metrics. However I don't any way to get the number of spreadsheets of a user. I can get the number of spreadsheets created by a user during a certain period (which period exactly, I couldn't figure out) but not the total number of Spreadsheets owned by them. In this page it's written that drive:num_owned_google_spreadsheets_delta replaces the deprecated docs:num_spreadsheets but these are not the same metrics. Any idea on how to address that? Thanks a lot, Rafael

Rafael
  • 11
  • 3
  • I think the [update](https://developers.google.com/admin-sdk/reports/v1/updated-drive-metrics#comparison-changes) is to make the metrics to have greater visibility into file sharing both inside and outside the domain, as well as details on user adoption of Google Drive, Docs, Sheets, and Slides (reason why the result is not the same). I would suggest to [report on the Issue tracker](https://issuetracker.google.com/issues/new?component=191635&template=823904), they can explain a much better definition and suggestion regarding the metrics migration from your old metric to the new metric. – Mr.Rebot Jun 02 '17 at 16:52

1 Answers1

0

As an alternative to the Admin SDK metrics, using the Drive API and generating the metrics user by user may be an option for you.

If so, in summary the pseudocode is: using a Service Account to impersonate each user and get an OAuth2 token , call the Drive REST API files.list method with a query (&q=...) of all files of mimetype of application/vnd.google-apps.spreadsheet and the user's email in owners. The length of the result set's files.files array is the count of the files (the metric) you want.

Peter
  • 5,501
  • 2
  • 26
  • 42