Ejemplo n.º 1
0
 public function testHelperRendersAllowLinker()
 {
     $this->tracker->setAllowLinker(true);
     $expected = '_gaq.push(["_setAllowLinker",true])';
     $actual = $this->script->getCode();
     $this->assertContains($expected, $actual);
 }
Ejemplo n.º 2
0
 public function testHelperRendersAllowLinker()
 {
     $this->tracker->setAllowLinker(true);
     $expected = 'ga("create","123",{"allowLinker":true})';
     $actual = $this->script->getCode();
     $this->assertContains($expected, $actual);
 }
Ejemplo n.º 3
0
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('config');
     $gaConfig = $config['google_analytics'];
     $tracker = new Tracker($gaConfig['id']);
     if (isset($gaConfig['domain_name'])) {
         $tracker->setDomainName($gaConfig['domain_name']);
     }
     if (isset($gaConfig['allow_linker'])) {
         $tracker->setAllowLinker($gaConfig['allow_linker']);
     }
     if (true === $gaConfig['enable_display_advertising']) {
         $tracker->setEnableDisplayAdvertising(true);
     }
     if (true === $gaConfig['anonymize_ip']) {
         $tracker->setAnonymizeIp(true);
     }
     if (false === $gaConfig['enable']) {
         $tracker->setEnableTracking(false);
     }
     return $tracker;
 }
Ejemplo n.º 4
0
 public function testAllowLinkerDefaultsToFalse()
 {
     $tracker = new Tracker(123);
     $tracker->setAllowLinker(true);
     $this->assertTrue($tracker->getAllowLinker());
 }