domainwidedelegation.comGet it set up

Use casesReporting and data

Generating weekly status documents from Admin SDK activity

Automate weekly status reports by extracting user activity via the Admin SDK Reports API and formatting results into Google Sheets for consistent, up-to-date visibility.

Who it is forWorkspace automation engineers maintaining cross-tenant reporting.
APIsAdmin SDK, Sheets API
Typical scopesadmin.reports.audit.readonly, admin.directory.user.readonly

The problem

Weekly status documents are often generated from stale Sheets exports or missed logins, so managers act on incomplete activity snapshots—especially when user accounts are moved or renamed mid-project, breaking manual processes. Manual compilation is error-prone, and changes to user accounts mid-week (renames, suspensions, deletions) often result in missing or duplicated entries. This leads to wasted time chasing down the real activity trail and undermines trust in the data.

How it works

  1. Configure a service account with domain-wide delegation and the required Admin SDK scopes.
  2. Enumerate active users using the Admin SDK Directory API (users.list), filtering out suspended and recently deleted accounts.
  3. Query each user's activity using the Reports API (activities.list) for the relevant application and date range.
  4. Aggregate results and write them into a structured template in Google Sheets via the Sheets API, linking each row to the corresponding user.
  5. Trigger the workflow using a scheduled Cloud Function or Apps Script, and log document links by week for auditability.

What changes

Status documents reflect actual user activity for the week, and new or renamed accounts are automatically included. Manual errors and omissions are reduced, and managers get a consistent, up-to-date view.

The trap in this one. The Reports API (activities.list) will return empty arrays for users who have been suspended or deleted—even if they were active earlier in the week—without any error or warning. If your script does not explicitly check for missing or zero-activity users, these accounts will be silently omitted from the status document, causing managers to overlook inactivity, recent departures, or policy violations. This is especially easy to miss when users are renamed or moved between OUs, as the API responses do not indicate previous identities.

Watch it explained

How to track and manage edits in Google Workspace documents” — Damson Cloud on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Does the Reports API include activity for suspended or recently deleted users?

No, the API will return empty results for these users, even if they were active earlier in the reporting period. You need to cross-reference user status from the Directory API.

How do I ensure renamed users are not double-counted or missed?

Always use the immutable user ID from the Directory API rather than email addresses as your key. This prevents accidental duplication or omission.

Can this workflow handle multiple domains or tenants?

Yes, but you must authenticate against each tenant separately and maintain separate status documents and service account delegations.

Want this built?

This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.

Talk to us Or read the setup guide

Related use cases

Send a daily digest that catches problems early

One scheduled email that checks the things that fail quietly and reports only what changed.

Run automation from a spreadsheet non-engineers can edit

Keep rules, templates and routing in a Sheet so the operations team changes behaviour without a deploy.

Reconcile records between two systems automatically

Compare what your tracking sheet says against what the source system says, and report the differences.