Wish to integrate Google Sheets, your CRM, lead forms or any other software with AiSensy?
You can do that easily with viaSocket.
In this doc, we’ve listed down a step-by-step process you need to follow to connect your preferred software with AiSensy via viaSocket and automate WhatsApp template messages.
What is viaSocket?
viaSocket is an automation and integration platform that helps you connect different apps with each other.
It works on triggers and actions.
A trigger is an event that happens in one app. An action is what happens after that event.
For example:
A new row is added in Google Sheets
A new lead is created in your CRM
A new form response is submitted
A new order is placed on your website
Once any of these triggers happen, viaSocket can automatically send a WhatsApp template message to the user through AiSensy.
In this article, we’ll take the example of Google Sheets and show you how to send an AiSensy WhatsApp template message whenever a new row is added or updated in Google Sheets.
Pre-requisites to connect viaSocket with AiSensy
Here are a few things you must have before setting up the integration:
An active AiSensy account
Your WhatsApp Business API must be live
A pre-approved WhatsApp template message in AiSensy
An API Campaign created in AiSensy
Your AiSensy API Key
A viaSocket account
Since, in this tutorial, we are integrating google sheets, you will need to ensure your google sheet contains proper column names in the first row. These column names will be used later to map user details inside viaSocket.
Example:
Name
Phone number
City
OTP
Lead source
Note: You can connect any app with AiSensy using viaSocket, we are showing google sheets integration just for example.
Steps to connect Google Sheets with AiSensy using viaSocket
1. Go to viaSocket & create a new Flow
Log in to your viaSocket account and create a new Flow.
This Flow will help you connect Google Sheets with AiSensy and automate WhatsApp messages.
When you login to your viaSocket account, tap on Build flow manually.
2. Select Google Sheets as the Trigger App
Now, search for Google Sheets and select it as the trigger app.
After selecting google sheets as the trigger app, choose the trigger event as Row Added Or Updated
This means that the Flow will run whenever a new row is added or an existing row is updated in your selected Google Sheet.
3. Configure the Google Sheets Trigger
Now, connect your Google Sheets account with viaSocket.
After connecting your account, fill in the required details:
Sheet: Connect your google account & select the exact sheet where your user data is stored.
Choose when to trigger: Select whether the Flow should run for new records, updated records, or both.
Does your first row contain column name?: Select Yes if your first row has column headers like Name, Phone number, City etc.
Unique Column: Select a column that can uniquely identify each row. You can use Row Number if available.
Trigger Column(s): Select the columns that should trigger this automation when they are updated.
For example, you can select Phone number and Name just like we have done in our example.
Once done, click Test.
viaSocket will fetch sample data from your Google Sheet.
If the test is successful, you’ll be able to see sample data like name, phone number, city, OTP and other details from your sheet.
4. Create a Template Message in AiSensy
Before we connect AiSensy to our viaSocket integration, we first need to make the WhatsApp template message that will be automated to everyone that gets added to our google sheet.
In AiSensy, navigate to the "Templates" section & create a new template message by clicking "+New"
Provide necessary details such as template name, category, and message content
For more info on how to create template messages in AiSensy, check out this template message guide
Important: Add parameters enclosed in curly braces like {{1}} which will later be used to map important user attributes like the user's name, number, email, link etc.
Make sure to add all the parameters depending on your use case.
E.g. if you are sending a purchase confirmation message, you will need to add the user's name, email, course name to the message. So, add these parameters accordingly.
For more clarity on this, watch the video attached at the top.
Important: Only text-based templates are available for WhatsApp automation and Broadcasts in TagMango. You can use image-based and other media-based templates to send broadcasts directly from AiSensy.
Now, Submit the template for approval
Once approved, the template will be available for use in campaigns
You can also read this WhatsApp template message setup guide to learn how to create template messages in AiSensy.
5. Create an API Campaign in AiSensy
In AiSensy App, go to Campaigns, click on +Launch and select API Campaign.
Now, add a Campaign name and select the pre-approved WhatsApp template message that you want to send through this automation.
For example, if you want to send a Utility message for a particular use case, such as lead confirmation, select your approved lead confirmation template.
After selecting the template, set the API Campaign live.
You’ll need to use this same Campaign name later inside viaSocket.
Note: The template message shown in the below screenshots is just for your reference, you can create and connect any template message according to your use case.
5. Copy your AiSensy API Key
Now, go to AiSensy App and open your project.
Go to Developer and copy your API Key (only visible to owner of the AiSensy project)
You’ll need this API Key to connect AiSensy with viaSocket.
Important: Keep your API Key private. Do not share it publicly or with anyone outside your team.
6. Add AiSensy as the Action App in viaSocket
Go back to your viaSocket Flow.
Click on Add Step.
Search for AiSensy and select it.
Now, choose the action event: Send Template Message
This action will send a WhatsApp template message through AiSensy whenever the selected trigger happens in Google Sheets.
7. Connect AiSensy with viaSocket
Click on Connect to AiSensy. A connection window will open.
Paste your AiSensy API Key in the API Key field and click Update Connection.
Once the connection is successful, you’ll see your AiSensy connection added in viaSocket.
Click Done to continue.
8. Add Campaign Information
Now, you need to add the details required to send the WhatsApp template message.
Campaign Name: Add the exact API Campaign name created in AiSensy.
Destination: Map the user’s WhatsApp number.
User Name: Map the name of the user.
Important: Make sure the destination number has the country code.
Correct format: +918130740347
9. Add Source, Media, Template Parameters, Tags, Attributes and Location
On the right side, you’ll see more options like:
Source
Media
Template Parameters, Tags
Attributes
Location
Use these fields based on your WhatsApp template and use case.
Source: Add the source of the lead.
For example, Google Sheets, Website Lead, CRM Lead etc.
Template Parameters: Map the dynamic values used in your WhatsApp template.
For example, if your template has parameters like:
Hi {{1}}, your registration is confirmed for the AiSensy Webinar.
Then map:
{{1}} with Name
Tags: Add tags if you want to segment users inside AiSensy.
For example:
Google Sheet Lead
New Lead
Attributes: Map user attributes if you want to save extra user information inside AiSensy.
For example:
City
Lead Source
Course Name
Order ID
Media: Use this only if your template contains a media file.
Location: Use this only if your template contains location details.
Important: Map only the fields that are required for your template. If your template does not have media or location, you can ignore those fields.
10. Test the AiSensy Action
Once you’ve added the campaign information and mapped all required fields, click Test.
viaSocket will send a test request to AiSensy.
If everything is configured correctly, the WhatsApp template message will be sent to the user’s WhatsApp number.
Check whether:
The correct template message is sent
The phone number is in the correct format
The name and template parameters are mapped correctly
Tags and attributes are getting updated properly in AiSensy
If there is any error, check the error message and revise the details accordingly.
11. Save the Flow and Go Live
Once the test is successful, click Save.
After saving the Flow, click Go Live.
That’s it!
You’ve successfully connected Google Sheets with AiSensy using viaSocket.
From now on, whenever a new row is added or updated in your selected Google Sheet, viaSocket will automatically trigger AiSensy and send the selected WhatsApp template message to the user.
Example Use Case
Let’s say you collect leads in Google Sheets from your website, Meta ads or landing page.
Your Google Sheet has these columns:
Name
Phone number
City
Interested product
Now, whenever a new lead is added to the sheet, AiSensy can automatically send a WhatsApp message like:
Hi Rahul, thank you for showing interest in our product. Our team will contact you shortly.
This helps your team instantly connect with new leads on WhatsApp without manually sending messages one by one.
Things to remember
Make sure your API Campaign is live in AiSensy before adding the Campaign name in viaSocket.
The Campaign name entered in viaSocket should exactly match the API Campaign name in AiSensy.
The destination number should include the country code.
Your template parameters should be mapped in the same order as your approved WhatsApp template.
If your template has 2 parameters, make sure both parameters are mapped.
Use media only if your WhatsApp template contains a media file.
Tags should already be created in AiSensy before using them in the automation.
Attributes should already be created in AiSensy before mapping them in viaSocket.
Always test the Flow before making it live.
If the test fails, check the API Key, Campaign name, phone number format and template parameter mapping.

















