As information technology continues to evolve rapidly, programming skills become increasingly crucial. To be able to construct superb programming skills, the training must begin before college or even senior high school. However, when developing comprehensive training programmers, the learning and teaching processes must be considered. In order to improve the students' learning outcome and engagement in programming course, this study applied learning analytics into the proposed massive online open courses (MOOCs) enabled collaborative programming course. Through the proposed learning activity, instructors receive a monthly report that explains which students are at risk and in need of timely intervention. This study conducted an experiment to evaluate the effectiveness of the proposed learning activity. Students in the experimental group received learning interventions from an instructor according to the result of learning analytics, and students in the control group received interventions according to the instructor's observation. The data for this study were collected over 10 weeks at a university in Taiwan. The result indicated that the proposed programming course with learning analytics improved students' learning outcomes and levels of engagement.