This study examines the impact of customer relationship management (CRM) practices and social media marketing (SMM) activities on customer retention among MSMEs in Aceh. It considers the dual role of social media in relationship management (CRM) and business engagement (SMM). Recognizing the widespread use of social media, the study explores different stages of its adoption and utilization in business. A formalized social media business profile is used as the moderating variable, defined by a firm's formal allocation of responsibility, outsourcing, funding, governance of social media, and broader changes to structure, processes, leadership, training, and culture. Data was collected from 565 MSMEs using questionnaires and analyzed with partial least squares structural equation modeling (PLS-SEM) and multi-group analysis. The results demonstrated a high predictive power of the model on customer retention. Within CRM, the findings indicated a significant difference in the effect of key customer focus on customer retention, with higher effects observed in MSMEs that do not formalize their social media business profiles. Additionally, technology-based CRM showed significantly higher effects on customer retention for those who formalize their social media profiles. Within SMM, the study revealed significant differences in the effects of customization and trendiness on customer retention, both of which were more pronounced in MSMEs without formalized social media profiles. Furthermore, word-of-mouth had a significantly higher impact on customer retention for MSMEs with formalized social media profiles. This research contributes theoretically by developing an integrated framework that identifies how key customer focus, CRM organization, knowledge management, technology-based CRM, customization, entertainment, interaction, trendiness, and word-of-mouth influence customer retention. It also explores the moderating effects of formalized social media business profiles on CRM practices and SMM activities within MSMEs.