Skip to main content

Tagging Customers Based on Quiz Responses with Shopify Flow

Wendy avatar
Written by Wendy
Updated this week

With Shopify Flow, you can automatically tag customers based on their quiz responses in Lantern.

Prerequisites

  • Shopify Flow app installed and active on your store.

  • A Lantern quiz published and collecting responses.

  • Make sure your quiz includes an Opt-in page to collect an email address, since Shopify requires an email to create a customer record.

  • In the quiz’s Results Page → Orders & Tags, enable Create customer in Shopify so quiz takers are added as customers and can be tagged in Shopify Flow.

    Image showing the Results Page → Orders & Tags menu in Lantern with the 'Create customer in Shopify' option enabled on the right-hand side.

Setting Up the Workflow

  1. Open Shopify Flow

    1.1. Click Create workflow, then choose Select a trigger.

    Image showing the Shopify Flow interface with the "Create workflow" option highlighted and the "Select a trigger" step visible, which appears after clicking Create workflow.

    1.2. In the workflow editor, select Lantern as the app.

    1.3. Choose the trigger Quiz Completed — with customers (required for tagging).

    Image showing the Shopify Flow editor with Lantern selected as the app and 'Quiz Completed — with customers' chosen as the trigger.

  2. Filter by Quiz ID

    2.1. Add a Condition block to check for a specific quiz ID.

    2.2. This ensures tags are only applied for the quiz you want, especially useful if you have multiple quizzes.

    2.3. You can find the quiz ID under the quiz’s More Integrations tab.

    Image showing the Shopify Flow condition block set to quiz ID equals 'pets-best-bite', with the Lantern More Integrations tab also displayed to highlight where the quiz ID can be found, including an arrow pointing to the quiz ID checkbox in the Flow interface.

  3. Tag the Customer

    3.1 Add an Action → Shopify → Add customer tag.

    3.2 Enter the tag logic using Liquid so it outputs the exact answer selected as the tag. For example, use a snippet like this to apply the customer’s response directly:

    3.2.1 Example Liquid code to output the exact answer selected as the tag

    {% for r in responses.responses %} {% if r.question == "Your question here" %} {{ r.answer }} {% endif %} {% endfor %}

    Actual workflow example

    {% for r in responses.responses %} {% if r.question == "What size is your pet?" %} {{ r.answer }} {% endif %} {% endfor %}

    Image showing the Shopify Flow Add customer tag action with the Liquid code snippet for tagging based on the question 'What size is your pet?’

    Image showing newly created customers in Shopify with a ‘Small’ tag applied by Shopify Flow.

    3.2.2 Alternative (Recommended): Tag via Property ID (Customer Input)

    3.2.2.1 For customer input (open‑ended) questions, assign a Property ID in Lantern (e.g., pet_name) and output the value directly as a tag. This avoids relying on the full question text and works well when users type their own answers.

    Where to use this: Paste the Liquid below into the Add customer tag action’s Tag field.

    {% for property in properties.properties %} {% if property.name == "pet_name" %} {{ property.value }} {% endif %} {% endfor %}

    Image showing the Add customer tag action configured with Liquid code using Property ID 'pet_name'.

    3.2.2.2 Replace pet_name with your actual Property ID from Lantern (e.g., pet_breed, favorite_treat).

    Image showing the Lantern question settings with a Property ID field highlighted.

    Note: These examples use pets as an illustration, but the same approach applies to any quiz topic (e.g., skincare type, dietary preference, favorite color). Just adjust the Property ID and you’re set.

    3.2.3 Optional: Advanced Tag Mapping

    3.2.3.1 For advanced use cases, you may want to transform raw answers into friendlier tag names. For example, if the quiz question is “What pet do you have?” you can tag customers as Dog Owner or Cat Owner instead of just Dog or Cat. Paste this into the Add customer tags action:

    {% for r in responses.responses %} {% if r.question == "What pet do you have?" %} {% if r.answer == "Dog" %}Dog Owner{% endif %} {% if r.answer == "Cat" %}Cat Owner{% endif %} {% endif %} {% endfor %}

    Image showing the Add customer tag action with Liquid code that maps Dog to Dog Owner and Cat to Cat Owner.

    This example will tag the customer as Dog Owner if the answer is Dog, or Cat Owner if the answer is Cat.

    This is optional and meant for users comfortable editing Liquid code. The simpler approach above (using the exact answer as the tag) is recommended for most cases.

  4. Turn On the Workflow

    4.1 Enable the workflow so tags are applied automatically whenever a quiz is completed.

    Image showing the completed Shopify Flow workflow for tagging customers based on quiz responses, with an arrow pointing to the 'Turn on workflow' button.

Notes

  • Always use the with customers trigger so tags can be applied to existing or newly created customer records.

  • Combine multiple conditions in a single workflow for more advanced segmentation.

  • Tags can be used in Shopify directly or synced with marketing apps for segmentation.

  • For better reliability, assign property IDs in Lantern to the quiz questions you want to use for tagging. This allows your Liquid code in Shopify Flow to target stable IDs (e.g., pet_type) instead of long question text, making your workflows easier to maintain.

By tagging customers based on quiz responses, you can create tailored experiences that improve engagement and conversion. For more on setting up workflows, see our Shopify Flow Integration or Integrating Lantern with LoyaltyLion via Shopify Flow articles.

Did this answer your question?