_audit->data)) {
$this->_error = true;
return;
}
if ($this->_audit->sq_analytics_gsc_connected) {
if (isset($this->_audit->data->sq_analytics_gsc->keyword) && $this->_audit->data->sq_analytics_gsc->keyword <> '' &&
isset($this->_audit->data->sq_analytics_gsc->ctr)) {
$this->_keyword = $this->_audit->data->sq_analytics_gsc->keyword;
$this->_ctr = $this->_audit->data->sq_analytics_gsc->ctr;
} elseif (isset($this->_audit->data->sq_seo_keywords->value)) {
$this->_keyword = $this->_audit->data->sq_seo_keywords->value;
$this->_ctr = 0;
}
} else {
$this->_error = true;
}
}
public function setTasks($tasks) {
parent::setTasks($tasks);
$this->_tasks[$this->_category] = array(
'clickthrough' => array(
'title' => __("Clickthrough rate", _SQ_PLUGIN_NAME_),
'description' => sprintf(__("CTR is the number of clicks that your page receives divided by the number of times your page appeared in search results: clicks รท impressions = CTR. %s For example, if you had 5 clicks and 100 impressions, then your CTR would be 5%%. %s Keep the CTR above %s with enhanced headlines.", _SQ_PLUGIN_NAME_), '
', '
', self::CTR_MINVAL . '%'),
),
);
}
/*********************************************/
/**
* Check if the Google Search Console is connected
* @return string
*/
public function getHeader() {
$header = '