The outcome of a game session is derived from a series of events, decisions, and interactions that are made during the game. Many processes and techniques have been developed by the game industry in order to understand this outcome. A successful method is game analytics, which aims at understanding the player behavior patterns to improve game quality and enhance the player experience. However, the current methods for analytics are not sufficient to capture the underlying cause-and-effect influences that shape the outcome of a game session. These relationships allow developers and designers to better identify possible mistakes in the gameplay design or to fine-tune their games. In a recent work, Kohwalter et al. introduced a conceptual framework based on provenance to capture these relationships and manually instantiated such framework in some games. In this paper, we propose a concrete component for capturing provenance data and the causeand-effect relationships among game objects, and for automatically building the correspondent provenance graph. This provenance data allows a more powerful support for the visual game analytics. We implemented our component in the Unity game engine and show two case studies over open-source games.