_analyticsHelper = $analyticsHelper; $this->gtagConfiguration = $gtagConfiguration ?: ObjectManager::getInstance()->get(GtagConfiguration::class); parent::__construct($context); } /** * Checks if Google Experiment is enabled * * @param string $store * @return bool */ public function isGoogleExperimentEnabled($store = null) { return ($this->scopeConfig->isSetFlag( self::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE, $store )) || ($this->scopeConfig->isSetFlag( self::XML_PATH_ENABLED_GA4, ScopeInterface::SCOPE_STORE, $store )); } /** * Checks if Google Experiment is active * * @param string $store * @return bool */ public function isGoogleExperimentActive($store = null) { return $this->isGoogleExperimentEnabled($store) && ( $this->_analyticsHelper->isGoogleAnalyticsAvailable($store) || $this->gtagConfiguration->isGoogleAnalyticsAvailable($store) ); } }