Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
rv777

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

Recommended Posts

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

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

Share this post


Link to post
Share on other sites

Можно.

Открыть 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;
}

  • Upvote 2

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...