Manually sending WhatsApp messages to multiple Facebook Leads can be a cumbersome task. You have to copy user details from Facebook Forms, sort those details, and compose and send a personalized message to each lead separately.
This post will discuss how you can automatically send WhatsApp messages to your Facebook Form respondents.
We will fetch the responses from Facebook Lead Ads, establish a connection with WhatsApp Business Cloud API, and send those respondents a personalized template message on WhatsApp using Pabbly Connect. And the best part is that this would be a one-time setup.
Steps to send WhatsApp messages to new Facebook leads automatically
1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Establish a connection between Facebook Lead Ads and Pabbly Connect
3. Setup WhatsApp Business Cloud API as Action App
4. Create a Message Template
5. Map the Recipient Mobile Number and Body Fields
Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow
A. Sign In / Sign Up
To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.
Click on the Pabbly Connect ‘Access Now’ button
B. Create Workflow
To create a new workflow, click the ‘Create Workflow’ button.
Name your workflow, and click on ‘Create’.
Step 2:- Establish a connection between Facebook Lead Ads and Pabbly Connect
We will now look at the steps through which we will establish a link between Facebook Lead Ads and Pabbly Connect. This will help us to fetch the lead details from Facebook Form responses.
A. Trigger App
Trigger allows us to choose the application that will receive the data for Pabbly Connect. In our case, it would be Facebook Lead Ads.
Expand the trigger step, choose ‘Facebook Lead Ads’ as the trigger app, and select ‘New Lead (Instant)’ as your trigger event. Click on ‘Connect’. Doing this will result in Facebook Lead Ads sending data directly to Pabbly Connect whenever a new lead is generated.
Select ‘Add New Connection’, and click on ‘Connect With Facebook Lead Ads’. Also, grant the authorization.
B. Establish Connection
Select the Facebook page on which you are running the lead ads, and choose the LeadGen Form you want to link with Pabbly Connect. Click on ‘Save And Send Test Request’.
As soon as you click on ‘Save And Send Test Request’, Pabbly Connect will start looking to fetch data from Facebook Lead Ads indicated by the rotating ‘Waiting for Webhook Response Button’.
C. Test the Connection
To fetch the lead details, we will use the ‘Facebook Lead Ads testing tool’, which will help us create a dummy lead. Upon submission of this dummy lead, Pabbly Connect will capture the data from Facebook Lead Ads to test our established connection.
Click on ‘Facebook Lead Ads testing tool’
You will be redirected to the Lead Ads Testing Tool, where you need to create a dummy lead.
Select the Page and Form you want to link, and click on ‘Preview form’
Fill out this dummy form, click on ‘Next’, and ‘Submit’ this form.
Switch back to Pabbly Connect, expand Response Received, and our dummy details must be visible, thus confirming our established connection.
We have established a link between Facebook Lead Ads and Pabbly Connect. Pabbly Connect will now automatically fetch the details of any new leads.
Our next step will be to link WhatsApp Business Cloud API with Pabbly Connect. This will help us send template messages directly on WhatsApp whenever a new lead responds to your Facebook forms.
Note: Setup your WhatsApp Business Cloud API by following steps 1 to 3 of this post.
Step 3:- Setup WhatsApp Business Cloud API as Action App
A. Action App
Action allows us to choose the application that will get executed by the workflow trigger.
We essentially want to send template messages on WhatsApp. Therefore, WhatsApp Cloud API will be our action app.
Choose ‘WhatsApp Cloud API’ as your app, select ‘Send Template Message’ as your Action Event, and click on ‘Connect’
B. Connect with WhatsApp Cloud API account
To connect with your WhatsApp Cloud API account, select ‘Add New Connection’.
Switch to your WhatsApp Business Cloud API account to find the Phone Number ID and WhatsApp Business Account ID. Copy both IDs
Paste the IDs in their respective fields
The Token visible on your dashboard is a temporary one that expires every 24 hours. For our workflow, we need a Permanent Token. You can generate a Permanent Access Token by following the steps given in this post.
Paste the Permanent Token, and click on ‘Save’
Your WhatsApp Business Cloud API account is now connected.
Step 4:- Create a Message Template
You will be asked to fill up a few fields. You can either select your Template Name directly from the list if you already have one ready or create a new message template by following these steps.
A. Create Message Template
Switch to your WhatsApp Cloud API dashboard, and click the ‘here’ hyperlink. You will be redirected to a new page.
Click on ‘Create Message Template’.
Select a Category, Name the template and pick a Language. Click on ‘Continue’
B. Body with Dynamic Data Tags
Type in your message in the Body field. To personalize your message, include Dynamic Data Tags in your template.
Dynamic Data Tags help us to include variables in our template, these variables will be replaced with actual data in your message. The actual data can be a name, an email address, date, time, ID number etc. To add a dynamic tag to your template, write your variables between double curly braces {{variable}}.
We have also included dynamic data tags {{variable}} in our document. In our case, they will be replaced with actual data like the name of the respondent and team name. You can use the dynamic tags per your choice of the variable.
C. Add Sample Content
To create a new template message, we are required to send Facebook a sample template for verification.
To send a sample, Click on ‘Add Sample’.
Enter the data you want your tags to be replaced with, and click on ‘Done’.
‘Submit’ your message and ‘Confirm’
As you submit your template, it could be approved right away or go to Facebook for a manual review. This process may take anywhere from a few minutes to a few hours. Reload your page to see if your template is approved and available, as indicated by the green dot. Your template is ready for use.
Select your Template Name
Step 5:- Map the Recipient Mobile Number and Body Fields
We need to map Recipient Mobile Number from the step above.
But there is one problem our contact number contains a + sign. We have to remove the + sign for our workflow to function correctly.
A. Add a Text Formatter
We can use a Text Formatter to remove the + sign from our number.
Add another action step to your workflow by clicking on the ‘+’ button above your current action step.
Choose ‘Text Formatter by Pabbly’ as your app, select ‘Split Text’ as the Action Event, and click on ‘Connect’.
In the Text to Split field, map the number from the step above.
Enter the ‘+’ sign as the Separator.
Select ‘Last’ as your Segment Index to retain only the number in your workflow, and click on ‘Save & Send Test Request’.
We can now use this number in our workflow.
B. Map the Recipient Mobile Number
Reauthorize your connection by clicking on ‘Connected’.
Click on ‘Save’, and your connection will get reauthorized.
Again map the Recipient Mobile Number from above.
C. Map Body Fields
Remember the Dynamic Data Tags we talked about? Those tags will be replaced by the data present in Body Fields.
In Body Field 1, map the recipient’s Full Name from above. This could vary as per your choice of the variable.
In Body Field 2, enter your second variable. In our case, it is the organization’s name.
You can also map this field if your variable is in the list. Click on ‘Save & Send Test Request’
We have received the template message on WhatsApp, and our automation is now complete.
We have successfully integrated Facebook Lead Ads forms with WhatsApp Business Cloud API. As soon as a user responds to your Facebook form, the respondent will receive a personalized message on WhatsApp.
You can clone this workflow in your Pabbly Connect account and start using this automation instantly.
Sign Up for a free Pabbly Connect account, and start automating your business.
Subscribe to our Youtube Channel for more such automation.
For any other queries, visit our forum