How to connect Google sheet in WordPress using Wpforms plugin addon

How to connect Google sheets in WordPress using Wpforms plugin addon?

Once you have a website and need to export data in a professional way, so connecting google sheets to WordPress is a great option to manage your clients, leads, and your company’s online sales. This a great option if you build an online store or courses for remote learning and more. There are several ways to do that but in this article, we are exploring the spreadsheets connection using the WpForms plugin

It’s essential that you install and activate WPForms on your WordPress site before you can get started. You’ll also need a Google account if you don’t have one.

Apply Settings for Google Sheets integration

You can install and activate the Google Sheets add-on once you’ve installed WPForms and verified your license.

Once you’ve installed the Google Sheets addon, you’ll need to access the integration settings. Click on the Integrations tab in WPForms » Settings in the WordPress dashboard

Settings for Google Sheets integration
Source wpforms.com

Connect WPForms to Google Sheets

  1. Click Add New Account to connect WPForms to your Google account.
  2. WPForms will then redirect you to a Google authentication page where you’ll need to choose a Google account.
  3. Once you’ve chosen a Google account, click the Allow button to let WPForms access your account.
  4. Now when you return to WPForms » Settings » Integrations, you should see the green Connected status along with your connection details.
  5. Start by enabling Advanced Mode in your Google Sheets integration settings.
  6. The Google Cloud Platform will now show you additional settings.
Connect WPForms to Google Sheets
Source wpforms.com

This step will be skipped for now since you’ll need to sign up for the Google Cloud Platform first. You’ll need to access your WPForms settings later, so we recommend keeping them open in a separate browser tab while you build your application.

Create a new project

  1. Click APIs & Services once you’re logged in to Google Cloud Platform.
  2. Click the dropdown menu for projects.
  3. An overlay will appear showing your projects. Just click NEW PROJECT.
  4. Next, give the project a name. Use a name that helps you remember what you’re doing with the project; however, you can use whatever you want.
  5. Click CREATE when you’re done adding a name.
  6. When you’re done creating your project, click the project dropdown again.
  7. Click on the new project name in the overlay.
create a new project
Source wpforms.com

Set up Google APIs

After you’ve created your project, it’s time to enable Google APIs.

  1. Click Library on the left side menu to get started.
  2. Go to the API Library and enable 2 APIs: Google Drive API and Google Sheets API.
  3. Search for “Google Drive API” in the search bar.
  4. Click ENABLE once you’ve found the Google Drive API.
  5. Go back to Google’s API library and type “Google Sheets API” in the search box.
  6. Click ENABLE after finding the Google Sheets API.
Setting up Google APIs
Source wpforms.com

Select user types

  • In the left side menu, click the OAuth consent screen after you’ve enabled APIs.
  • Select a User Type for your application on the next screen. Depending on who you’d like to share your app with, you can select Internal or External.

Let’s pick External for our example. Click the CREATE button after making your selection.

Select user types
Source wpforms.com

Register your app

When you choose a User Type for your app, you’ll be redirected to a registration page. Registering your app involves a few steps, which we’ll cover below.

Add app info

Users will know who you are and how to contact you if you add information about your app.

Make sure you fill out the App name and User support email fields.

register your app
Source wpforms.com

Set up an app domain

The Authorized domains section is under the App domain section.

Click ADD DOMAIN. Your domain should be wpforms.com in the Authorized domain 1 field.

Set up an app domain
Source wpforms.com

Add Contact info for developers

  • Fill out the Developer contact information section with your preferred email address. If your project changes, Google’ll contact you on that email.
  • To move on to the next step, click SAVE AND CONTINUE.
Add Contact info for developers
Source wpforms.com

Add scopes

  • Click ADD OR REMOVE SCOPES on the next screen.
  • Click on Enter property name or value in the side modal that appears.
  • Go ahead and search for each of these:

https://www.googleapis.com/auth/userinfo.email

https://www.googleapis.com/auth/userinfo.profile

https://www.googleapis.com/auth/drive.metadata.readonly

https://www.googleapis.com/auth/spreadsheets

