Despite the advantages of MOOCs, such as the open and free access to education, these courses are criticized for students' lack of motivation and their high dropout rates. Gamification is a technique used to increase student motivation and engagement in small-scale educational contexts. However, the effects of gamification on student engagement have been scarcely explored in MOOC environments, and the findings so far are inconsistent. To address this gap, this research work examines the students' behavior toward earning badges and how it relates to their engagement in a gamified MOOC. According to the results, the behaviors toward badges of the active students were generally positive and significantly correlated with other variables measuring their engagement (e.g., pageviews, submitted tasks, forum posts), although this positive behavior seems to decrease throughout the course. Additionally, students that reported high motivation by badges at the end of the course showed a higher engagement level than those that were not appealed by badges.