• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/analytics/service.php
  • Класс: BitrixSeoAnalyticsService
  • Вызов: Service::getClientsProfiles
static function getClientsProfiles(RetargetingAuthAdapter $authAdapter)
{
	$type = $authAdapter->getType();
	return array_values(array_filter(array_map(function ($item) use ($type) {
		$service = new static();
		$service->setClientId($item['proxy_client_id']);

		$authAdapter = RetargetingAuthAdapter::create($type)->setService($service);

		$account = Account::create($type)->setService($service);
		$account->getRequest()->setAuthAdapter($authAdapter);

		$profile = $account->getProfileCached();
		if ($profile)
		{
			return $profile;
		}
		else
		{
			// if no profile, then may be auth was removed in service
			$authAdapter->removeAuth();
			return null;
		}
	}, $authAdapter->getAuthorizedClientsList())));
}