Customer enquiries arrive at all hours, and keeping track of them in an overflowing email inbox gets frustrating very quickly. Messages get marked as read by mistake, customer details sit scattered across different threads, and someone on your team has to manually copy rows of names and phone numbers into a spreadsheet at the end of the week. That manual routine wastes time and often leads to simple typing mistakes.
Connecting your website forms directly to Google Sheets solves this problem by dropping submissions straight into organized rows. To make that connection secure, Google requires a server-to-server authentication method instead of your personal password. This is where a Google service account comes into play, giving your site permission to update your spreadsheet in the background.
Why You Need a Google Service Account
When you log into Google on your laptop, you use your email address and password, often followed by a two-step confirmation on your phone. A website server running WordPress cannot open a browser prompt or verify a text message code every time someone fills out a contact form. It needs a secure, automated way to prove its identity directly to Google.
A Google service account acts as a dedicated identity for your website rather than an actual person. Google gives this account its own unique email address and a downloadable credentials file known as a service account JSON key. Your WordPress site uses this key behind the scenes to request temporary access tokens whenever a visitor submits an entry.
Our plugin uses this method for its Google Sheets integration feature. Instead of exposing your personal Google account credentials on your server, you simply grant your custom service account access to only the specific spreadsheets you choose.
What to Know Before You Start
Setting up Google Cloud tools can feel intimidating if you have never opened their developer console before. The interface contains hundreds of cloud tools aimed at software engineers, but you only need to touch a tiny fraction of them. Taking your time and following the steps in order will get the job done in about ten minutes.
It helps to understand the boundaries of what this setup does. Diviniket WP Forms sends submission data out to Google Sheets when an entry is successfully submitted, but it is not a two-way synchronization tool. If you edit a cell in your spreadsheet later, those changes will not travel backward into your WordPress database.
The plugin also requires an active internet connection between your web server and Google's servers. If your hosting environment completely blocks outbound API calls, the connection will fail until your hosting provider opens those outbound ports. Keeping these limits in mind saves confusion down the road.
Step-by-Step Google Service Account Setup
To begin your google service account setup, open the Google Cloud Console in your browser while logged into your primary Google account. Follow these steps carefully to create your credentials and obtain the needed keys.
- Create a new Google Cloud project: At the top of the Google Cloud Console, click the project dropdown and select the option to create a new project. Give your project an easily recognizable name, such as your website title, and click Create.
- Enable the Google Sheets API: Navigate to the APIs and Services library inside your project. Search specifically for the Google Sheets API, select it from the search results, and click the Enable button so your project has permission to talk to spreadsheets.
- Go to Credentials: In the left-hand navigation menu of APIs and Services, click on Credentials. Look near the top of the screen and choose the option to create credentials, then select Service Account from the dropdown menu.
- Enter service account details: Give your service account a clear name, such as "WordPress Forms Sync". Google will automatically generate a unique email address based on that name. Click Create and Continue, then finish the creation prompt.
- Generate your service account JSON key: In your list of service accounts, click on the email address of the account you just created. Switch to the Keys tab, click the Add Key dropdown, and choose Create new key. Select JSON as the key type and click Create. Your browser will immediately download a .json file to your computer. Keep this file safe on your computer because Google does not keep a backup copy for you to download again.
- Copy the service account email: Copy the full email address assigned to your new service account. It usually looks like an address ending in
iam.gserviceaccount.com.
Once you finish those steps, your credentials file is ready on your machine. You now have the exact authentication file needed by the plugin to communicate with Google.
Sharing Your Google Sheet with the Service Account
Creating the service account does not give it automatic permission to open every file in your Google Drive. For safety reasons, a new service account has access to absolutely nothing until you manually share a file with it. This security design prevents external integrations from seeing files they have no business touching.
Open the Google Sheet you want to use for your form entries, or create a brand new spreadsheet. In the top row, type the column headers that match the details you intend to collect, such as Name, Email, Phone, and Message. Having clear headers helps organize the incoming rows as entries arrive.
Click the green Share button in the top-right corner of your spreadsheet. Paste the service account email address you copied earlier into the sharing box, set its permission role to Editor, uncheck the notify box if prompted, and click Share. Your service account now has direct write access to that specific document.
Connecting the JSON Key to Diviniket WP Forms
With your key downloaded and your spreadsheet shared, you can return to your WordPress administration dashboard to finish the setup. Navigate to the Divine Forms section to enter your integration credentials.
Open the plugin settings where the Google service-account credentials are managed. You will need to open the service account JSON key file you downloaded earlier using a plain text editor, copy the entire block of text inside it, and paste it into the credentials field in the plugin settings. Once saved, the plugin can request OAuth access tokens directly from Google whenever it needs to send data.
Next, configure your spreadsheet connection by providing the spreadsheet ID and the exact sheet name. The spreadsheet ID is the long string of letters and numbers located between the slashes in your sheet's browser URL. Diviniket WP Forms can request spreadsheet metadata, including the spreadsheet ID, sheet name, and column headers, allowing you to validate that the connection works properly before sending live traffic.
Building and Publishing Your Form
Once your credentials pass validation, you can attach the connection to any form built with our visual form builder. Open an existing form or create a new one inside Divine Forms, configure your desired fields, and make sure synchronization is turned on for that specific form.
You can adjust the appearance of your form using documented style controls such as form width, alignment, background opacity, input text color, and placeholder colors to match your site layout. When you are happy with the layout, save your settings and copy the generated shortcode.
Paste the shortcode into any standard WordPress block, page builder widget, or content area where you want the form to appear. The shortcode looks like this:
[divismfo_form id="123"]
Please remember that 123 is only an example ID. You must replace it with the specific ID assigned to the form you created in your dashboard.
Testing the Connection and Form Submissions
Never assume an API connection works without testing it yourself on the front end of your site. Open the page containing your published form in an incognito window and submit a realistic test enquiry with a name, email address, and note.
After clicking submit, check two places. First, log into WordPress and look under Divine Forms > All Entries. Your submission should appear in the entry list because Diviniket WP Forms stores submissions directly in plugin-owned database tables for safekeeping. Second, switch over to your Google Sheet and verify that a new row has appeared beneath your matching column headers.
If you have enabled file uploads on your form, submit a test file as well. The plugin records upload references with entries and handles those upload references during synchronization so you can review submitted attachments alongside the rest of the entry details.
Troubleshooting Common Google Sheets API Issues
If your test entry appears in WordPress under Divine Forms > All Entries but never arrives in your spreadsheet, the issue is almost always a permission or configuration mismatch. The most common error is forgetting to share the spreadsheet with the exact service account email address, which causes Google to block the entry with a permission error.
Another frequent problem involves the Google Sheets API itself. If you skipped step two of the walkthrough, your project cannot interact with the service even if your JSON key is authentic. Return to the Google Cloud Console and verify that the API status says Enabled.
If your forms fail to submit entirely on the front end, check your anti-spam settings. When using built-in options or third-party tools detailed on our spam protection feature page, missing API keys or failed verification challenges can stop form submissions before they ever reach the database or Google Sheets. The plugin also includes debug logging capabilities to help administrators record and diagnose underlying communication issues.
FAQ
What is a service account JSON key?
A service account JSON key is a text file generated by Google Cloud containing your private authorization keys. The plugin uses this file to authenticate directly with Google APIs without needing your personal login password.
Can I edit rows in Google Sheets and sync them back to WordPress?
No, the integration operates in one direction only. Form submissions travel from your WordPress website to your Google Sheet, but manual edits made inside the spreadsheet will never update your WordPress database tables.
Why does Google say permission denied when the form submits?
This almost always means the target spreadsheet has not been shared with your service account email. You must open your spreadsheet, click Share, and grant Editor permissions to the unique service account address generated in your Google Cloud Console.
Do I have to pay Google to use the Google Sheets API?
Google Cloud offers free tier allocations for standard API usage, which is typically plenty for normal business contact forms. You will need a Google account to create the project, but regular small-business usage falls well within standard limits.
If you want visual walkthroughs of form setup and spreadsheet connections, take a look at our guides on the Diviniket YouTube channel, or connect with me directly through my Aditya Singh LinkedIn profile if you have technical questions about building forms.
