Blood Test Recommendations
Biomarker-to-Supplement System
A system that turns blood test biomarker results into personalized supplement recommendations with dosing protocols, stored directly in Shopify customer metafields and displayed on customer account pages.
The Problem
Hewyn was moving toward personalized health recommendations based on actual blood work. Customers would get blood tests done, share their results, and expect supplement suggestions tailored to their specific deficiencies. The challenge wasn’t the science (we had a health advisor for that). The challenge was building a system that could store, display, and manage these personalized recommendations within Shopify, where all our customer data already lived. We didn’t want a separate database, a separate login, or a separate app.
The Approach
I built the recommendation system on top of Shopify’s customer metafields. Each customer gets a structured JSON metafield containing their biomarker results, mapped supplement recommendations, and dosing protocols. The data is written through the Shopify Admin API using GraphQL mutations, and displayed on the customer’s account page through custom Liquid templates.
The dosing protocols handle complexity that a simple “take this product” recommendation can’t. Ashwagandha, for example, uses a cyclic protocol: 8 weeks on, 2 weeks off. Some supplements need to be taken with food, others on an empty stomach. Some have interactions that mean they shouldn’t be taken at the same time. All of this is encoded in the recommendation templates.
Each recommendation is manually curated by our health advisor and entered into the system per customer. This was a deliberate choice, not a limitation. When you’re telling someone what to take based on their blood work, automation is the wrong answer.
Key Decisions
-
Shopify metafields over an external database. Customer data already lives in Shopify. Adding a separate database would have meant syncing customer records, managing auth between systems, and maintaining another piece of infrastructure. Metafields keep everything in one ecosystem. Customer service can see recommendations in the same admin panel where they see orders.
-
Manual curation over automated mapping. I could have built a rules engine that maps low vitamin D levels to vitamin D supplements automatically. But health supplement recommendations tied to blood biomarkers sit in a gray area where generic automation could cause real harm. A human reviews every recommendation before it goes into the system. The technology handles storage and display, not clinical judgment.
-
Structured JSON over flat text. Each recommendation is a JSON object with fields for supplement name, dosage, frequency, timing, cycle protocol, and interaction notes. This makes the data queryable and templatable. If we ever want to build an automated reorder system, the structured data is already there.
What I Learned
There’s a legal line between “supports healthy triglyceride levels” and “treats high triglycerides.” Building the recommendation templates forced me to learn that distinction because the words I chose would appear on customer accounts. Health claims have regulatory weight, and the difference between a supplement claim and a medical claim is sometimes one word.
The technical system was simple. Metafields, Liquid templates, a bit of GraphQL. The hard part was designing templates that communicated dosing protocols clearly without crossing into medical advice territory. Every template went through review, and most of them got rewritten at least once for language alone.
Built for Hewyn. Architecture and data model shown. Biomarker thresholds and customer data anonymized.