-
Navigate to the Gmail setup console in Google Workspace admin: https://admin.google.com/ac/apps/gmail/setup
-
Hover over Email Logs in BigQuery and click the pencil icon. In the section that appears, select the Enable checkbox and type a Description. Select the same project that the service account belongs to from the previous steps.
-
Type gmail_logs_dataset as the name for the new BigQuery dataset and click SAVE.
-
From the IAM console in the project where the service account was created, click the pencil icon and add the role BigQuery Job User to the service account.
-
Search for and add BigQuery Job User and click SAVE.
-
Navigate to BigQuery in the Google Cloud console: https://console.cloud.google.com/bigquery and find the gmail_logs_dataset. Open the menu on the right and click Open.
-
Default retention is set to 60 days, but we recommend changing that to 30 days. From the dataset details, click EDIT DETAILS.
-
Type the length of time to retain the log tables and click SAVE.
-
Click SHARING and select Permissions.
-
Add the service account under New principals and select the role BigQuery Data Viewer. Click SAVE to close the panel.

Comments
0 comments
Article is closed for comments.