Spoki integration for automating WhatsApp campaigns

WhatsApp is one of the most powerful direct messaging tools and a key ally for your ecommerce business. Here’s a step-by-step guide to creating abandoned cart recovery campaigns with WhatsApp, by integrating your Connectif account with the Spoki tool.


Implementation time: 30 min.
Difficulty: Intermediate
When to use it: 
To create campaigns with WhatsApp.


Before you start: prerequisites

Before building your automated WhatsApp campaign, you’ll need to create your Spoki account and the template for your campaign. 

You can find more information on how to create your templates in the Spoki “Templates” area, by clicking the   (information) button.



When you create your template, it is essential to indicate which dynamic fields it will have. These will be passed from Connectif with the user’s personalized information.

There are two types of fields in the templates:

  • Registry fields: provided by Spoki.
  • Dynamic fields: custom fields. These should always be in capital letters. The sample template contains two dynamic fields:
    • TOTAL AMOUNT (total sum of items).



Step 1. Create the automation in Spoki

Once your campaign template is ready, you need to create the automation in Spoki and associate it with Connectif to obtain the WebHook where the information will be sent from Connectif.

  1. Log in to your Spoki account.
  2. Go to the Automations section.
  3. Click New.


  1. Give your automation a name.
  2. Click   Add Boot Step.


  1. In the pop-up window, select Integration and search for Connectif.


  1. A URL will appear, which will be the URL of the WebHook that you will later use in Connectif.

Save this address! This is the endpoint where the information sent from Connectif will be received and will allow you to customize your messages automatically. 


Once you've done this, you'll need to select the template for the message you want to be displayed in your campaign.

  1. Click Your Automatic Action.


  1. In Action Type filter by Template.
  2. In When, select the waiting period for the action to be triggered after activating the trigger (which in this case will be set by Connectif).
  3. In the search engine, filter and select the template you want to send.
  4. Click Add.


Ready! You have already completed the first step. Save the changes so you don't lose your campaign.


Step 2. Create the custom event in Connectif

Once the automation has been created in Spoki and the template assigned, the next step is to prepare the integration with Spoki and the custom event within Connectif, which will send the information in the fields to Spoki:

  1. Access your Connectif account.
  2. Go to “Integrations > Custom” and click   Create new integration.


  1. From the Settings tab, give the integration a name and save it.


Once the integration is established, the next step is to create the sending event or webhook.

  1. As this is a sending webhook, within the same event settings, go to the Send Data tab and click    Create a new sending event


  1. Within that screen, give the event a name.
  2. Add the URL of the endpoint that you previously found in Spoki (step 1.7.) in the “Webhook URL for sending the message” section.


  1. In order to send the information to Spoki, we need to replicate the JSON structure of the template. Following the example of the “Abandoned Cart” template, the JSON file to replicate is:
"phone": "+393931256677", //required
"first_name": "Maria",
"email": "maria.ross@example.com",
"custom_fields": {
"TOTAL_AMOUNT": "Total amount",
"CHECKOUT_URL": "https://www.domain.com/cart-url“

The dynamic fields that correspond to the custom fields must be in capital letters..


How to create fields in Connectif for transferring information to Spoki

  1. Click    Add new field.


  1. Select the type of field (text, email, etc.).

Find more information about contact field in this article.

  1. Add a Name and an ID.
  2. Click Accept.


To create fields with several properties (custom fields) you’ll need to activate JSON options. The process is similar to the one above:

  1. Click   Add new field.
  2. Select the Field Type (text, email, etc.).
  3. Check the Enable JSON options box.


  1. Use a tool such as JSON Path Finder, which will allow you to extract the path of the properties you need to create.


  1. Copy the route and paste it into Connectif.
  2. Edit the route, replacing the (x. ) at the beginning and the (. ) with backslashes.

For example, if the JSON path is x.custom_fields.total_amount you should change it to /custom_fields. /TOTAL_AMOUNT.

  1. Assign a name and ID to the field.

PRO TIP: Give the field in Connectif the same name as the JSON path to make it easier to locate.


  1. Once you have created all the properties to be transmitted, you have completed the Connectif integration with Spoki. Click Save to ensure that all fields are recorded.



Step 3. Create the workflow to activate your campaign in Spoki

Now is the time to create the workflow in Connectif that activates your campaign when the user abandons their cart and sends the information to Spoki. To do this:

  1. Go to Workflows and click   Create new workflow.


  1. Select a new blank workflow.
  2. In the "Home node”, select All contacts from my list.
  3. Add the “When cart abandoned” trigger node so that the workflow is activated when a visitor to your website adds products to their cart and doesn't complete the purchase.


  1. Edit the node to remove the limitations and click Update.


When the contact leaves the cart, we want to report the event to Spoki. To do this:

  1. Look for the action-type node that you created when you created the Spoki integration (step 2) and add it to your workflow.


  1. Configure the node by assigning the variables to their respective values.
    • The contact variables (first name, last name, telephone number and email) come from the Contact information.


      • The information about the cart properties (TOTAL AMOUNT) is given by the When cart abandoned node


      • The checkout URL is set manually using a Literal value:


  1. Click Update to save the node configuration and your workflow.

The workflow is now ready! You can now activate it to start sending WhatsApp messages to recover your abandoned carts with Spoki and Connectif.



The integration of your Connectif account with Spoki is ready.


Keep learning!

To make the most of your Connectif account, we recommend reading these articles next:

Was this article helpful?
0 out of 0 found this helpful