add twig method addEvent for analytics