Add Observer design pattern to manage analytics