This study investigates the impact of personalization and user experience on customer loyalty, with trust, customer satisfaction, and positive perception as mediating variables among Tokopedia users in Indonesia. Grounded in Social Exchange Theory (SET) and the Stimulus–Organism–Response (S-O-R) framework, the research explores how digital stimuli influence internal evaluations and behavioral responses in e-commerce settings. A structured online survey was distributed to Tokopedia users, and after data screening, 165 valid responses were analyzed using Partial Least Squares Structural Equation Modeling (PLS-SEM) via SmartPLS 3. The measurement model demonstrated acceptable reliability (Cronbach’s Alpha and CR > 0.70), convergent validity (AVE > 0.50), and discriminant validity (HTMT < 0.90). Structural model results show that personalization significantly affects trust (β = 0.347, t = 6.426), satisfaction (β = 0.261, t = 4.424), and perception (β = 0.289, t = 5.352), while user experience positively influences trust (β = 0.366), satisfaction (β = 0.311), and perception (β = 0.298). In turn, trust (β = 0.276) and satisfaction (β = 0.317) positively shape perception, and perception directly drives loyalty (β = 0.331, t = 5.707). All hypotheses (H1–H9) were statistically supported (p < 0.001). The findings validate the integration of SET and S-O-R in explaining loyalty formation in digital commerce. This study contributes to the theoretical discourse on e-commerce behavior and offers practical insights for platform developers to enhance user retention through personalized, trust-based, and satisfaction-driven experiences.