Example #1
0
 protected function _execute(CM_Params $params)
 {
     $propertyId = $params->getString('propertyId');
     $parameterList = $params->getArray('parameterList');
     $client = new CMService_GoogleAnalytics_MeasurementProtocol_Client($propertyId);
     $client->_submitHit($parameterList);
 }
Example #2
0
 public function testGetRandomClientId()
 {
     $client = new CMService_GoogleAnalytics_MeasurementProtocol_Client('foo');
     $this->assertInternalType('string', $client->getRandomClientId());
     $this->assertGreaterThan(5, strlen($client->getRandomClientId()));
     $this->assertNotEquals($client->getRandomClientId(), $client->getRandomClientId());
 }
Example #3
0
 /**
  * @return \GuzzleHttp\Client
  */
 protected function _getGuzzleClient()
 {
     if (!self::$_client) {
         self::$_client = new \GuzzleHttp\Client(['base_url' => 'http://www.google-analytics.com']);
     }
     return self::$_client;
 }