Connecting Your Google Service Account

Set up a Google Service Account so BuddyActivity can read and write to your Google Sheets.

BuddyActivity connects to Google Sheets using a Service Account — a special Google account that represents your application rather than a person. This allows your WordPress site to authenticate with Google without requiring anyone to log in manually.

1

Create a Google Cloud Project

  1. 1.Go to the Google Cloud Console.
  2. 2.Click the project dropdown at the top of the page.
  3. 3.Click "New Project".
  4. 4.Enter a descriptive project name (e.g., "My WordPress Site") and click "Create".
  5. 5.Wait for the project to finish creating, then make sure it is selected.
Tip: Use a project name that identifies which website it belongs to, especially if you manage multiple sites.
2

Enable Required APIs

You need to enable both the Google Sheets API and the Google Drive API.

  1. 1.In the Google Cloud Console, click "APIs & Services" → "Library" in the left sidebar.
  2. 2.Search for "Google Sheets API", click on it, and click "Enable".
  3. 3.Go back to the API Library.
  4. 4.Search for "Google Drive API", click on it, and click "Enable".
Warning: Both APIs must be enabled. Without the Google Drive API, the plugin cannot list your available spreadsheets.
3

Create a Service Account

  1. 1.Go to "APIs & Services" → "Credentials".
  2. 2.Click "Create Credentials" → "Service account".
  3. 3.Enter a service account name (e.g., "wordpress-sheets-sync") and an optional description.
  4. 4.Click "Create and Continue".
  5. 5.Skip the optional "Grant access" step by clicking "Continue".
  6. 6.Skip the optional "Grant users access" step by clicking "Done".
Info: A service account has its own email address. You will share your Google Sheets with this email address in a later step.
4

Create and Download the JSON Key

  1. 1.On the Credentials page, find your service account under "Service Accounts" and click on its email.
  2. 2.Go to the "Keys" tab.
  3. 3.Click "Add Key" → "Create new key".
  4. 4.Select "JSON" as the key type and click "Create".
  5. 5.A JSON file will be automatically downloaded to your computer.
Danger: Keep this JSON file secure. It contains your private key. Never share it publicly or commit it to a code repository.

The downloaded file will look like this:

json
{
  "type": "service_account",
  "project_id": "your-project-12345",
  "private_key_id": "abc123...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": "wordpress-sheets-sync@your-project.iam.gserviceaccount.com",
  "client_id": "123456789...",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token"
}
5

Note Your Service Account Email

  1. 1.Open the JSON file you just downloaded.
  2. 2.Find the client_email field.
  3. 3.Copy that email address — it will look like: your-service-name@project-id.iam.gserviceaccount.com.
  4. 4.Keep it handy for the next step.
6

Share Your Google Sheet With the Service Account

  1. 1.Open the Google Sheet you want to connect to BuddyActivity.
  2. 2.Click the "Share" button in the top-right corner.
  3. 3.Paste your service account email address.
  4. 4.Set the permission level to "Editor".
  5. 5.Uncheck "Notify people" (service accounts do not check email).
  6. 6.Click "Share".
Tip: You can share multiple Google Sheets with the same service account. All shared sheets will appear in the plugin's spreadsheet selector.
7

Configure the WordPress Plugin

  1. 1.Open the JSON file you downloaded in Step 4.
  2. 2.Copy the entire contents of the file.
  3. 3.In WordPress admin, go to BuddyActivity → Settings.
  4. 4.Paste the full JSON content into the "Service Account JSON" field.
  5. 5.Click "Save Settings".
  6. 6.Wait for the success confirmation — the plugin will verify your credentials and display all sheets shared with the service account.
Warning: Copy the entire JSON contents including the curly braces. Do not modify or truncate the content.

Troubleshooting Common Issues

"No spreadsheets found" error

  • Make sure you shared your Google Sheet with the service account email.
  • Verify that Google Drive API is enabled in your Google Cloud Console.
  • Check that you are using the correct service account email.

"Invalid JSON" error

  • Make sure you copied the entire contents of the JSON file.
  • Do not modify the JSON content.
  • Ensure there are no extra spaces or characters before or after the JSON.

"Authentication failed" error

  • Verify that Google Sheets API is enabled.
  • Make sure the service account is active.
  • Check if the private key in the JSON file is valid and has not been rotated.

Was this article helpful?

Menu