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.
Setting Up the Workflow
Open Shopify Flow
1.1. Click Create workflow, then choose Select a trigger.
1.2. In the workflow editor, select Lantern as the app.
1.3. Choose the trigger Quiz Completed — with customers (required for tagging).
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.
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 %}
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 %}
3.2.2.2 Replace
pet_name
with your actual Property ID from Lantern (e.g.,pet_breed
,favorite_treat
).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 %}
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.
Turn On the Workflow
4.1 Enable the workflow so tags are applied automatically whenever a quiz is completed.
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.