You are here

public function GoogleAnalyticResponseSubscriber::__construct in Multidomain Google Analytics 8.2

Same name and namespace in other branches
  1. 8 src/EventSubscriber/GoogleAnalyticResponseSubscriber.php \Drupal\multidomain_google_analytics\EventSubscriber\GoogleAnalyticResponseSubscriber::__construct()

Constructs a new Google Analytics response subscriber.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $configFactory: The config factory service.

\Drupal\domain\DomainNegotiatorInterface $negotiator: The domain negotiator service.

File

src/EventSubscriber/GoogleAnalyticResponseSubscriber.php, line 40

Class

GoogleAnalyticResponseSubscriber
Class GoogleAnalyticResponseSubscriber.

Namespace

Drupal\multidomain_google_analytics\EventSubscriber

Code

public function __construct(ConfigFactoryInterface $configFactory, DomainNegotiatorInterface $negotiator) {
  $this->config = $configFactory
    ->get('multidomain_google_analytics.settings');
  if ($negotiator
    ->getActiveDomain()) {
    $this->activeDomain = $negotiator
      ->getActiveId();
  }
}