How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.
The following instructions are for Brand Referral, which is not currently available on the free Tier of the Shopify App. Contact us to know more.
Segmenting your customers allows you to show different Mention Me experiences to different users. The app automatically includes localisation data, and additional segmentation can be added within the app.Two methods are supported:
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.
You can create a segment dynamically using the contents of the user’s cart by writing JavaScript logic. 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);
Full documentation and sandbox examples are available inside the Mention Me admin.
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 Shopify Flow to assign a metafield to customers dynamically based on tags. However:
Shopify Flow is asynchronous — your flow must complete before the customer checks out
Only values set before checkout are passed to Mention Me
Consult a Shopify expert when building a Flow-based process
Last modified on July 13, 2026
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Mention Me Docs","colors":{"primary":"#4C57E6","light":"#FF3EB5","dark":"#21174B"},"logo":{"light":"https://mintcdn.com/mentionme/V2LNKGCh7ROBia07/logo/light.svg?fit=max\u0026auto=format\u0026n=V2LNKGCh7ROBia07\u0026q=85\u0026s=747c8cd37a71a653a020675616c849f3","dark":"https://mintcdn.com/mentionme/V2LNKGCh7ROBia07/logo/dark.svg?fit=max\u0026auto=format\u0026n=V2LNKGCh7ROBia07\u0026q=85\u0026s=100c40618765923e52d9db84344692e6"},"favicon":"https://mintcdn.com/mentionme/Dcv4Ct-ZIyuK4Pcd/favicon.ico?fit=max\u0026auto=format\u0026n=Dcv4Ct-ZIyuK4Pcd\u0026q=85\u0026s=cc9c8c8b015455ba82e2820c8306a4ab","background":{"color":{"light":"#FFFFFF","dark":"#22272E"}},"navbar":{"primary":{"type":"button","label":"Contact support","href":"https://help.mention-me.com/hc/en-gb/requests/new"}},"footer":{"socials":{"x":"https://x.com/mentionme","linkedin":"https://linkedin.com/company/mention-me"},"links":[{"header":"Company","items":[{"label":"Website","href":"https://www.mention-me.com"},{"label":"Platform","href":"https://app.mention-me.com"},{"label":"Support","href":"https://help.mention-me.com/hc/en-gb/requests/new"},{"label":"Status","href":"https://status.mention-me.com"}]}]},"seo":{"metatags":{"og:site_name":"Mention Me Docs"}},"errors":{"404":{"redirect":true,"title":"Page not found","description":"The page you're looking for may have moved. Try searching or head back to the [home page](/knowledge/getting-started/overview)."}},"contextual":{"options":["assistant","copy","claude","chatgpt","cursor","mcp","add-mcp"],"display":"toc"},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Submit a Request","icon":"headset","href":"https://help.mention-me.com/hc/en-gb/requests/new"},{"anchor":"Platform","icon":"gauge","href":"https://app.mention-me.com"},{"anchor":"Status","icon":"signal","href":"https://status.mention-me.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mentionme","hasAudioNarration":false,"actualSubdomain":"mentionme","customDomains":["docs.mention-me.com"],"gitSource":{"type":"github","owner":"mention-me","repo":"mention-me-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"DISABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af2019b0da5396f96340ce0","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Guides","count":365},{"language":"default","tag":"Integrations","count":73},{"language":"default","tag":"Referral","count":57},{"language":"default","tag":"Documentation","count":50},{"language":"default","tag":"API \u0026 Webhooks","count":45},{"language":"default","tag":"Customers","count":44},{"language":"default","tag":"Reporting","count":43},{"language":"default","tag":"Campaigns","count":42},{"language":"default","tag":"ESP \u0026 CRM Integrations","count":38},{"language":"default","tag":"Getting Started","count":32}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":".mm-partner-badge{padding:0 16px 8px;margin-bottom:10px}.mm-partner-badge-inner{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px 10px;font-size:12px;line-height:1.3;color:#9ca3af;border:1px solid rgba(0, 0, 0, 0.07);border-radius:6px}.dark .mm-partner-badge-inner{border-color:rgba(255, 255, 255, 0.08)}.mm-partner-badge-content{min-width:0}.mm-partner-badge-context{color:#9ca3af}.dark .mm-partner-badge-context{color:#6b7280}.mm-partner-badge-name{font-weight:500;color:#6b7280}.dark .mm-partner-badge-name{color:#9ca3af}.mm-partner-badge-code{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;color:#9ca3af}.dark .mm-partner-badge-code{color:#6b7280}.mm-partner-badge-reset{all:unset;flex-shrink:0;font-size:13px;line-height:1;color:inherit;cursor:pointer;opacity:0.3}.mm-partner-badge-reset:hover{opacity:0.7}.mm-partner-badge-switch{all:unset;flex-shrink:0;font-size:11px;line-height:1;color:#6b7280;text-decoration:underline;text-underline-offset:2px;cursor:pointer;opacity:0.8}.mm-partner-badge-switch:hover{opacity:1}.dark .mm-partner-badge-switch{color:#9ca3af}.mm-partner-badge-reenable{all:unset;color:#6b7280;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.mm-partner-badge-reenable:hover{color:#4b5563}.dark .mm-partner-badge-reenable{color:#9ca3af}.dark .mm-partner-badge-reenable:hover{color:#d1d5db}pre code{width:auto!important;min-width:0!important;max-width:100%!important;padding:0!important;word-break:break-all!important;overflow-wrap:break-word!important;white-space:pre-wrap!important}body:has(.docs-home) #header,body:has(.docs-home) #page-title{display:none}body:has(.docs-home) #content-container,body:has(.docs-home) article,body:has(.docs-home) .prose{max-width:none}html:has(.docs-home){background-color:#ffffff}body:has(.docs-home){background:transparent}body:has(.docs-home) #background-color{background-color:#ffffff;background-image:radial-gradient(ellipse 120% 80% at 50% -10%, #c9cef8 0%, transparent 58%),\n radial-gradient(ellipse 70% 55% at 0% 30%, #f7cce8 0%, transparent 55%),\n radial-gradient(ellipse 60% 50% at 100% 15%, #d4d8f8 0%, transparent 50%);background-repeat:no-repeat}html.dark:has(.docs-home){background-color:#22272e}html.dark body:has(.docs-home){background:transparent}html.dark body:has(.docs-home) #background-color{background-color:#22272e;background-image:radial-gradient(ellipse 120% 80% at 50% -10%, #3d4280 0%, transparent 58%),\n radial-gradient(ellipse 70% 55% at 0% 30%, #5a3350 0%, transparent 55%),\n radial-gradient(ellipse 60% 50% at 100% 15%, #3a3f73 0%, transparent 50%);background-repeat:no-repeat}body:has(.docs-home) main,body:has(.docs-home) #content-container{min-height:100vh;background:transparent}.docs-home{width:100%;padding:0 1.25rem 5rem}.docs-home-inner{max-width:72rem;margin:0 auto}.docs-home-hero{max-width:1000px;padding:5.5rem 0 2.75rem;margin:0 auto;text-align:center}.docs-home-title{max-width:1000px;margin:0 auto 2.5rem;font-size:4rem;font-weight:600;line-height:4.5rem;color:#21174b;letter-spacing:-1px}.dark .docs-home-title{color:#f4f2fb}.docs-home-lede{margin:0;font-size:1rem;line-height:1.45;color:#5c5674}.docs-home-why{margin:1.15rem 0 0}.docs-home-why a{display:inline-flex;gap:0.45rem;align-items:center;padding:0.5rem 0.95rem 0.5rem 0.75rem;font-size:0.9rem;font-weight:500;line-height:1.2;color:#21174b;text-decoration:none;background:rgba(255, 255, 255, 0.72);border:1px solid rgba(33, 23, 75, 0.2);border-radius:999px}.docs-home-why a:hover{color:#4c57e6;border-color:#4c57e6}.docs-home-why a svg{width:1rem;height:1rem}.dark .docs-home-why a{color:#f4f2fb;background:rgba(34, 39, 46, 0.55);border-color:rgba(255, 255, 255, 0.2)}.dark .docs-home-why a:hover{color:#c5c9f8;border-color:#c5c9f8}.docs-home-platforms{max-width:650px;margin:0 auto}.docs-home-section-title{margin:3.5rem 0 1.75rem;font-size:1.75rem;font-weight:600;line-height:2.25rem;color:#21174b;text-align:center;letter-spacing:-0.5px}.dark .docs-home-section-title{color:#f4f2fb}.docs-home-topics{margin-top:0}.dark .docs-home-lede{color:#b4afc6}@media (max-width: 640px){.docs-home-title{font-size:2.5rem;line-height:2.85rem}}.cl-meta{display:flex;flex-wrap:wrap;gap:0.4rem 0.55rem;align-items:center;margin:0 0 1.25rem;font-size:0.8rem;font-weight:500;line-height:1.2;color:#5c5674}.cl-meta-date{font-variant-numeric:tabular-nums}.dark .cl-meta{color:#b4afc6}.cl-pill{display:inline-flex;align-items:center;padding:0.18rem 0.5rem;font-size:0.7rem;font-weight:600;line-height:1.2;letter-spacing:0.01em;border-radius:999px}.cl-pill-new{color:#4c57e6;background:rgba(76, 87, 230, 0.1)}.cl-pill-improved{color:#5c5674;background:rgba(33, 23, 75, 0.06)}.cl-pill-fixed{color:#8a2e6a;background:rgba(255, 62, 181, 0.1)}.cl-pill-area{color:#5c5674;background:transparent;border:1px solid rgba(33, 23, 75, 0.12)}.dark .cl-pill-new{color:#c5c9f8;background:rgba(76, 87, 230, 0.22)}.dark .cl-pill-improved{color:#d5d1e4;background:rgba(255, 255, 255, 0.06)}.dark .cl-pill-fixed{color:#f5b6dd;background:rgba(255, 62, 181, 0.16)}.dark .cl-pill-area{color:#d5d1e4;border-color:rgba(255, 255, 255, 0.14)}.cl-pill-platform-update{color:#21174b;background:rgba(76, 87, 230, 0.1)}.dark .cl-pill-platform-update{color:#c5c9f8;background:rgba(76, 87, 230, 0.22)}.cl-author{margin:0.85rem 0 0;font-size:0.875rem;font-weight:600;color:#21174b}.dark .cl-author{color:#f4f2fb}"}],"page":{"pagePath":"knowledge/shopify/segmentation","slug":"/knowledge/shopify/segmentation","pageMetadata":{"title":"Segmentation","description":"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.","href":"/knowledge/shopify/segmentation"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Note,OptimizedImage,Step,Steps,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(Note,{children:[`The following instructions are for `,_jsx(_components.strong,{children:`Brand Referral`}),`, which is `,_jsx(_components.strong,{children:`not currently available`}),` on the free Tier of the Shopify App. `,_jsx(_components.a,{href:`https://help.mention-me.com/hc/en-gb/requests/new?ticket_form_id=20114637802909`,children:`Contact us to know more`}),`.`]}),`\n`,_jsx(_components.p,{children:`Segmenting your customers allows you to show different Mention Me experiences to different users. The app automatically includes localisation data, and additional segmentation can be added within the app.`}),`\n`,_jsx(_components.p,{children:`Two methods are supported:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Shopify Metafields`}),` (recommended)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Custom segmentation`}),` using JavaScript logic`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-metafields-recommended`,children:`Supported Metafields (Recommended)`}),`\n`,_jsx(_components.p,{children:`Shopify Metafields let you define custom customer metadata. Mention Me can use these values to show different experiences.`}),`\n`,_jsx(_components.p,{children:`Metafields must be explicitly added to the Mention Me app in advance — Shopify does not automatically send them by default.`}),`\n`,_jsxs(Warning,{children:[`Metafields must already exist on the customer record `,_jsx(_components.em,{children:`before`}),` they complete their transaction. Otherwise, Shopify won’t pass them to Mention Me.`]}),`\n`,_jsx(_components.p,{children:`Automatically supported Customer Metafields:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`mention-me.segment`}),` — Mention Me Segment`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`loyaltylion.loyalty_tier`}),` — Loyalty Lion Loyalty Tier`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`requesting-a-new-metafield`,children:`Requesting a New Metafield`}),`\n`,_jsxs(_components.p,{children:[`Raise a support ticket providing both the `,_jsx(_components.strong,{children:`namespace`}),` and `,_jsx(_components.strong,{children:`key`}),`.`]}),`\n`,_jsx(_components.p,{children:`To find the namespace and key:`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Open Metafields Settings`,children:[_jsxs(_components.p,{children:[`In your Shopify Admin, go to `,_jsx(_components.strong,{children:`Settings > Metafields and metaobjects`}),`.`]}),_jsx(Frame,{caption:`Shopify admin Settings showing Metafields and metaobjects.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=b746ec50a207c240518526b7e35fb697`,alt:`Shopify admin Settings showing Metafields and metaobjects`,\"data-og-width\":`2276`,width:`2276`,\"data-og-height\":`1632`,height:`1632`,\"data-path\":`images/knowledge/shopify/28555018117021.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?w=280\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=2b99339cdbc6a7f2838de771c90e253e 280w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?w=560\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=59cc8ad0e512f57d82ef6d4c8c2f17c2 560w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?w=840\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=bb703f5636c1d9930fc81c430ce2601d 840w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=fbe703fb3d89cecf4d5776a100f052c6 1100w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=5ddf2e195f6cf5d998870e7c6c166b90 1650w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018117021.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=1404f57394803d1d1a057664f0b30bf1 2500w`})})]}),_jsx(Step,{title:`Select Customers`,children:_jsx(Frame,{caption:`Selecting the Customers metafield category.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=a7ea9643b0be88d0e79dbe4ae09f53b4`,alt:`Selecting Customers metafield category`,\"data-og-width\":`2276`,width:`2276`,\"data-og-height\":`1632`,height:`1632`,\"data-path\":`images/knowledge/shopify/28555018118301.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?w=280\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=e5f50d6e8d458143328b9c2681dfdd83 280w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?w=560\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=b7b84d5d737e5a15b3be6c346999b5a1 560w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?w=840\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=20d61fd32348e399f79995077a80f1de 840w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=08086f61a09775ed25db5057fe3d180d 1100w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=edc1531ffcd5e583d1a66804462b9f9b 1650w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118301.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=07b3777aa02feb84e47304fc4a20b203 2500w`})})}),_jsxs(Step,{title:`Select the Metafield`,children:[_jsx(_components.p,{children:`Select the metafield you’d like Mention Me to use.`}),_jsx(Frame,{caption:`Selecting a customer metafield for Mention Me.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=6dd61e60a435b219d005266d6d868dd8`,alt:`Selecting a customer metafield for Mention Me`,\"data-og-width\":`2260`,width:`2260`,\"data-og-height\":`1618`,height:`1618`,\"data-path\":`images/knowledge/shopify/28555018118941.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?w=280\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=31527919266a46a284054c49d4471c96 280w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?w=560\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=cdee28c95b92fd88ae65d719fbc34923 560w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?w=840\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=38ec0445a44c4b63e7f5fe16ea958126 840w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=ae971e75cf6a515d857da57ba0093ef4 1100w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=75e418d2c43697340aaa21ddcb7929ad 1650w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018118941.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=4d8f473d2f5cf279c4e5e8a3956487eb 2500w`})})]}),_jsxs(Step,{title:`Copy the Namespace and Key`,children:[_jsxs(_components.p,{children:[`Copy the “Namespace and key” (e.g., `,_jsx(_components.code,{children:`mention-me.segment`}),`).`]}),_jsx(Frame,{caption:`The metafield namespace and key value.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=f7db97e7f2d3ea272fced65b480df9d8`,alt:`Metafield namespace and key value`,\"data-og-width\":`2262`,width:`2262`,\"data-og-height\":`1074`,height:`1074`,\"data-path\":`images/knowledge/shopify/28555018119325.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?w=280\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=aa43d68202a787d5b287209efa37d027 280w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?w=560\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=c670fd77f5de7e8fdc3dc980d8e473bd 560w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?w=840\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=819cdb0e519f68de38651d9e27325326 840w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=c90e16ed884bc5bd76427f683347cafa 1100w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=0b2087295e3cee6807749634ae09d967 1650w, https://mintcdn.com/mentionme/GjiDi6ZwHP27Pu0w/images/knowledge/shopify/28555018119325.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GjiDi6ZwHP27Pu0w\u0026q=85\u0026s=f2bf00c4d868e29365b7e87c1367e037 2500w`})})]})]}),`\n`,_jsx(_components.p,{children:`Mention Me will add this to the app and begin including it in data from Shopify when available.`}),`\n`,_jsx(Heading,{level:`2`,id:`custom-segmentation-with-code`,children:`Custom Segmentation with Code`}),`\n`,_jsxs(Note,{children:[_jsx(_components.strong,{children:`Advanced feature.`}),` If you need guidance, `,_jsx(_components.a,{href:`https://help.mention-me.com/hc/en-gb/requests/new`,children:`contact Mention Me support`}),`.`]}),`\n`,_jsx(_components.p,{children:`You can create a segment dynamically using the contents of the user’s cart by writing JavaScript logic. This is handled via a script input in the Mention Me Shopify app settings.`}),`\n`,_jsx(_components.p,{children:`Example: Segment users depending on which product variants are in their cart.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`29`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getSegment = (currentSegment, cartLines) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lineItems = cartLines || [];`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` segments = [];`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lineItems.forEach((item) => {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` switch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (item.merchandise.id) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gid://shopify/ProductVariant/11102677025151\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` segments.push(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Segment_A\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gid://shopify/ProductVariant/11102667653503\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` segments.push(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Segment_B\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gid://shopify/ProductVariant/11883500654975\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` segments.push(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Segment_C\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` priority = [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Segment_A\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Segment_B\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Segment_C\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` seg `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` priority) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (segments.includes(seg)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { segment: seg };`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { segment: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getSegment(segment, cartLines);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Full documentation and sandbox examples are available inside the Mention Me admin.`}),`\n`,_jsx(Heading,{level:`2`,id:`can-i-use-tags-or-other-shopify-attributes`,children:`Can I Use Tags or Other Shopify Attributes?`}),`\n`,_jsx(_components.p,{children:`Shopify does not allow direct access to tags or other customer properties at checkout time. You cannot segment directly using tags.`}),`\n`,_jsxs(_components.p,{children:[`You may be able to use `,_jsx(_components.strong,{children:`Shopify Flow`}),` to assign a metafield to customers dynamically based on tags. However:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Shopify Flow is asynchronous — your flow must complete before the customer checks out`}),`\n`,_jsx(_components.li,{children:`Only values set before checkout are passed to Mention Me`}),`\n`,_jsx(_components.li,{children:`Consult a Shopify expert when building a Flow-based process`}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Segmentation","description":"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.","href":"/knowledge/shopify/segmentation"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Supported Metafields (Recommended)","slug":"supported-metafields-recommended","depth":2,"children":[{"title":"Requesting a New Metafield","slug":"requesting-a-new-metafield","depth":3,"children":[]}]},{"title":"Custom Segmentation with Code","slug":"custom-segmentation-with-code","depth":2,"children":[]},{"title":"Can I Use Tags or Other Shopify Attributes?","slug":"can-i-use-tags-or-other-shopify-attributes","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/mentionme/585da3591117c76f/clerk-loader.js","/_mintlify/custom/mentionme/8c2fd5fe6a58ba82/posthog.js","/_mintlify/custom/mentionme/6b3953f5758cd5c3/tests/sftp-tree.js","/_mintlify/custom/mentionme/621493ede3850bd6/version-switch.js"],"subdomain":"mentionme","siteName":"Mention Me Docs","title":"Segmentation - Mention Me Docs","navMaps":{"firstHrefInVersion":{"Classic docs":{"href":"/knowledge/shopify/segmentation","matchLevel":0},"Mention Me docs":{"href":"/","matchLevel":4}},"firstHrefInLanguage":{}},"lastModified":"2026-07-13T10:28:32.174Z","gitLastModified":"2026-07-13T10:25:07.000Z","originalFileLocation":"knowledge/shopify/segmentation.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Mention Me Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Segmentation - Mention Me Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Mention Me Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mention-me.com/knowledge/shopify/segmentation\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mentionme.mintlify.site/_mintlify/api/og/v2?division=Shopify\u0026amp;title=Segmentation\u0026amp;description=How+to+segment+customers+using+Shopify+Metafields+or+custom+JavaScript+logic+to+show+different+Mention+Me+experiences.\u0026amp;theme=52d9a28de14b1f3580df43c7\u0026amp;signature=edd3e4f9bd3868b57adcce2a64bc0bc2fdd0f5d0bfacf6ed91cc6c2ba1ba3c61\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Segmentation - Mention Me Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mentionme.mintlify.site/_mintlify/api/og/v2?division=Shopify\u0026amp;title=Segmentation\u0026amp;description=How+to+segment+customers+using+Shopify+Metafields+or+custom+JavaScript+logic+to+show+different+Mention+Me+experiences.\u0026amp;theme=52d9a28de14b1f3580df43c7\u0026amp;signature=edd3e4f9bd3868b57adcce2a64bc0bc2fdd0f5d0bfacf6ed91cc6c2ba1ba3c61\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/mentionme/C55mfF-eb_dz8RU1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Mention Me Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4C57E6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mention-me.com/knowledge/shopify/segmentation\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/knowledge/shopify/segmentation.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mention-me.com/#organization\",\"name\":\"Mention Me Docs\",\"url\":\"https://docs.mention-me.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/mentionme/V2LNKGCh7ROBia07/logo/light.svg?fit=max\u0026auto=format\u0026n=V2LNKGCh7ROBia07\u0026q=85\u0026s=747c8cd37a71a653a020675616c849f3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mention-me.com#website\",\"name\":\"Mention Me Docs\",\"url\":\"https://docs.mention-me.com\",\"publisher\":{\"@id\":\"https://docs.mention-me.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mention-me.com/knowledge/shopify/segmentation#webpage\",\"url\":\"https://docs.mention-me.com/knowledge/shopify/segmentation\",\"name\":\"Segmentation\",\"description\":\"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.\",\"dateModified\":\"2026-07-13T10:25:07.000Z\",\"isPartOf\":{\"@id\":\"https://docs.mention-me.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mention-me.com/knowledge/shopify/segmentation#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mention-me.com/knowledge/shopify/segmentation#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Quickstart Guides\",\"item\":\"https://docs.mention-me.com/developer-docs/integration/javascript-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shopify\",\"item\":\"https://docs.mention-me.com/knowledge/shopify/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Segmentation\",\"item\":\"https://docs.mention-me.com/knowledge/shopify/segmentation\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.mention-me.com/knowledge/shopify/segmentation#article\",\"headline\":\"Segmentation\",\"name\":\"Segmentation\",\"description\":\"How to segment customers using Shopify Metafields or custom JavaScript logic to show different Mention Me experiences.\",\"url\":\"https://docs.mention-me.com/knowledge/shopify/segmentation\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mention-me.com/knowledge/shopify/segmentation#webpage\"},\"dateModified\":\"2026-07-13T10:25:07.000Z\",\"publisher\":{\"@id\":\"https://docs.mention-me.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mention-me.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Mention Me Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Mention Me Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/knowledge/shopify/segmentation.md","siteName":"Mention Me Docs","nav":{"global":{"anchors":[{"anchor":"Submit a Request","icon":"headset","href":"https://help.mention-me.com/hc/en-gb/requests/new"},{"anchor":"Platform","icon":"gauge","href":"https://app.mention-me.com"},{"anchor":"Status","icon":"signal","href":"https://status.mention-me.com"}]},"versions":[{"version":"Classic docs","default":true,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":""}]},{"tab":"Guides","icon":"book-open","pages":[{"title":"Guides","href":"/knowledge/getting-started/overview"}]},{"tab":"Documentation","icon":"code","pages":[{"title":"Integration Overview","sidebarTitle":"Overview","href":"/developer-docs/integration/overview"},{"group":"Quickstart Guides","pages":[{"group":"Javascript Tags","pages":[{"title":"JavaScript Tags Quickstart","sidebarTitle":"JavaScript Tags","href":"/developer-docs/integration/javascript-overview"},{"title":"Referrer Tag","sidebarTitle":"Referrer Tag","href":"/developer-docs/integration/entry-points/referrer"},{"title":"Referee Tag","sidebarTitle":"Referee Tag","href":"/developer-docs/integration/entry-points/referee"},{"title":"Landing Page Tag","sidebarTitle":"Landing Page","href":"/developer-docs/integration/entry-points/landing-page"},{"title":"Homepage Promotions","sidebarTitle":"Homepage Promotions","href":"/developer-docs/integration/entry-points/homepage-promotions"},{"title":"Product Referral Tag","sidebarTitle":"Product Referral","href":"/developer-docs/integration/entry-points/product-referral"},{"group":"Advanced","pages":[{"title":"Order Tracking","sidebarTitle":"Order Tracking","href":"/developer-docs/integration/order-tracking"},{"title":"Conversion Message Tag","sidebarTitle":"Conversion Message","href":"/developer-docs/integration/conversion-message"},{"title":"Dashboard Tag","sidebarTitle":"Dashboard","href":"/developer-docs/integration/dashboard"},{"title":"Drive Action Tag","sidebarTitle":"Drive Action","href":"/developer-docs/integration/incentive-for-action"}]}]},{"group":"Shopify","pages":[{"title":"Overview","href":"/knowledge/shopify/overview"},{"group":"App","pages":[{"title":"How to Install the Mention Me Shopify App","href":"/knowledge/shopify/app-installation"},{"title":"FAQs","href":"/knowledge/shopify/app-faqs"}]},{"group":"Customer Experience","pages":[{"title":"How to Customise the Shopify Customer Journey","href":"/knowledge/shopify/customer-journey"},{"title":"How to Manage Imagery in Shopify","href":"/knowledge/shopify/imagery"},{"title":"Checkout Extensibility Best Practices","href":"/knowledge/shopify/checkout-extensibility"},{"title":"How to Add the Announcement Banner","href":"/knowledge/shopify/announcement"},{"title":"How to Set Up Product Referral Sharing","href":"/knowledge/shopify/product-referral"}]},{"title":"Personalised Discount Codes","description":"Customise Shopify discount codes with the referrer's name using template tokens.","sidebarTitle":"Discount Code Templates","href":"/knowledge/shopify/discount-code-templates"},{"title":"Segmentation","href":"/knowledge/shopify/segmentation"},{"title":"Locales","description":"How to configure locale mapping between Shopify and Mention Me for multi-region and multi-language stores.","href":"/knowledge/shopify/locales"},{"title":"How to Migrate to the New Shopify App","href":"/knowledge/shopify/migrating-to-new-app"},{"group":"Additional Tag Implementation","pages":[{"title":"Overview","href":"/knowledge/shopify/additional-tags/overview"},{"title":"Checkout \u0026 Sidecart Referee Tag","href":"/knowledge/shopify/additional-tags/checkout"},{"title":"Landing Page Tag","href":"/knowledge/shopify/additional-tags/landing-page"},{"title":"Referral Dashboard","sidebarTitle":"Dashboard","href":"/knowledge/shopify/additional-tags/dashboard"}]}]},{"group":"SAP Commerce Cloud","pages":[{"title":"Referrer Tag – SAP Commerce Cloud","sidebarTitle":"Referrer","href":"/developer-docs/integration/setup/sap-commerce-cloud-referrer"},{"title":"Referee Tag – SAP Commerce Cloud","sidebarTitle":"Referee","href":"/developer-docs/integration/setup/sap-commerce-cloud-referee"},{"title":"Landing Page Tag – SAP Commerce Cloud","sidebarTitle":"Landing Page","href":"/developer-docs/integration/setup/sap-commerce-cloud-landing-page"},{"title":"Dashboard Tag – SAP Commerce Cloud","sidebarTitle":"Dashboard","href":"/developer-docs/integration/setup/sap-commerce-cloud-dashboard"}]},{"group":"Tag Containers","pages":[{"title":"Tag Containers","sidebarTitle":"Overview","href":"/developer-docs/integration/setup/tag-containers"},{"title":"Referrer Tag – Google Tag Manager","sidebarTitle":"Referrer","href":"/developer-docs/integration/setup/google-tag-manager-referrer"},{"title":"Referee Tag – Google Tag Manager","sidebarTitle":"Referee","href":"/developer-docs/integration/setup/google-tag-manager-referee"},{"title":"Landing Page Tag – Google Tag Manager","sidebarTitle":"Landing Page","href":"/developer-docs/integration/setup/google-tag-manager-landing-page"},{"title":"Dashboard Tag – Google Tag Manager","sidebarTitle":"Dashboard","href":"/developer-docs/integration/setup/google-tag-manager-dashboard"}]},{"group":"Native Apps","pages":[{"title":"Native App Integration","sidebarTitle":"Native Apps","href":"/developer-docs/integration/native-apps"}]},{"group":"Global-e Checkout","pages":[{"title":"Integrating Mention Me Tags into Global-e Checkout","href":"/knowledge/tags/global-e"}]}]},{"group":"Advanced","pages":[{"title":"Encrypted Parameters","sidebarTitle":"Encrypted Parameters","href":"/developer-docs/integration/encrypted-parameters"},{"title":"Newsletter API Integration","sidebarTitle":"Newsletter API","href":"/developer-docs/integration/newsletter-api"},{"group":"SFTP","pages":[{"title":"SFTP Connection","sidebarTitle":"SFTP Connection","href":"/developer-docs/integration/sftp-connection"},{"title":"SFTP Data Formats","sidebarTitle":"SFTP Data Formats","href":"/developer-docs/integration/sftp-data-formats"},{"title":"SFTP File Encryption","sidebarTitle":"File Encryption","href":"/developer-docs/integration/sftp-encryption"}]}]},{"group":"Reference","pages":[{"title":"Testing Your Integration","sidebarTitle":"Testing","href":"/developer-docs/integration/setup/testing"},{"title":"Error Codes \u0026 Messages","sidebarTitle":"Error Codes","href":"/developer-docs/integration/reference/error-codes"},{"title":"Integration FAQs","sidebarTitle":"FAQs","href":"/developer-docs/integration/reference/faqs"}]},{"group":"MCP Server","pages":[{"title":"Mention Me MCP Server","sidebarTitle":"Setup","href":"/developer-docs/mcp/setup"}]}]},{"tab":"API \u0026 Webhooks","icon":"square-terminal","pages":[{"title":"API \u0026 Webhooks","href":"/api-reference/introduction"}]},{"tab":"Changelog","icon":"newspaper","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"version":"Mention Me docs","pages":[{"title":"Mention Me docs","href":"/"}]}]},"basePath":"","title":"Segmentation - Mention Me Docs","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BXrZabKK.js","DynamicMarkdown-CtasenyM.js","zoom-image-lightbox-C5F0mVLH.js","lightbox-handle-r17bVUz3.js"]}