Back to topic
Spark playbook scenarios · Spark: AI Store Assistant

Create practical customer segments from purchase history

Segment definitions exist as loose descriptions, so a customer can land in two groups or in none. In this case, the immediate task is to create practical customer segments from purchase history. The workflow should produce a customer segment table and interpretation guide, with membership rules testable against the merchant's identifiers and refund rules.

Topic
Customer Analytics and Segmentation
Target keyword
shopify customer segmentation app
Copyable AI prompt

A prompt you can drop directly into Spark

First replace every [bracketed] placeholder with real store scope and constraints, then add any actual records or data you have, and paste it into your preferred AI assistant or Spark agent. Spark will follow this page's workflow to produce structured output and verification steps.

ai-prompt.txt
Act as a Shopify operations specialist.
Help me create practical customer segments from purchase history.
My store context is [describe the business, products and target audience].

My scope is [specify the affected products, pages, customers or reporting period]. Use these inputs: [the order history with stable customer identifiers, order dates, order values and refund entries, the merchant's stated refund treatment, and every segment description currently in use as it is applied today]. Convert each description into a membership rule that resolves to yes or no from the recorded fields, then run every customer through the full set in a stated order so each one lands in exactly one segment, marking as unresolved any description that cannot be expressed as a testable rule.
Return a customer segment table and interpretation guide with counts verified and unusable segments noted for the specified task.
Show the relevant evidence or before-and-after examples and explain how I can verify the result.
If essential data is missing, ask for it and mark unsupported conclusions as unknown.
Do not invent metrics, product claims or customer facts.
For any publication, message, account or store change, use only connected tools within my explicitly authorized scope and report success only after verification; otherwise provide the draft or proposed steps.
Use in Spark
How to solve

A recommended resolution workflow

Split the work into input, judgment, and deliverable phases. Verify each step's output before moving to the next.

01

Step 1

Collect the order history with stable customer identifiers, order dates, order values and refund entries, the merchant's stated refund treatment, and every segment description currently in use recorded as it is applied today rather than as intended.

02

Step 2

Convert each description into a membership rule that resolves to yes or no from the recorded fields, then run every customer through the full set in a stated order so each one lands in exactly one segment, marking as unresolved any description that cannot be expressed as a testable rule.

03

Step 3

Deliver a customer segment table and an interpretation guide with the rule, evaluation order and qualifying count for each segment, verify that the segment counts sum to the distinct customers in the history, and list customers left unassigned together with the rule that failed them.

FAQ

Common questions when running this scenario

Cover decision rules, frequent misunderstandings, and required inputs so the team aligns on prerequisites before execution.

What turns a description into a usable rule?

Every condition must resolve to yes or no from fields the records actually hold, such as identifiers, order dates, order values and refund status, so a loose phrase is rewritten as a concrete test; descriptions that cannot be expressed that way go back to the merchant as unresolved rather than being quietly interpreted.

How is a customer kept out of two segments at once?

Rules are evaluated in one stated order and the first match wins, which makes the segments mutually exclusive for reporting; where the merchant wants overlapping campaign audiences, that is declared explicitly and the overlapping group is reported separately from the reporting segmentation.

When does the segmentation have to be rebuilt?

Whenever the data or the definitions move: after each refresh of the order history, after any change to a membership rule or to the refund treatment, and after the evaluation order is edited, because a rule changed without a rebuild leaves the tables silently describing the previous definition.

Related scenarios

Continue with adjacent or same-topic scenarios

Start with scenarios under the same topic, then expand into cross-topic matches suggested by similarity.

Next step

Want these AI scenarios embedded directly into daily operations?

Ciwi Spark builds Shopify-native AI tools and agents around the workflows merchants actually run: research, ads, translation, and customer support. Stop rewriting the same prompts by hand.