Before start connecting you need to create a Google API project that will grant access to Google Sheets from the plugin Advanced Form Integration. Please follow:
1. Go to Google Developer Console and create a New Project
2. Go to the Library menu and search for Google Sheets API, open it, and click ENABLE.
3. Again search for Google Drive API, open it, and click ENABLE.
4. Go to the OAuth consent screen, select External click Create. Put an Application name as you want, select user support email, enter yourdomain.com in Authorized domains, put your email on developer contact email. In scopes add spreadsheet read/write and drive read-only scopes. then click Save. Please set the publishing status as in production, otherwise, you might get a 403 error.
5. Go to Credentials, click CREATE CREDENTIALS, select OAuth client ID, select application type as Web application, click Create, put anything in Name, save https://yourdomain.xxx/wp-json/advancedformintegration/googlesheets in Authorized redirect URIs, click Create.
6. Copy Client ID and Client Secret from the newly created app and save.
7. Click Save & Authorize, if appears App is not verified error click show advanced and then Go to App.
8. The Status field in plugin settings will show Connected once successfully done.
Here is a video tutorial that can help you to understand:
Now start integration
Platform: Select Google Sheets.
Task: Select Add New Row. New section will appear were you can select the spreadsheet, worksheet name and map fields.
Spreadsheet: Select the correct sheet name.
Worksheet: You may have several tabs in the sheet. All names will be automatically populated in the dropdown. Select the correct one.
Map Fields: After selecting the worksheet/tab all table column headers will appear and you will be able to map correct fields. Please note that table titles must be in first row of the sheet. Otherwise AFI plugin can’t recognize the titles.
Error 403: access_denied The developer hasn’t given you access to this app. It’s currently being tested and it hasn’t been verified by Google
Go to Google API projects, select the right project from the upper menu. Then go to OAuth consent screen. Check Publishing status. If it is on testing click the button PUBLISH APP.
Fix Error 403: PUBLISH APP
Spreadsheet/Worksheet list dropdown empty
Two types of authorizations needed for full access. Google Drive access for populating the spreadsheet list. And Google Sheets access for getting the details of a sheet, like tabs list. So please check your Google API Project settings that both Google Drive & Google Sheets permissions were granted (step 2 & 3 above while creating a project).
After I click authorize, the page just reloads and nothing happens.
Please go to the Google App Permissions page and look for a previous authorization for this app and click on REMOVE ACCESS. Then try authorizing again.
After I click authorize, getting a 404 page.
Go to WordPress admin area > Settings > Permalinks. Now select Post name and save the changes. Try authorizing again.
Is there any usage limit?
The plugin itself doesn’t impose any limit. However, Google Sheets API has limits like a maximum of 500 requests per 100 seconds. Please check the Google Sheets Usage Limit page for more details.