gtmClass)) { throw new \Exception('GTM on component enabled, but GTM class is not defined!'); } if ($gtmData = $this->fetchGTMData()) { $componentsData['data-tracking-click'] = htmlentities(json_encode($gtmData, JSON_NUMERIC_CHECK | JSON_HEX_APOS)); return $componentsData; } return $componentsData; } protected function fetchGTMData() { if (method_exists($this->gtmClass, 'getPushData')) { return $this->gtmClass->getPushData($this); } return null; } }