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.

Get your Google Form ready

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.

Get your API schema ready

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

Take note of the operationId in your API schema; it’s the operation name AI Assist will use to submit the Google form.


You’ll need this operationId when updating the Base Prompt (covered later in this article). In this example, the operation name is submitForm.

Now, let’s complete this integration on the tawk.to dashboard.
Set up the AI Assist integration

Note: You’ll need a paid AI Assist plan to perform this integration.

1. Log in to your tawk.to account.

2. On your dashboard, select the property for which you want to modify the widget. 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 Integration/API.

6. Under Tools, click + Add.

7. Click Add tool.

8. Enter your specification file’s URL in Schema File URL.

9. Leave API Base URL blank and set Authentication method to No Auth. Then, click Save.

One last step

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
  • use the enabled operation in your API integration to submit the form

For example, if the operation name is submitForm:

Enter the following prompt:

- If the customer needs more information, say “Thank you for your interest in our services! We’ll be happy to send you more details” and capture the required information 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 submit the details using submitForm.

Note: You can customize the operation name under operationId in your API schema.

3. 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:

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us