How to easily broadcast to a subset of your Shopify customers on Wati?

Do you want to run marketing campaigns for only those customers who have purchased from you in the past? If you're struggling with moving this information from Shopify to Wati in order to be able to broadcast from Wati, then this article is for you.

In this article, we'll talk about how you can automate this and get rid of all the manual export/import you've been doing all this while.

Basically, you will use Shopify flows to figure out when a customer has purchased from you and call the Wati API to add contacts and any custom attributes for that contact. Once this is complete, you can head on over to Wati and directly broadcast to this customer segment.

Here's a video that talks through this

Alternatively, you can use this article if you aren't really a video person.

  1. Go to your Shopify account and on the side navigation bar, click on Marketing > Automations
  2. Click on Create automation > Create custom automation and in the search bar, search for Order Paid. In this example, we've used order paid but the trigger will depend on your definition of a customer purchase. If your business workflow identifies a purchase on order created instead, then use that as the trigger.
  1. If you want to do this only once for a customer who has purchased from you, then add a condition by clicking on the "then" on the order paid node. Click on add a criteria and look for order > customer > numberOfOrders.
  2. In the following screen, set the condition to less than or equal to, 1 and click out of this modal.
  1. Click on the "Then" and add an action. Search for http and select "send http request"
  1. First, get your Wati endpoint URL and API token ready. Next, copy and paste the following in the Body section of the Http Request in Shopify. Here, we're setting purchased, city and country as the custom attributes. You can add or remove as you like. Use the "Add a variable" to explore what else is available.
{ "customParams": [
{ "name": "purchased", "value": "yes" },
{ "name": "country", "value": "{{order.shippingAddress.country}}" },
{ "name": "city", "value": "{{order.shippingAddress.city}}" }
],
"name": "{{order.customer.displayName}}"
}
  1. Under Headers, Add "Authorization" and copy the API token that you obtained from the previous step. Add "content-type" as the key and "text/json" as the value
  2. Change the HTTP method to POST and in the URL section add the following. Shopify stores phone numbers in the + country code format and the last part of this URL will remove the "+" from the phone number so that Wati can send the broadcast successfully.
https://watiendpointURL/api/v1/addContact/{{order.phone | remove: "+"}}
  1. Finally, the http request should match the screenshot below. If it matches up, click on Turn on workflow and you're all set to test!

Testing your Shopify workflow

  1. To test the workflow, create a test order on Shopify and add a customer to this order. Ensure, the customer has a contact number mapped in the + country code format and that all the attributes you're adding in the workflow are not left empty in this testing scenario. Ex - if we're adding city and country - these need to have the corresponding values filled as part of the customer order. Mark the order as paid and voila!
  2. Head on over to Wati to see the contact and attributes created. Success! Now, you can go into broadcast and filter by "purchased : yes" to ensure you're marketing is reaching the right audience. You're all set to go now 🎉

Troubleshooting the Shopify workflow

If your workflow does not work, head on over to the workflow section in Shopify and select your workflow. Click on View recent activity. You can see how many times the workflow has run and the result of each run. You can also click into it, to see some of the values at the time the workflow was running.

Let us know if this helped 🙌🏿 - both the help article as well as the solution.

How did we do?

How can I send catalog messages?

Messaging limit for Click-to-WhatsApp Ads (CTWA)

Contact