Skip to content

Яндекс в Search Activity (3.4.3)

У меня сейчас в админке на странице Search Activity только переходы по поисковым запросам с гугла.

Можно ли добавить туда яндекс, чтобы видеть переходы с него?

Featured Replies

Можно.

Открыть admin\sources\base\ipsRegistry.php

 

Найти

	array( 'name' => 'Google', 'match' => '/http\:\/\/www\.google/', 'parser' => 'parseGoogleUrl' ),

Ниже добавить

	array( 'name' => 'Yandex', 'match' => '/http\:\/\/yandex\./', 'parser' => 'parseYandexUrl' ),

 

Найти

protected function parseBingUrl($url)

Выше добавить

protected function parseYandexUrl($url)
{
	$matches = array();
	if(preg_match('/text=([^&]+)/', $url, $matches))
	{
		if(isset($matches[1]))
		{
			$keywords = $matches[1];
			$keywords = urldecode($keywords);
			$keywords = str_replace('+', ' ', $keywords);
			$keywords = str_replace('%20', ' ', $keywords);
			return $keywords;
		}
	}

	return null;
}

  • Author

Спасибо, заработало :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.