How to send data to Zapier

Zapier chatbot integration allows you to connect Activechat to hundreds of other applications supported by Zapier with the JSON block.

Until we release the native Zapier integration, your Activechat chatbots can communicate to Zapier through the JSON block, using Zapier’s native Webhooks trigger.

Let’s look into a simple example – it will add new leads from your chatbot to Pipedrive CRM. To make it work, we’ll first create a new Zap that will be triggered by the webhook.

Setting up Zapier's "Catch webhook" trigger
Setting up Zapier’s “Catch webhook” trigger

In the “Customize webhook” section you will find the URL of the webhook (it’s in the “Custom Webhook URL” field) – copy it and save to use later in the JSON block settings in Activechat.

Copying the webhook URL for the JSON block
Copying the webhook URL for the JSON block

Now, you are ready to get sample webhook data into Zapier to use it in the remaining part of the setup. Let’s switch to Activechat and prepare the JSON block.

First, we’ll need some data to send to Pipedrive through Zapier. It can be system attributes like $_first_name and $_last_name, or any number of user attributes that you can collect with LISTEN blocks or calculate with DATA blocks.

A simple lead generation flow asks questions and sets the user attributes
A simple lead generation flow asks questions and sets the user attributes

After your chatbot receives from the user all the info it needs to send, let’s connect the JSON block to trigger the webhook in Zapier.

JSON block setup with Zapier webhook URL and a number of parameters from user attributes
JSON block setup with Zapier webhook URL and a number of parameters from user attributes

Paste the Webhook URL that you got from Zapier into the “URL” field in the JSON block editor and choose the “POST” method. (You can choose the “GET” method too, but it will append “querystring_” prefix to every parameter name that you’re sending to Zapier.)

Now add data that you want to send to your third-party app through Zapier as “parameters” of the JSON block. Notice that Activechat allows you to change the name of the user attribute when sending it as a parameter – this can be crucial for the number of applications. In the example above we’re sending user attributes $user_name (as “name”), $user_phone (as “phone”), $user_email (as “email”), $user_company (as “company”) and a couple of other attributes. Notice the use of the $_last_page_visit_url system attribute to send data about the page on your website where the conversation started. (You can read more about Activechat’s website tracking feature.)

Once you complete the setup of the JSON block and the lead generation chatbot skill is ready, build your bot and let’s send some test data to Zapier!

Trigger the skill in the chatbot, answer the questions that you’ve built there – but WAIT until you send the last answer, preceding the JSON block. We do not want to trigger that block yet!

Now, go back to Zapier and click the “TEST & REVIEW” button in the “Find Data” part of the Webhook trigger settings.

Testing the connection between Activechat and Zapier
Testing the connection between Activechat and Zapier

When you click it, you will have approximately 3 minutes to send test data to Zapier (by triggering your JSON block).

Example chatbot conversation for lead generation purposes
Example chatbot conversation for lead generation purposes

So, answer the last question in your lead generation skill and let the JSON block execute. (Don’t forget to add some kind or confirmation after this block in your skill so that the user knows his data was sent successfully!)

If you go back to Zapier now, you will notice that the JSON block has sent some data to the webhook endpoint, and you can click the sample to check that data.

Sample data sent by your JSON block to Zapier's webhook endpoint
Sample data sent by your JSON block to Zapier’s webhook endpoint

Voila! Now you can proceed to the rest of your Zap setup, and send that data anywhere – to hundreds of apps supported by Zapier.

As promised, let’s add that data as a new lead to the Pipedrive CRM.

Adding the ACTION step after the original Webhook trigger
Adding the ACTION step after the original Webhook trigger

Notice that I’ve chosen “Find person” action in Pipedrive instead of “Create person” due to the fact that “Find person” can automatically create new person if none was found, and if a person with that email already exists in my Pipedrive CRM, I would like to append existing data instead of getting a broken Zap.

You can use every attribute that you’ve sent with the JSON block in the Action setup fields:

Data sent from the JSON block is available in Zapier
Data sent from the JSON block is available in Zapier

Once you complete the Action step setup, send test data to your app (Pipedrive in our case) and don’t forget to switch your Zap ON. Once it’s ON, the webhook endpoint will constantly listen to new requests from the JSON block and send data to the connected apps on every new lead.

🛑 IMPORTANT! Please note that if you are using multiple Zaps in your chatbot, Webhook URLs will be different! Pay attention to this when copying your JSON blocks in the visual editor.

Was this article helpful to you? Yes 4 No

How can we help?