diff --git a/src/Krizon/Google/Analytics/MeasurementProtocol/Resources/service.php b/src/Krizon/Google/Analytics/MeasurementProtocol/Resources/service.php index 7f322e8..7a402ca 100644 --- a/src/Krizon/Google/Analytics/MeasurementProtocol/Resources/service.php +++ b/src/Krizon/Google/Analytics/MeasurementProtocol/Resources/service.php @@ -243,6 +243,17 @@ ) ) ), + 'screenview' => array( + 'extends' => 'abstract.collect', + 'parameters' => array( + 't' => array( + 'description' => 'Pageview hit type', + 'location' => 'postField', + 'default' => 'screenview', + 'static' => true + ) + ) + ), 'event' => array( 'extends' => 'abstract.collect', 'parameters' => array( diff --git a/tests/Krizon/Google/Analytics/MeasurementProtocol/Test/MeasurementProtocolClientTest.php b/tests/Krizon/Google/Analytics/MeasurementProtocol/Test/MeasurementProtocolClientTest.php index 9bacb92..3a93f5d 100644 --- a/tests/Krizon/Google/Analytics/MeasurementProtocol/Test/MeasurementProtocolClientTest.php +++ b/tests/Krizon/Google/Analytics/MeasurementProtocol/Test/MeasurementProtocolClientTest.php @@ -83,6 +83,26 @@ public function testPageviewLive() $this->testPageview(false); } + public function testScreenview($mockResponse = true) + { + $response = $this->getResponse('screenview', array( + 'tid' => $this->getTrackingId(), + 'cid' => $this->getCustomerId(), + 't' => 'screenview', + 'cd' => 'Screen name / content description' + ), $mockResponse); + + $this->assertEquals(200, $response->getStatusCode()); + } + + /** + * @group internet + */ + public function testScreenviewLive() + { + $this->testScreenview(false); + } + public function testEvent($mockResponse = true) { $response = $this->getResponse('event', array(