sequence cspade

E-commerce Customer Purchase Path Analysis

Scénario de test & Cas d'usage

Business Context

An online retailer wants to identify the most common navigation paths customers take before making a purchase. By understanding these frequent sequences (e.g., 'Landing Page' -> 'Product Search' -> 'Cart'), the marketing team aims to optimize the website layout to boost conversion rates.
Data Preparation

Create a dataset representing web sessions. 'session_id' groups the actions, 'timestamp' orders them, and 'page' is the item.

Copied!
1 
2DATA mycas.web_navigation;
3LENGTH page $20;
4INPUT session_id timestamp page $;
5CARDS;
61 10 Home 1 20 Search 1 30 AddToCart 1 40 Checkout 2 10 Home 2 50 Checkout 3 10 Home 3 20 Search 3 25 ProductView 3 60 Checkout 4 15 Search 4 20 ProductView 5 10 Home 5 12 Search 5 40 AddToCart 5 45 Checkout ;
7 
8RUN;
9 

Étapes de réalisation

1
Execute the cspade action to find sequences that appear in at least 40% of the sessions (support=0.4).
Copied!
1 
2PROC CAS;
3sequence.cspade / TABLE={name='web_navigation'} sequenceId='session_id' eventId='timestamp' itemId='page' support=0.4 casout={name='common_paths', replace=true};
4 
5RUN;
6 

Expected Result


The output table 'common_paths' should contain frequent sequences such as 'Search -> Checkout' or 'Home -> Search', helping to identify the critical steps in the customer journey.