In today’s interconnected world, the widespread impact of social media on consumer behavior has become a focus of attention for researchers, marketers, and businesses. The rapid development of digital technology, coupled with the widespread adoption of social media platforms, has changed the way individuals interact with brands, make purchasing decisions, and navigate consumer patterns. This article attempts to explore the multifaceted relationship between social media and consumer behavior, delving into the complexity of this dynamic interaction. The author chose the consumer group size, consumers’ interaction, professional level of opinion leaders, and activity level of opinion leaders are selected as independent variables, perceived risk, and perceived value as mediating variables, and purchasing behavior as dependent variables. The theoretical model of this research is constructed, and 10 research hypotheses are proposed. Through a questionnaire survey, 100 valid data were collected. SPSSAU24 was used for descriptive statistics, reliability, validity, and factor analysis to verify the reliability of the data while a quantitative influence model will be constructed to illustrate the interactivity. The investigation yielded the following conclusion. First, the consumer group size, consumer interactivity level, professional level of opinion leaders, and the activity level of opinion leaders positively affect the perceived value. Second, the consumer group size, consumer interactivity level, professional level of opinion, and the activity level of opinion leaders negatively affect the perceived risk. Third, perceived value has a positive relationship with purchasing behavior. Fourth, perceived risk has a negative relationship with purchasing behavior.