Reporting on a user's total emails per month, broken down by internal or external recipient

2,987 views
Skip to first unread message

Jeffrey Wickersty

unread,
Aug 11, 2021, 9:30:30 AM8/11/21
to GAM for Google Workspace
Hi all,

I know I can use a gam/gamadv command like the following to generate a report of total emails sent and received for a given period of time:

gam report user user <User Email Address> parameters gmail:num_emails_sent,gmail:num_emails_received range -30d -2d todrive

However, is there a way with GAM to find out how many emails were to recipients that are external to our domain?

Thanks!

Jeff

Brian Kim

unread,
Aug 11, 2021, 12:28:26 PM8/11/21
to GAM for Google Workspace
Reports API won't be able to do this. If you had previous set up BigQuery Export for Gmail Logs, you could possibly use that to get that information.

Otherwise, Gmail API with query or Vault is the way to go. For example, to get the message counts for all users sent items (external) in the last month. Vault's count function is probably quicker imo.

gam config auto_batch_min 1 redirect csv ./messagecounts.csv multiprocess all users print messages countsonly query "in:sent -to:*@domain.com newer_than:1m"

Jeffrey Wickersty

unread,
Aug 11, 2021, 2:11:28 PM8/11/21
to GAM for Google Workspace
Thank you very, very much.
Reply all
Reply to author
Forward
0 new messages