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

Analyze the time between customer purchases

Intervals are averaged across everyone, mixing customers with several orders and people who only bought once. In this case, the immediate task is to analyze the time between customer purchases. The workflow should produce a repeat-purchase cohort analysis, using the merchant's order history with customer identifiers, refund rules and observation window.

Topic
Repeat Purchase and Retention Analytics
Target keyword
shopify time between purchases
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 analyze the time between customer purchases.
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: [order history with customer identifiers and dates, first-purchase dates, the refund rule, the observation window, and recorded campaign markers]. Measure the gap between each cohort's first and second eligible orders, applying the refund rule to decide which orders count, separating campaign-driven purchases where identified, and excluding one-time buyers from the interval statistic instead of scoring them as long gaps.
Return a repeat-purchase cohort analysis 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 order history with customer identifiers and dates, first-purchase dates, the refund rule, the observation window, and campaign markers where the merchant records them.

02

Step 2

Measure the gap between each cohort's first and second eligible orders, applying the refund rule to decide which orders count, separating campaign-driven purchases where identified, and excluding one-time buyers from the interval statistic instead of scoring them as long gaps.

03

Step 3

Deliver a cohort table with interval ranges plus the cohort's share of one-time buyers, and state the coverage caveat that gaps longer than the window remaining are censored, reconciling counts with the order export.

FAQ

Common questions when running this scenario

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

Why are one-time buyers excluded rather than counted as long intervals?

Their gap has not ended, so any value assigned would be an assumption rather than a measurement. Scoring them as extreme intervals would drag the statistic down and misstate the true pace of repeaters. They are reported separately as the cohort's share of one-time buyers.

How does the observation window censor the longest gaps?

A first-to-second gap longer than the time remaining in the observation window cannot be observed yet, so long gaps are missing from the data rather than absent in reality. The cohort table states the window so readers can see which cohorts are still maturing. Treating the current maximum as the true maximum would understate intervals.

Which orders count toward an interval?

Only eligible orders: inside the observation window, passing the refund rule, and placed by the identified customer. Campaign-driven purchases are separated where the merchant records the campaign, because a discount-driven spike can compress a gap below the customer's usual pace. The eligibility rule is printed with the table so the count can be re-derived.

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.