PurposeThis study seeks to understand the communication factors associated with effective social media for nonprofit organizations (NPOs). Specifically, the study investigated how interactive and emotional communication strategies influence public engagement in different ways, and how the effects differ by service-oriented and other types of NPOs.Design/methodology/approachUsing computer-assisted textual and emotional analyses, the authors examined the functional interactivity, contingency interactivity and emotion elements of 301,559 tweets from the 100 largest US nonprofits. Negative binomial regression was applied to test the relationships among these elements and public engagement on Twitter (i.e. likes and retweets).FindingsFindings revealed negative effects of functional interactivity on likes, negative effects of contingency interactivity on likes and retweets but a positive effect of functional interactivity on retweets. The findings also showed negative effects of emotion valence on likes and retweets but positive effects of emotion strength on likes and retweets. There were varying effects of interactivity and emotion on public engagement for service-oriented and other types of NPOs.Originality/valueThis study advances the nonprofit social media scholarship in several ways. First, this study suggests a clear yet largely ignored distinction in the effects of functional and contingency interactivity on public engagement. Second, this study is an early attempt to examine the role and impact of emotion elements in nonprofit social media success without downplaying the role of interactivity. Third, this study is one of the earliest attempts to include interaction effects for different types of NPOs. Last, this study contributes to the organizational social media use research by demonstrating the benefits of computer-assisted approaches in processing text data on social media. From a practical perspective, this study provides strategic guidelines for NPOs to design effective communication contents and improve their public engagement on social media.