_product = $observer->getEvent()->getProduct(); } /** * Check is Google Experiment enabled * * @return bool */ protected function _isGoogleExperimentActive() { return $this->_helper->isGoogleExperimentActive($this->_product->getStoreId()); } /** * Get data for saving code model * * @return array */ protected function _getCodeData() { return [ 'entity_type' => \Magento\GoogleOptimizer\Model\Code::ENTITY_TYPE_PRODUCT, 'entity_id' => $this->_product->getId(), 'store_id' => $this->_product->getStoreId(), 'experiment_script' => $this->_params['experiment_script'] ]; } }