Summary
Using 30 million grocery transactions from Instacart, I analyze how customer purchasing behavior changes over time. Results include the following:
-
Customers who are new to the platform reorder about 30% of the items they buy, while long-time users reorder nearly 70%
-
People buy certain categories together (like pasta and canned goods)
- While many people try Instacart once, a core group sticks around and shops consistently
Data Engineering & Setup
- Queried 30M+ transactions in PostgreSQL
- Joined six normalized tables via relational keys
- Engineered behavioral feature tables
- Performed aggregations and behavioral metrics
- Created visualizations in Python
Do customers build shopping habits over time?
Reorder probability increases with total orders placed (30% → 69%)
Shopping behavior becomes more predictable as users gain more experience with the platform. New users appear to experiment more and try different products while more active users settle into stable purchasing routines.
The reorder curve rises sharply in early orders before plateuing around 25-30 orders. This suggests that habit formation occurs quickly, and the customer’s first few purchases significantly shape their purchasing habits.
Which categories are commonly bought together?
In this heatmap, noticeable combinations are:
- Dry goods pasta + canned goods
-
Personal care + household
- International + canned
These patterns suggest that customers shop around routines. Highlighting complementary items can increase basket size through smarter recommendations. Instead of promoting individual products, suggesting related categories during checkout may better align with how customers naturally build their carts.
The curve stabilizes as order count increases, indicating repeat behavior strengthens over time. Although there are fewer customers in the higher order levels, they show more consistent predictable purchasing patterns. Therefore, revenue is likely concentrated in a smaller group of deeply engaged customers.
Strategically, the goal should be to move more users into the high-engagement segment by reducing friction in early purchases. For example, offering free delivery for the first few orders, pre-filling baskets for the next purchase, or personalizing reorder suggestions.
View full SQL queries -> GitHub