Example #1
0
 public function testSetCustomMetric()
 {
     $googleAnalytics = new CMService_GoogleAnalytics_Client('');
     $environment = new CM_Frontend_Environment();
     $js = $googleAnalytics->getJs($environment);
     $this->assertNotContains('ga("set", "metric', $js);
     $googleAnalytics->setCustomMetric(2, 23.34);
     $js = $googleAnalytics->getJs($environment);
     $this->assertContains('ga("set", "metric2", "23.34")', $js);
 }