Personalization in multilevel e-commerce system Lukas Grolig 1 Personalization Is about providing customer his own user experience. Display features that he might need and promote products might buy. 2 Multi-level marketing Companies having multiple sales streams. Company is recruiting consultants - self employed individuals offering products. In multi-level there are also people responsible for recruitment of consultants as their main income. But company can also be selling directly to the customers. 3 Problems When designing personalization in multi-level there are many types of users with completely different needs. Whole website can change so drastically that it is not about sales anymore. 4 Target persons «person» V i s i t o r Anonymous site visitor «person» Builder Recruiter. Finds people willing to sell the products. Provides education about p r o d u c t s . «person» C o n s u l t a n t Shops on behalf of his c u s to mers . «person» S h o p O w n e r Buys products in batch to resell then in his/hers s t o r e . «person» D i r e c t C u s t o m e r Browses website and orders products for himself or his family. 5 System Design (Context) «person» U s e r Visiting site «container» E - C o m m e r c e We b s i t e [Some classical technology stack] Provides user functionality such as product catalogue, detail, basket, checkout process. «container» E-Commerce API [Some microservice technology stack] Responsible for business logic, providing and storing data. «container» P e r s o n a l i z a t i o n Engine [ ] Multiple systems to provide user specific data. «container» Feature Flag Engine [ ] Turns on/off functionality for specific segment. U s e s [HTTPS] U s e s [HTTPS] U s e s [HTTPS] U s e s [HTTPS] U s e s [HTTPS] U s e s [HTTPS] 6 Personalization Engine (Container) « c o n t a i n e r » P r o d u c t P e r s o n a l i z a t i o n [ C o n t e x t u a l B a n d i t ] P r o v i d e s p r o d u c t s p e r s e g m e n t . « c o n t a i n e r » F e a t u r e P e r s o n a l i z a t i o n [ C o n t e x t u a l B a n d i t ] P r o v i d e s r i g h t f e a t u r e s f o r t a r g e t p e r s o n a . « c o n t a i n e r » C u s t o m e r S e g m e n t a t i o n [ ] C l a s s i f i c a t i o n m o d e l t o p r o v i d e i n f o r m a t i o n a b o u t c u s t o m e r s e g m e n t . 7 Segmentation offline experimentational training number of target groups selected by data scientist manual analysis of each segment (based on sales, features used) preparation for classification engine (defining features) 8 Classification part of ML pipeline based on segmentation analysis output, dataset is created after closings classification is based on Catboost (gradient boosting) models are trained, evaluated and deployed automatically 9 Contextual Bandit « c o n t a i n e r » S t a t e [ ] « c o n t a i n e r » A c t i o n [ ] « c o n t a i n e r » R e w a r d [ ] * * * * * * * * * * * * 10 Modeling the Problem Context: product category, season, region Decision: products to display Feasible actions: { category1, category2, bestsellers, trending } Outcome: user adds product to basket or displays product detail page withing 20s Reward: 3 when added to basket, 1 when detail displayed, 0 otherwise 11 Contextual Bandit (Context) «container» A p p [ ] «container» P e r s o n a l i z a t i o n S e r v i c e [ ] «container» Join Service [ ] «container» O n l i n e L e a r n e r [ ] «container» O f f l i n e L e a r n e r [ ] «container» D a t a s e t [ ] c o n t e x t d e c i s i o nr e w a r d R e w a r d s * * * * T r a i n i n g d a t a B e s t m o d e l P a r a m e t e r s , M o d e l s * * * * 12 Service Design each service must use telemetry to trace request through the system API to retrieve plain data is not accepting context personalization is separate API on top of plain 13 Personalized data source on top of data sources there can be personalizes data source accepting context Problems: personalized sources are much slower caching can be challenging (memory consumption) 14 Personalized feature flags on top of regular feature flag service there is another providing features based on context enables complete customization of browsing experience affects frontend development and backend-for-frontend nearly every UI component has it's own flag components can be versioned (eg. suffix to feature folder) 15 Automated A/B Testing it is crucial to specify right metrics (display time, time to action, selling targets) each service must provide analytic outputs multiple metric sources must be aggregated (traces, google tags...) data are stored in a lake using ETL raw data are processed and stored in the lake again data are consumed by systems when needed 16 Join service 2 possible designs - offline based on ETL, online based on message hub (eg. Kafka) in microservice world it is the most complex part of the system heavy utilization of OpenTelemetry join service takes nearly all events same as logging service does 17 Questions? 18 Thanks a lot. 19