Automate Customer Tagging from Metafield Values Hourly
This Flow automatically converts a customer metafield value into a new customer tag, running hourly to keep customer segmentation consistent and up-to-date.
The Problem
Manually updating customer tags based on custom data is a tedious, error-prone task that scales poorly as your customer base grows. Without an automated system, critical customer segmentation data stored in metafields might not be reflected in tags, leading to missed marketing opportunities, inconsistent customer experiences, or wasted time in manual data syncs across various platforms.
What This Automation Solves
This Shopify Flow automation eliminates manual tagging by continuously synchronizing customer metafields with customer tags. Triggered hourly, the flow efficiently identifies customers missing a 'processed' tag, extracts a specified metafield value (e.g., 'custom.test'), and then adds both the metafield value as a new tag and a 'processed' tag to prevent re-processing, ensuring your customer data is always current and actionable for segmentation and marketing efforts.
When to Use This Automation
- You've imported customer data with custom attributes into metafields and need to convert them into searchable tags.
- You use a third-party app that writes customer data to metafields, and you want to leverage that data for Shopify's native tagging.
- You need to create dynamic customer segments for email marketing or loyalty programs based on specific customer properties stored in metafields.
Workflow
Trigger
Step 1Runs every hour starting Sep 14, 2023.
Action
Step 2Gets customers that do not have a processed tag.
Loop
Step 3Iterates over each customer.
Action
Step 4Logs the inserted liquid variable.
Action
Step 5Adds the processed tag and a tag from the metafield value.
Step-by-Step Setup
- 1
Identify your target customer metafield's namespace and key (e.g., 'customers.my_app_data.tier') whose values you want to convert into tags.
- 2
In the 'Add customer tags' action, replace `customer.metafield.custom.test` with the Liquid variable for your specific metafield.
- 3
Verify the 'Scheduled time' trigger is set for your desired frequency (e.g., hourly) and the 'Get customer data' action correctly filters for customers without the 'processed' tag.
- 4
Test the flow with a few sample customers to confirm tags are added as expected before activating it for your entire customer base.
Related Questions
- How do I prevent this flow from re-tagging the same customers repeatedly?
- The 'Get customer data' action is specifically configured to only fetch customers that *do not* have the 'processed' tag. After successfully adding the desired tag, the workflow then adds the 'processed' tag to that customer, ensuring they are skipped in all subsequent runs.
- What if a customer has multiple values in a metafield that I want to convert into separate tags?
- This specific flow converts a single metafield value into a single tag. If your metafield contains multiple values (e.g., an array or a comma-separated string), you would need to modify the 'Add customer tags' action with more advanced Liquid logic or add additional actions to parse and apply each value individually.
- Can this workflow be adapted to create tags from order or product metafields instead of customer metafields?
- This workflow is designed exclusively for *customer* metafields and actions. To achieve similar tagging for orders or products, you would need to create a new, separate Shopify Flow, selecting appropriate triggers (e.g., 'Order created') and corresponding actions (e.g., 'Get order data,' 'Add order tags').
- How long will it take for this hourly flow to tag all my existing customers?
- This flow processes up to 100 customers per hour. The total time required will depend directly on your total customer count; for instance, a store with 10,000 customers would take approximately 100 hours (just over 4 days) to fully process.
Recommended Tools & Apps
Launch this automation
Open Shopify Flow and use this page as your setup blueprint.
Merchant Insight
When setting up this automation, always create a test customer or two with your target metafield already populated. Run the flow manually on these specific customers first to confirm the tags are applied exactly as intended before activatin
Related Automations
Automate Tagging for Shopify Subscription Orders
Instantly tag every recurring subscription order with a specific label, streamlining order identification and management within your Shopify admin.
How to Get Email Alerts for Shopify Flow Errors
Automatically receive an email notification whenever one of your critical Shopify Flow automations encounters an error, preventing silent failures and revenue loss.
Automate Deleting Old, Non-Purchasing Customers
Automatically cleans your customer database by removing profiles of non-purchasing customers older than five years, ensuring a streamlined and compliant system.