Add Scopes
Source wpforms.com
    • Click the checkboxes on the left to enable each of the above scopes.
    • Click UPDATE at the bottom of the screen once you’ve enabled the required scopes.
    • Return to the Scopes screen to see and manage your enabled scopes. Save your changes by clicking SAVE AND CONTINUE.

    Add test users

    Users won’t be able to interact with your app until Google verifies it. You can, however, let specific users test your app before it’s verified. We don’t need this step for our setup, so let’s go ahead and click SAVE AND CONTINUE.

    Add Test Users
    Source wpforms.com

    Review your App Registration

    On the Summary screen, you’ll review your configuration after app registration. At the bottom of the screen, click BACK TO DASHBOARD if everything looks right.

    Publish your app

    After you’ve registered your app, you’ll need to publish it.

    1. Click PUBLISH APP from the Oauth consent screen.
    2. Once you click the button, a modal will appear with some further steps for Google’s app verification.
    3. Then click CONFIRM.
    publish your app
    Source wpforms.com

    Create Application Credentials

    You’ll need credentials for your application next. Click Credentials on the left side menu.

    1. Then click OAuth client ID.
    2. Click the Application type dropdown and choose Web application.
    3. In the Name field, give your Oauth 2.0 client a name. You can name it whatever you want since it won’t be seen by end users.
    4. Click ADD URI in the Authorized redirect URIs section.
    5. Copy the first Callback URL from your WPForms integration settings by clicking the copy icon.
    6. Copy the Callback URL and paste it into the URIs 1 field in your Google application settings.
    7. You can add a second URI after that by clicking ADD URI again.
    8. Click the copy icon next to the 2nd Callback URL in your WPForms settings.
    9. Go back to your Google settings and paste the 2nd Callback URL in the URIs 2 field.
    10. Then click CREATE.
    11. Your OAuth credentials will appear in a modal window. Click the copy icon to copy the Client ID.
    12. Next, go to your WPForms integration settings and paste the Client ID there.
    13. Go back to your Google application settings and copy the Client Secret.
    14. Paste the Client Secret into the Google Client Secret field in your WPForms integration settings.
    Create Application Credentials
    Source wpforms.com

    Get Connected to Google sheets

    Let’s complete the connection now that you have your Client ID and Client Secret.

    1. Go to Google Sheets and click Connect.
    2. After that, you’ll be redirected to Google’s authentication page. Your Google account needs to be granted access here.
    3. You can see, edit, create, and delete all your Google Sheets spreadsheets once you’ve selected a Google account.
    4. To complete the connection, click Continue.
    5. You should now see the green Connected status and your connection details under WPForms » Settings » Integrations.
    Get Connected to Google sheets
    Source wpforms.com

    Integrate your form with Google Sheets

    The next step is to add a Google Sheets integration to your form now that you’ve successfully connected WPForms to your Google account.

    1. Open the form builder by creating a new form or editing an existing one.
    2. Go to Settings » Google Sheets and click Add New Connection after you’ve accessed the form builder.
    3. Your connection nickname will appear in an overlay. The nickname won’t be visible to your users, so you can use whatever you want.
    4. Click OK when you’re done adding a nickname.

    We’ll cover additional settings after you add a connection nickname.

    Integrate your form with Google Sheets
    Source wpforms.com

    Configure your connection

    1. Select a spreadsheet from the Spreadsheet dropdown.
    2. Using the dropdown, you can create a new spreadsheet or choose an existing one from your Google account.
    3. Search your Google account for a specific spreadsheet you’ve created.
    4. Using the Create a New Spreadsheet option, we’ll create a new spreadsheet.
    5. Select a spreadsheet to see additional settings. To help you keep track of your spreadsheet, we recommend adding a name to the Spreadsheet Name and Sheet Name fields.
    Configure your connection
    Source wpforms.com

    Access Spreadsheet From Form Builder

    In your connection settings, you’ll see a link icon under Spreadsheet when you connect your form to a Google spreadsheet.

    Click the link icon to open your Google spreadsheet.

    Start Google Sheets mapping

    You’ll see two columns for mapping your form fields to your spreadsheet under the Field Mapping option.

    • WPForms maps the Entry ID to Column A by default.
    • A link will appear in Column A when the form submission is added to your spreadsheet. Click the link to go to the individual entry page.
    • You can map form data to a new column by clicking the Column Name dropdown.
    • Select a form field you want to map to the column in your Google spreadsheet. Click the Form Field Value dropdown and select the form field you want to use.
    • Now we can see the names of people who submit our form in our Google spreadsheet.
    Start Google Sheets mapping
    Source wpforms.com

    Add Custom value

    You can use a Smart Tag or Google Sheets formula instead of selecting a field from your form to map to your spreadsheet.

    • Select Custom Value from the Form Field Value dropdown.
    • You’ll see a new field where you can put your custom value.
    • Click the Smart Tag if you want to use a Smart Tag for the custom value.
    • Then you’ll see a list of Smart Tags. We’ll pick the Entry Date Smart Tag in our example so we can see when the form was submitted.
    • In our Google spreadsheet, we’ll see when a user submits our form.
    • Make sure you save your form once you’re done configuring your connection settings.
    add Custom value
    Source wpforms.com
    WP Q and A
    Eng.M.Thatwart is a developer and author at wpqanda, who is passionate about WordPress, digital marketing, and website builders. He enjoys sharing his knowledge through his writings.