public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $sm = $serviceLocator->getServiceLocator();
     $script = $sm->get('SlmGoogleAnalytics\\Service\\ScriptFactory');
     $helper = new GoogleAnalytics($script);
     $config = $sm->get('config');
     $config = $config['google_analytics'];
     if (isset($config['container_name'])) {
         $helper->setContainerName($config['container_name']);
     }
     return $helper;
 }
 protected function getOutput(Helper $helper)
 {
     $helper->appendScript();
     $containerName = $helper->getContainerName();
     $container = $helper->getView()->plugin($containerName);
     return $container->toString();
 }