Segmenting your customers allows you to show different Mention Me experiences to different users. The Mention Me app automatically includes localisation data, and additional segmentation can be added within the app.
We support two methods for segmentation:
- Shopify Metafields (recommended)
- Custom segmentation using JavaScript logic
Supported Metafields (Recommended)
Shopify Metafields let you define custom customer metadata. Mention Me can use these values to show different experiences.
Metafields must be explicitly added to the Mention Me app in advance—Shopify does not automatically send them by default.
⚠️ Metafields must already exist on the customer record before they complete their transaction. Otherwise, Shopify won’t pass them to Mention Me.
We automatically support the following Customer Metafields:
- mention-me.segment – Mention Me Segment
- loyaltylion.loyalty_tier – Loyalty Lion Loyalty Tier
If your metafield isn’t supported yet, you can request support for it (see below).
Requesting a New Metafield
To request a new metafield, raise a support ticket with our team. Be sure to provide both the namespace and key.
To find the namespace and key:
1. In your Shopify Admin, go to Settings → Metafields and metaobjects
2. Select Customers
3. Select the metafield you'd like Mention Me to use
4. Copy the “Namespace and key” (e.g., mention-me.segment)
Mention Me will add this to the app and begin including it in data GQL from Shopify when available.
Custom Segmentation with Code
You can create a segment dynamically using the contents of the user’s cart by writing your own logic with JavaScript. This is handled via a script input in the Mention Me Shopify app settings.
Example: Segment users depending on which product variants are in their cart.
const getSegment = (currentSegment, cartLines) => {
const lineItems = cartLines || [];
const segments = [];
lineItems.forEach((item) => {
switch (item.merchandise.id) {
case "gid://shopify/ProductVariant/11102677025151":
segments.push("Segment_A");
break;
case "gid://shopify/ProductVariant/11102667653503":
segments.push("Segment_B");
break;
case "gid://shopify/ProductVariant/11883500654975":
segments.push("Segment_C");
break;
}
});
const priority = ["Segment_A", "Segment_B", "Segment_C"];
for (const seg of priority) {
if (segments.includes(seg)) {
return { segment: seg };
}
}
return { segment: null };
};
return getSegment(segment, cartLines);
You can find full documentation and sandbox examples on using this inside the Mention Me admin.
Can I Use Tags or Other Shopify Attributes?
Shopify does not allow direct access to tags or other customer properties at checkout time. You cannot segment directly using tags.
You may be able to use an automation tool like Shopify Flow to assign a metafield to customers dynamically based on tags. However, please note:
- Shopify Flow is asynchronous—your flow must complete before the customer checks out
- Only values set before checkout are passed to Mention Me
- We recommend consulting a Shopify expert when building a Flow-based process