Skip to main content

How to Write Survey Responses to Shopify Metafields

Write data to Shopify customer metafields based on customer responses, and use it for segmentation and personalization.

This article applies to Shopify stores only.

This integration is available for existing customers already registered with Shopify.

For an overview of the metafield integration, see "What Is the Shopify Metafield Integration?"

When a customer can be identified (logged in to the store, responding to a post-purchase survey, or submitting an email address that matches an existing user), Asklayer can write survey response data directly to Shopify customer metafields. This article explains how to set this up, using three different patterns.

Preparation

Before setting up the integration, you must first create the destination metafield on the Shopify side. For details on metafields, please refer to Shopify Metafields.

For details on which fields integrate with Shopify in Asklayer, please refer to the Shopify Metafield Type Mapping Table.

Setup Steps

Depending on when and what you want to write, there are three methods:

① Write the customer's response as-is to a metafield
Saves what the customer entered in the form, such as free-text responses, exactly as-is.

② Write a custom value depending on the selected answer
For multiple-choice questions, writes a pre-configured value depending on which answer was selected.

③ Write a custom value when the survey is completed
Writes a pre-configured value when the survey is completed, regardless of the responses given.

If you're setting up a survey on the purchase completion page (thank-you page), please refer to the page below. In this case, an email address collection question is not needed.

① Write the customer's response as-is to a metafield

  1. In the survey editor, select the target page (question) from the bottom of the "Questions" screen.

  2. Scroll down to the bottom of the screen and look for "Default Action."

  3. Check "Save response to customer metafield."

  4. Add a question to collect the email address, and place it as the first question.

    Note

    • Answers to questions placed after the email address collection question will be linked to Shopify. For this reason, please place the email address collection question first.

    • If you are only displaying the survey on the order confirmation page and the order status page, collecting the email address is not required. You can skip this step and proceed to step 5.

  5. Save and publish the survey. From then on, every time this question is answered, the response will be written to this metafield.

② Write a custom value depending on the selected answer

  1. In the survey editor, select the target page (a multiple-choice question) from the bottom of the "Questions" screen.

  2. Find the "Edit Action" button below each answer choice.

  3. Click "Write customer metafield."

  4. Select the destination metafield and the value to write when this answer is selected.

  5. Add a question to collect the email address, and place it as the first question.

    Note

    • Answers to questions placed after the email address collection question will be linked to Shopify. For this reason, please place the email address collection question first.

    • If you are only displaying the survey on the order confirmation page and the order status page, collecting the email address is not required. You can skip this step and proceed to step 6.

  6. Save and publish the survey. From then on, every time this answer is selected, the specified value will be written to the metafield.

③ Write a custom value when the survey is completed

  1. Add an Email Capture question, and place it in your preferred order.

  2. Go to the "Actions" page in the survey editor.

  3. Turn on "Customer Metafield."

  4. Enter the destination metafield and the value to write.

  5. This action runs once the customer completes the survey to the end.

Did this answer your question?