Collaborative learning can improve the pedagogical effectiveness of MOOCs. Group formation, an essential step in the design of collaborative learning activities, can be challenging in MOOCs given the scale and the wide variety in such contexts. We discuss the need for considering the behaviours of the students in the course to form groups in MOOC contexts, and propose a grouping approach that employs homogeneity in terms of students? engagement in the course. Two grouping strategies with different degrees of homogeneity are derived from this approach, and their impact to form successful groups is examined in a real MOOC context. The grouping criteria were established using student activity logs (e.g. page-views). The role of the timing of grouping was also examined by carrying out the intervention once in the first and once in the second half of the course. The results indicate that in both interventions, the groups formed with a greater degree of homogeneity had higher rates of task-completion and peer interactions, Additionally, students from these groups reported higher levels of satisfaction with their group experiences. On the other hand, a consistent improvement of all indicators was observed in the second intervention, since student engagement becomes more stable later in the course.