It would be cleaner if you defined the GoogleAnalyticsHelper as a service, fetch it from the container and inject (or set) the necessary properties.