Collect Survey Responses After Checkout Then Tag the Customer and Email a Discount Code

Mesa Forms allow you to collect valuable customer-reported information to use as a benefit to your store.

Follow the instructions below to use a Mesa Form as a survey after checkout, and then tag and email the customer with a discount code for completing the survey.

1. In the Mesa dashboard, click Create New Workflow.

2. Select the Form by Mesa app in the app menu:

3. In Step 2, Do this, select the Shopify app in the app menu, and then do a search for Customer Retrieve and click Use this when it populates:

4. Next, click the > arrow in the first Form step and click Open Form Builder to edit and create your form.

5. With the form editor open, begin creating your survey. You can follow our guide to understand the ins and outs of creating forms in the form builder.

In this form, we’ve used a brief survey questionnaire from to create a short list of survey questions in our form (the required selections are indicated with a red asterisk):

- Who are you shopping for?*
- What do you love about your purchase?*
- What is one thing we can improve for your shopping experience?*
- If used, tell us about your experience with our customer service?
- Do you anticipate purchasing from us again?

6. Make sure you edit your input fields within the form (pencil icon) and add a Name that matches the question so you can reference these fields later. Be sure to use dashes - to indicate a space in that field.


7. Before completing your survey, add a Hidden Input to the bottom of your survey. In the Hidden Input adjust the Name to customer-id and the Value to {{}

This will allow you to collect the Customer ID from the order for your Customer Retrieve step.

8. After completing your survey, save your changes by clicking the green Update button in the editor. Then, Save your changes at the top of the workflow.

9. Going back to the Customer Retrieve step, use the token selector {+} to add the Customer ID from the order via the Hidden Input we added:

10. Next, click Add Step below the Shopify Customer Retrieve step and select the Shopify app from the app menu. Then do a search for Shopify Customer Update and click Use this when it populates:

11. Then, in the same step we’ve just added, use the token selector to add the Shopify Retrieve Customer customer ID to the Customer Id field.

From there, add a Tag to this customer to indicate they completed the survey, and also add the survey response to the customer’s notes via the token selector in the Notes field.

Please note, if you are updating the Tags and Notes for the customer, you will need to make sure you add the Shopify Retrieve Customer Tags token and Shopify Retrieve Customer Notes token as the first value in those fields to include any of the customer tags and notes that are already on the customer. Separate your tags with a comma.

12. After choosing how you’d like to update the customer, you can click Add Step beneath the Shopify Customer Update step and choose the Email app.

13. In the Email step you’ve just added, fill out the Recipient field with the Shopify Customer Retrieve Email token, and then add your own messaging for the Subject and Message.

Be sure to include the discount you’re offering within the Message!

14. After updating your Email step, scroll to the top of the workflow to Save your changes and complete the setup. With everything setup, the steps of your workflow should look like this:

15. Almost done! Next, we’ll have to make sure the form is added to the Order Status page that appears after checkout so customers can complete the survey after placing an order.

Follow the series of steps below, or check out our guide, to add your form to the Order Status page:

- Click ' Open Form Builder' in the Form trigger step and select the Get Code tab in the Form Editor
- Delete the code at the top that appears immediately before and after the code that reads:

<link rel="stylesheet" href="" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">

You should only be removing the comment code:

- Next, click the Copy all code button to copy the form code
- Go to your Checkout Settings (Settings in Shopify admin --> Checkout) and paste the copied form code in the field labeled 'Additional Scripts' in the Order processing section
- Save your changes

16. Return to your workflow and click Enable at the top and complete some of the best practices with Mesa. Any customers that fill out your survey will be tagged and emailed with a discount!