Skip to main content

Set Up an Email Service Account in Google G-Suite (Gmail)

  • Updated

Context

Connect to the email service account to authenticate all email addresses under the same domain. This allows Demandbase to monitor emails and calendars for account meetings and communications. See Understanding Email Service Accounts.

The steps include:

  1. Set Up Your Google Cloud Platform (GCP) Organization
  2. Create a Google Cloud Project for Demandbase
  3. Enable API for Gmail and Calendar
  4. Create a Service Account
  5. Enable G-Suite Domain-wide Delegation
  6. Grant permissions to the Service Account in G-Suite
  7. Add the Service Account to Demandbase

Prerequisites/Preparation

You must have Admin privileges or be assigned to a permission set with the required Demandbase settings access.

The Email Service Account feature must be enabled by Demandbase. Contact Demandbase Support for assistance. 

Steps

1. Set Up Your Google Cloud Platform (GCP) Organization

a. If you are a G-Suite or Cloud identity customer, an Organization resource is provided to you automatically.

b. The G-Suite or Cloud Identity super administrators are the first users who can access the organization upon creation.

2. Create a Google Cloud Project for Demandbase

a. Go to the Manage Resources page in the Cloud Console.

b. Select Organization in the drop-down list at the top of the page and select the organization you want to create a project for.

c. Click Create Project.

d. In the New Project window, enter a project name (Example: Demandbase Service Account) and select a billing account.

e. When you're finished entering the project details, click Create.

3. Enable API for Gmail and Calendar

a. Go to the Google Cloud API Dashboard page. Make sure the project (Example: Demandbase Service Account) is selected in the drop-down list at the top of the page.

b. Click Enable APIs and Services.

c. Search for Gmail and click the Gmail API from the search results.

d. Click Enable to enable the Gmail API for this project.

e. Click the back arrow next to the API Library.

f. Search for Calendar and click Google Calendar API from the search results.

g. Click Enable to enable the Google Calendar API for this project.

4. Create a Service Account

a. Go to the Service Accounts page. Make sure the project (Example: Demandbase Service Account) is selected in the drop-down list at the top of the page.

b. Click Create Service Account.

c. Enter the details for the Service Account and click Create.
Service Account Name: Example: Demandbase Service Account
Service Account Description: Service account to sync emails and calendar with Demandbase.

d. For service account permissions select Project > Viewer and click Continue.

e. Generate a key for the service account.
- Click Create Key.
- Select P12 for the key type and click Create.
- This generates and download a key file. Be sure to keep the file to use in Step 7.

f. Click Done.

g. Make note of the email address associated with the new service account to use in Step 7.

5. Enable G-Suite Domain-wide Delegation

a. Go to the Service Accounts page. Make sure the project (Example: Demandbase Service Account) is selected in the drop-down at the top of the page.

b. Click the service account created in step 4. (Example: Demandbase Service Account).

c. Make note of the Unique ID to use in Step 6.

6. Grant Permissions to the Service Account in G-Suite

a. Go to the G-Suite Admin Portal and log in.

b. Click Security.

c. Click API Controls.

d. Click Manage Domain Wide Delegation.

e. Click Add New

f. Client Name: Unique ID from Step 5c.

g. Add One or more API Scopes in OAuth Scopes (comma delimited):
- https://www.googleapis.com/auth/calendar.events.readonly
- https://www.googleapis.com/auth/calendar.readonly
- https://www.googleapis.com/auth/gmail.readonly

h. Click Authorize.

7. Add the Service Account to Demandbase

a. From the left navigation bar, go to Settings_N.png Settings > Platform > Email Service Account.

b. Click Enable Service Account.

c. Enter the Service Account Email from step 4g.

d. Add the Key from Step 4e. 

e. Click Connect.

Was this article helpful?

3 out of 3 found this helpful