/** * @param \GoogleAnalyticsTracker\HitTypes\Page $page * @return mixed */ public function map($page) { if (!$page instanceof \GoogleAnalyticsTracker\HitTypes\Page) { throw new \UnexpectedValueException("The Page Mapper only accepts Page HitTypes"); } $data = array('t' => \GoogleAnalyticsTracker\HitTypes\Page::TYPE, 'dh' => $page->getDomain(), 'dp' => $page->getPage()); if ($page->hasTitle()) { $data['dt'] = $page->getTitle(); } $data = array_merge($data, parent::map($page)); return $data; }