The educational landscape continues to transform significantly in a way that it engages students' interest and improves learning processes. Such an example is the gradual use of educational games, which seem to be an exceptional means to motivate and engage students in ways that will make learning more challenging and interesting for them. However, although educational games are a very interesting tool that could be used in education, an interesting challenge that should be addressed is the identification of all the ways students' progress and results can be measured for examination. This way, there is a high demand for accountability regarding the measurement and analysis of enriched game based learning activities or game-based learning analytics (GBLA). This demand is especially highlighted in one of the most difficult areas of Computer Science, which is computer programming education. In this paper, we are proposing a framework that will guide the incorporation of learning analytics mechanisms in computer programming education. We demonstrate this process through the implementation of the framework in an educational Massive Multiplayer Online Role-Playing Game we have developed for the domain.