How to get AI Assist to create leads via Google Forms
The instructions below are for desktops and laptops only.
You can get tawk.to’s AI Assist to create leads from chat conversations using Google Forms.
In this guide, we’ll show you how to integrate AI Assist with Google Forms to make this happen.
Note:
AI Assist integrations are only available with the Growth, Business, and Enterprise plans.
You’ll need a Google account to access Google Forms, API, and related services.
This integration requires coding knowledge. If you’re unfamiliar with coding, we recommend getting a developer’s help. For more information, visit our developer portal.
Examples of this integration is available in our public GitHub repository for your reference.
You’ll need a Google Form containing the fields you want AI Assist to fill up. It can contain any number of fields like name, email, phone number, etc.
Follow these steps create a form and script:
1. In Google Drive, click New.
2. Select Google Forms.
3. After adding the relevant fields to the form, click the button with the 3 dots and select Script Editor.
4. The Apps Script console will open in a new tab. Enter a script in Code.gs to describe the methods to query your sheet. You may copy the script in this example.
5. Click Deploy > New deployment.
6. Click the gear icon next to Select type and choose Web app.
7. Enter the Description. Set Execute as to Me. This gives your script access to your sheet.
Set Who has access to Anyone. This allows AI Assist to query your sheet using your script.
Then, click Deploy.
8. Copy and save the Web App URL. You’ll need it for the next section.
Note: A new URL is generated with each deployment.
You’ll need an API specifications file, like a YAML file, that defines the interaction between AI Assist and your Google Sheet and script.
You may copy the specs in this example. Ensure to:
Replace the servers.urls value with the Web App URL copied from the Apps Script above.
Remove /exec from the end of the URL.
Modify relevant parameters to fit your needs. For more information on customizing the specs, click here.
You can edit and test your API specifications using an online editor like Swagger.
Copy and save your raw file’s URL. You’ll need it for the next section.
The integration name
The title in your specifications will appear as the integration name on your tawk.to dashboard.
For example:
This is how it’ll appear on your dashboard:
If you have multiple API integrations, give each one a descriptive name so it’s easy to find.
The operation name
AI Assist is designed to understand the context of the inquiry and use the relevant operationId in your API schema. In this example, the operation name is submitForm.Note: You’ll need a paid AI Assist plan to perform this integration.
2. On your dashboard, select the property for which you want to set up the integration. Hover over the property name to ensure you’ve selected the correct one.
3. Go to Add-ons.
4. Under AI Assist, click Settings.
5. Select your AI agent.
7. Under Tools, click + Add.
8. Click Add tool.
9. Enter your specification file’s URL in Schema File URL.
10. Leave API Base URL blank and set Authentication method to No Auth. Then, click Save.
Follow these steps to update the Base Prompt with specific instructions for AI Assist:
1. Go to the Base Prompt.
2. Enter instructions to train AI Assist to
- capture customers’ details via the form, and- submit the form using an API call
For example:
- If the customer needs more information, say “We’ll be happy to send you more details” and capture the customer’s details in the Google Form. Ask the customer for their details one by one and don’t proceed to the next question until the current one is answered. Then, use the submit form API call.
You can also instruct AI Assist’s response after submitting the form, for example:
- After receiving a response from the submit form API call, say the following depending if it was successful or not:If the form submission was successful, say: “Thank you. Our representative will contact you shortly.What else would you like to do?[option] Go back to the main menu[option] More product info”If the submit form submission failed, say: “I’m sorry, that didn’t work. Please reach out to info@example.com”
3. Test AI Assist’s response using the widget preview on the right. When you’re satisfied with its responses, click Save.
Now, AI Assist will create leads using Google Forms, and each form submission is sent to your Google email address.
Important:
Test your integration for accuracy, latency, and security. Resolve any issues that may negatively affect your customers’ experience.
If you have feedback about this article, or if you need more help:
Click the green live chat icon
Schedule a call with us
Visit our community