Purpose: This study aims to deepen the understanding of the influence of viral marketing on consumer buying decisions by positioning consumer psychology, specifically herd behavior, as a moderating variable in the relationship between viral marketing and buying decisions. Methodology: This causal study examines the impact of viral marketing on consumer buying decisions and the role of herd behavior in influencing this relationship among users of Facebook, Instagram, YouTube, and TikTok in Samarinda City. The research method used is PLS-SEM, with a total of 65 respondents. Results: Viral marketing significantly affects buying decisions. This indicates that more effective and extensive marketing efforts to make a product viral increase the likelihood of consumers making a purchase. However, herd behavior, as a moderating variable, does not show a significant effect. While herd behavior, which refers to a person’s tendency to follow others’ decisions, may influence buying decisions, its impact is not strong enough in the context of viral marketing and buying decisions. Limitations: This study focuses on users of social media platforms in Samarinda City with the largest number of users, namely Facebook, Instagram, YouTube, and TikTok, who have been exposed to viral products. With fewer than 100 respondents, the results of this study cannot serve as a strong enough basis to explain consumer behavior in general with regard to various types of viral products. Contribution: The study highlights that viral marketing plays a crucial role in driving consumer buying decisions, but the influence of herd behavior as a moderating factor is not significant. This opens the door for further research into other factors that might strengthen the relationship between viral marketing and buying decisions.